summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/buildstream/_project.py5
-rw-r--r--src/buildstream/_stream.py6
-rw-r--r--tests/frontend/buildcheckout.py2
3 files changed, 5 insertions, 8 deletions
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index 00beebfab..7260d9614 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -482,13 +482,8 @@ class Project():
# 2. The ArtifactCache.contains() method expects an Element
# and a key, not a ref.
#
- artifactdir = self._context.artifactdir
artifacts = []
for ref in targets:
- if not os.path.exists(os.path.join(artifactdir, ref)):
- raise LoadError("{}\nis not present in the artifact cache ({})".format(ref, artifactdir),
- LoadErrorReason.MISSING_FILE)
-
artifacts.append(ArtifactElement._new_from_artifact_ref(ref, self._context, task))
ArtifactElement._clear_artifact_refs_cache()
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 5d5c355b1..083dc1c43 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -414,7 +414,8 @@ class Stream():
selection=selection,
ignore_junction_targets=ignore_junction_targets,
use_artifact_config=use_config,
- artifact_remote_url=remote)
+ artifact_remote_url=remote,
+ load_refs=True)
if not self._artifacts.has_fetch_remotes():
raise StreamError("No artifact caches available for pulling artifacts")
@@ -559,7 +560,8 @@ class Stream():
self._export_artifact(tar, location, compression, target, hardlinks, virdir)
except AttributeError as e:
raise ArtifactError("Artifact reference '{}' seems to be invalid. "
- "Note that an Element name can also be used.".format(artifact))from e
+ "Note that an Element name can also be used."
+ .format(artifact._element.get_artifact_name())) from e
else:
try:
with target._prepare_sandbox(scope=scope, directory=None,
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index 98b179b9e..6281217b7 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -358,7 +358,7 @@ def test_build_checkout_invalid_ref(datafiles, cli):
checkout_args = ['artifact', 'checkout', '--deps', 'none', '--tar', checkout, non_existent_artifact]
result = cli.run(project=project, args=checkout_args)
- assert "{}\nis not present in the artifact cache".format(non_existent_artifact) in result.stderr
+ assert "Artifact reference '{}' seems to be invalid".format(non_existent_artifact) in result.stderr
@pytest.mark.datafiles(DATA_DIR)