Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 108-integration-tests-not-idempotent-and-self-contained
  • 131-behavior-of-except-argument-is-frustrating-and-confusing
  • 132-loading-external-plugins-works-without-explicit-requirement-in-project-conf
  • 135-expire-artifacts-in-local-cache
  • 135-expire-artifacts-in-local-cache-clean
  • 138-aborting-bst-push-command-causes-stack-trace-3
  • 142-potentially-printing-provenance-more-than-once-in-loaderrors
  • 188-trigger-external-commands-on-certain-events
  • 214-filter-workspacing-rework
  • 218-allow-specifying-the-chroot-binary-to-use-for-sandboxes-on-unix-platforms
  • 239-use-pylint-for-linting
  • 372-allow-queues-to-run-auxilliary-jobs-after-an-element-s-job-finishes
  • 380-untagged-bst
  • 463-make-dependency-type-default-to-build
  • 537-mirror-fallback-does-not-work-for-git
  • 64-clarify-about-plugins-importing-other-plugins
  • 716-add-example-with-build-directory-outside-of-source-directory
  • 716-add-example-with-build-directory-outside-of-source-directory-2
  • 81-non-empty-read-only-directories-not-handled-during-bst-build-and-others
  • BenjaminSchubert/fix-quota-tests
  • Qinusty/235-manifest
  • Qinusty/397
  • Qinusty/470-bst-track-yaml-indent
  • Qinusty/553-backport-1.2
  • Qinusty/663-missing-cache-key-workspace-open
  • Qinusty/backport-576
  • Qinusty/backport-skipped-562
  • Qinusty/gitlab-ci
  • Qinusty/gitlab-ci-duration
  • Qinusty/message-helpers
  • Qinusty/pytest_cache_gitignore
  • abderrahim/cached-failure
  • abderrahim/cachekey-strictrebuild
  • abderrahim/cleanup-speedup
  • abderrahim/makemaker
  • abderrahim/resolve-remotes
  • abderrahim/source-cache
  • abderrahim/stage-artifact-scriptelement
  • abderrahim/virtual-extract
  • adamjones/contributing
  • adamjones/contribution-guide
  • aevri/assert_no_unexpected_size_writes
  • aevri/casdprocessmanager2
  • aevri/check_spawn_ci_working
  • aevri/enable_spawn_ci_4
  • aevri/enable_spawn_ci_6
  • aevri/enable_spawn_ci_7
  • aevri/json_artifact_meta
  • aevri/picklable_jobs
  • aevri/plugin_venvs
  • aevri/provenance_scope
  • aevri/pylint_ignore_argsdiff
  • aevri/safe_noninteractive
  • aevri/win32
  • aevri/win32_minimal
  • aevri/win32_minimal_seemstowork_20190829
  • aevri/win32_receive_signals
  • aevri/win32_temptext
  • alexfazakas/add-bst-init-argument
  • alexfazakas/use-merge-trains
  • always-do-linting
  • another-segfault
  • becky/locally_downloaded_files
  • becky/shell_launch_errors
  • bschubert/add-isolated-tests
  • bschubert/isort
  • bschubert/merge-parent-child-job
  • bschubert/more-mypy
  • bschubert/no-multiprocessing-bak
  • bschubert/no-multiprocessing-full
  • bschubert/optimize-deps
  • bschubert/optimize-element-init
  • bschubert/optimize-loader-sorting
  • bschubert/optimize-mapping-node
  • bschubert/optimize-splits
  • bschubert/remove-multiline-switch-for-re
  • bschubert/remove-parent-child-pipe
  • bschubert/remove-pip-source
  • bschubert/standardize-source-tests
  • bschubert/test-plugins
  • bschubert/update-coverage
  • bst-1
  • bst-1.0
  • bst-1.2
  • bst-1.4
  • bst-pull
  • bst-push
  • buildbox-pre-will
  • cache-key-v0
  • caching_build_trees
  • cascache_timeouts
  • chandan/automate-pypi-release
  • chandan/cli-deps
  • chandan/contrib-dependencies
  • chandan/element-cache
  • chandan/enums
  • chandan/extras-require
  • chandan/macos-multiprocessing
  • chandan/moar-parallelism
  • chandan/moar-runners
  • 1.0.0
  • 1.0.1
  • 1.1.0
  • 1.1.1
  • 1.1.2
  • 1.1.3
  • 1.1.4
  • 1.1.5
  • 1.1.6
  • 1.1.7
  • 1.2.0
  • 1.2.1
  • 1.2.2
  • 1.2.3
  • 1.2.4
  • 1.2.5
  • 1.2.6
  • 1.2.7
  • 1.2.8
  • 1.3.0
  • 1.3.1
  • 1.4.0
  • 1.4.1
  • 1.4.2
  • 1.4.3
  • 1.5.0
  • 1.5.1
  • 1.6.0
  • 1.6.1
  • 1.91.0
  • 1.91.1
  • 1.91.2
  • 1.91.3
  • 1.93.0
  • 1.93.1
  • 1.93.2
  • 1.93.3
  • 1.93.4
  • 1.93.5
  • CROSS_PLATFORM_SEPT_2017
  • PRE_CAS_MERGE_JULY_2018
  • bst-1-branchpoint
  • bst-1.2-branchpoint
  • bst-1.4-branchpoint
144 results

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Select Git revision
  • 108-integration-tests-not-idempotent-and-self-contained
  • 131-behavior-of-except-argument-is-frustrating-and-confusing
  • 132-loading-external-plugins-works-without-explicit-requirement-in-project-conf
  • 135-expire-artifacts-in-local-cache
  • 135-expire-artifacts-in-local-cache-clean
  • 138-aborting-bst-push-command-causes-stack-trace-3
  • 142-potentially-printing-provenance-more-than-once-in-loaderrors
  • 188-trigger-external-commands-on-certain-events
  • 214-filter-workspacing-rework
  • 218-allow-specifying-the-chroot-binary-to-use-for-sandboxes-on-unix-platforms
  • 239-use-pylint-for-linting
  • 372-allow-queues-to-run-auxilliary-jobs-after-an-element-s-job-finishes
  • 380-untagged-bst
  • 463-make-dependency-type-default-to-build
  • 537-mirror-fallback-does-not-work-for-git
  • 64-clarify-about-plugins-importing-other-plugins
  • 716-add-example-with-build-directory-outside-of-source-directory
  • 716-add-example-with-build-directory-outside-of-source-directory-2
  • 81-non-empty-read-only-directories-not-handled-during-bst-build-and-others
  • BenjaminSchubert/fix-quota-tests
  • Qinusty/235-manifest
  • Qinusty/397
  • Qinusty/470-bst-track-yaml-indent
  • Qinusty/553-backport-1.2
  • Qinusty/663-missing-cache-key-workspace-open
  • Qinusty/backport-576
  • Qinusty/backport-skipped-562
  • Qinusty/gitlab-ci
  • Qinusty/gitlab-ci-duration
  • Qinusty/message-helpers
  • Qinusty/pytest_cache_gitignore
  • abderrahim/cached-failure
  • abderrahim/cachekey-strictrebuild
  • abderrahim/cleanup-speedup
  • abderrahim/makemaker
  • abderrahim/resolve-remotes
  • abderrahim/source-cache
  • abderrahim/stage-artifact-scriptelement
  • abderrahim/virtual-extract
  • adamjones/contributing
  • adamjones/contribution-guide
  • aevri/assert_no_unexpected_size_writes
  • aevri/casdprocessmanager2
  • aevri/check_spawn_ci_working
  • aevri/enable_spawn_ci_4
  • aevri/enable_spawn_ci_6
  • aevri/enable_spawn_ci_7
  • aevri/json_artifact_meta
  • aevri/picklable_jobs
  • aevri/plugin_venvs
  • aevri/provenance_scope
  • aevri/pylint_ignore_argsdiff
  • aevri/safe_noninteractive
  • aevri/win32
  • aevri/win32_minimal
  • aevri/win32_minimal_seemstowork_20190829
  • aevri/win32_receive_signals
  • aevri/win32_temptext
  • alexfazakas/add-bst-init-argument
  • alexfazakas/use-merge-trains
  • always-do-linting
  • another-segfault
  • becky/locally_downloaded_files
  • becky/shell_launch_errors
  • bschubert/add-isolated-tests
  • bschubert/isort
  • bschubert/merge-parent-child-job
  • bschubert/more-mypy
  • bschubert/no-multiprocessing-bak
  • bschubert/no-multiprocessing-full
  • bschubert/optimize-deps
  • bschubert/optimize-element-init
  • bschubert/optimize-loader-sorting
  • bschubert/optimize-mapping-node
  • bschubert/optimize-splits
  • bschubert/remove-multiline-switch-for-re
  • bschubert/remove-parent-child-pipe
  • bschubert/remove-pip-source
  • bschubert/standardize-source-tests
  • bschubert/test-plugins
  • bschubert/update-coverage
  • bst-1
  • bst-1.0
  • bst-1.2
  • bst-1.4
  • bst-pull
  • bst-push
  • buildbox-pre-will
  • cache-key-v0
  • caching_build_trees
  • cascache_timeouts
  • chandan/automate-pypi-release
  • chandan/cli-deps
  • chandan/contrib-dependencies
  • chandan/element-cache
  • chandan/enums
  • chandan/extras-require
  • chandan/macos-multiprocessing
  • chandan/moar-parallelism
  • chandan/moar-runners
  • 1.0.0
  • 1.0.1
  • 1.1.0
  • 1.1.1
  • 1.1.2
  • 1.1.3
  • 1.1.4
  • 1.1.5
  • 1.1.6
  • 1.1.7
  • 1.2.0
  • 1.2.1
  • 1.2.2
  • 1.2.3
  • 1.2.4
  • 1.2.5
  • 1.2.6
  • 1.2.7
  • 1.2.8
  • 1.3.0
  • 1.3.1
  • 1.4.0
  • 1.4.1
  • 1.4.2
  • 1.4.3
  • 1.5.0
  • 1.5.1
  • 1.6.0
  • 1.6.1
  • 1.91.0
  • 1.91.1
  • 1.91.2
  • 1.91.3
  • 1.93.0
  • 1.93.1
  • 1.93.2
  • 1.93.3
  • 1.93.4
  • 1.93.5
  • CROSS_PLATFORM_SEPT_2017
  • PRE_CAS_MERGE_JULY_2018
  • bst-1-branchpoint
  • bst-1.2-branchpoint
  • bst-1.4-branchpoint
144 results
Show changes
Commits on Source (10)
......@@ -16,6 +16,7 @@ norecursedirs = tests/integration/project integration-cache tmp __pycache__ .egg
python_files = tests/*/*.py
env =
D:BST_TEST_SUITE=True
D:HOME=./tmp
D:XDG_CACHE_HOME=./tmp/cache
D:XDG_CONFIG_HOME=./tmp/config
D:XDG_DATA_HOME=./tmp/share
......
......@@ -823,7 +823,9 @@ class CASCache():
# already in local repository
return objpath
remote._fetch_blob(digest)
batch = _CASBatchRead(remote)
batch.add(digest)
batch.send()
return objpath
......
......@@ -247,25 +247,6 @@ class CASRemote():
return self.cascache.add_object(buffer=message_buffer, instance_name=self.local_cas_instance_name)
################################################
# Local Private Methods #
################################################
def _fetch_blob(self, digest):
local_cas = self.cascache._get_local_cas()
request = local_cas_pb2.FetchMissingBlobsRequest()
request.instance_name = self.local_cas_instance_name
request_digest = request.blob_digests.add()
request_digest.CopyFrom(digest)
response = local_cas.FetchMissingBlobs(request)
for blob_response in response.responses:
if blob_response.status.code == code_pb2.NOT_FOUND:
raise BlobNotFound(response.digest.hash, "Failed to download blob {}: {}".format(
blob_response.digest.hash, blob_response.status.code))
if blob_response.status.code != code_pb2.OK:
raise CASRemoteError("Failed to download blob {}: {}".format(
blob_response.digest.hash, blob_response.status.code))
# Represents a batch of blobs queued for fetching.
#
......
......@@ -4,6 +4,7 @@ import sys
from functools import partial
import fcntl
import shutil
import click
from .. import _yaml
from .._exceptions import BstError, LoadError, AppError
......@@ -1219,19 +1220,45 @@ def artifact_push(app, elements, deps, remote):
# Artifact Log Command #
################################################################
@artifact.command(name='log', short_help="Show logs of artifacts")
@click.option('--out',
type=click.Path(file_okay=True, writable=True),
help="Output logs to individual files in the specified path. If absent, logs are written to stdout.")
@click.argument('artifacts', type=click.Path(), nargs=-1)
@click.pass_obj
def artifact_log(app, artifacts):
def artifact_log(app, artifacts, out):
"""Show build logs of artifacts"""
with app.initialized():
log_file_paths = app.stream.artifact_log(artifacts)
for log in log_file_paths:
with open(log) as f:
data = f.read()
artifact_logs = app.stream.artifact_log(artifacts)
if not out:
try:
for log in list(artifact_logs.values()):
with open(log[0], 'r') as f:
data = f.read()
click.echo_via_pager(data)
except (OSError, FileNotFoundError):
click.echo("Error: file cannot be opened", err=True)
sys.exit(1)
click.echo_via_pager(data)
else:
try:
os.mkdir(out)
except FileExistsError:
click.echo("Error: {} already exists".format(out), err=True)
sys.exit(1)
for name, log_files in artifact_logs.items():
if len(log_files) > 1:
os.mkdir(name)
for log in log_files:
dest = os.path.join(out, name, log)
shutil.copy(log, dest)
# make a dir and write in log files
else:
log_name = os.path.splitext(name)[0] + '.log'
dest = os.path.join(out, log_name)
shutil.copy(log_files[0], dest)
# write a log file
################################################################
......
......@@ -648,7 +648,7 @@ class Stream():
# Return list of Element and/or ArtifactElement objects
target_objects = self.load_selection(targets, selection=PipelineSelection.NONE, load_refs=True)
log_file_paths = []
artifact_logs = {}
for obj in target_objects:
ref = obj.get_artifact_name()
if not obj._cached():
......@@ -658,9 +658,9 @@ class Stream():
self._message(MessageType.WARN, "{} is cached without log files".format(ref))
continue
log_file_paths.extend(obj.get_logs())
artifact_logs[obj.name] = obj.get_logs()
return log_file_paths
return artifact_logs
# artifact_list_contents()
#
......
......@@ -69,8 +69,7 @@ def test_artifact_log(cli, datafiles):
# Read the log via glob
result = cli.run(project=project, args=['artifact', 'log', 'test/target/*'])
assert result.exit_code == 0
# The artifact is cached under both a strong key and a weak key
assert (log + log) == result.output
assert log == result.output
@pytest.mark.datafiles(DATA_DIR)
......@@ -140,6 +139,38 @@ def test_artifact_list_exact_contents_glob(cli, datafiles):
assert artifact in result.output
@pytest.mark.datafiles(DATA_DIR)
def test_artifact_log_files(cli, datafiles):
project = str(datafiles)
# Ensure we have an artifact to read
result = cli.run(project=project, args=['build', 'target.bst'])
assert result.exit_code == 0
logfiles = os.path.join(project, "logfiles")
target = os.path.join(project, logfiles, "target.log")
import_bin = os.path.join(project, logfiles, "import-bin.log")
# Ensure the logfile doesn't exist before the command is run
assert not os.path.exists(logfiles)
assert not os.path.exists(target)
assert not os.path.exists(import_bin)
# Run the command and ensure the file now exists
result = cli.run(project=project, args=['artifact', 'log', '--out', logfiles, 'target.bst', 'import-bin.bst'])
assert result.exit_code == 0
assert os.path.exists(logfiles)
assert os.path.exists(target)
assert os.path.exists(import_bin)
# Ensure the file contains the logs by checking for the LOG line
with open(target, 'r') as f:
data = f.read()
assert "LOG target.bst" in data
with open(import_bin, 'r') as f:
data = f.read()
assert "LOG import-bin.bst" in data
# Test that we can delete the artifact of the element which corresponds
# to the current project state
@pytest.mark.datafiles(DATA_DIR)
......
......@@ -14,15 +14,23 @@ class Bzr(Repo):
super().__init__(directory, subdir)
self.bzr = BZR
self.env = os.environ.copy()
self.env.update(BZR_ENV)
def create(self, directory):
# Work around race condition in bzr's creation of ~/.bazaar in
# ensure_config_dir_exists() when running tests in parallel.
bazaar_config_dir = os.path.expanduser('~/.bazaar')
os.makedirs(bazaar_config_dir, exist_ok=True)
branch_dir = os.path.join(self.repo, 'trunk')
subprocess.call([self.bzr, 'init-repo', self.repo], env=BZR_ENV)
subprocess.call([self.bzr, 'init', branch_dir], env=BZR_ENV)
subprocess.call([self.bzr, 'init-repo', self.repo], env=self.env)
subprocess.call([self.bzr, 'init', branch_dir], env=self.env)
self.copy_directory(directory, branch_dir)
subprocess.call([self.bzr, 'add', '.'], env=BZR_ENV, cwd=branch_dir)
subprocess.call([self.bzr, 'add', '.'], env=self.env, cwd=branch_dir)
subprocess.call([self.bzr, 'commit', '--message="Initial commit"'],
env=BZR_ENV, cwd=branch_dir)
env=self.env, cwd=branch_dir)
return self.latest_commit()
......@@ -42,4 +50,4 @@ class Bzr(Repo):
self.bzr, 'version-info',
'--custom', '--template={revno}',
os.path.join(self.repo, 'trunk')
], env=BZR_ENV, universal_newlines=True).strip()
], env=self.env, universal_newlines=True).strip()
......@@ -18,11 +18,14 @@ class Git(Repo):
super().__init__(directory, subdir)
self.env = os.environ.copy()
self.env.update(GIT_ENV)
def _run_git(self, *args, **kwargs):
argv = [GIT]
argv.extend(args)
if 'env' not in kwargs:
kwargs['env'] = dict(GIT_ENV, PWD=self.repo)
kwargs['env'] = dict(self.env, PWD=self.repo)
kwargs.setdefault('cwd', self.repo)
kwargs.setdefault('check', True)
return subprocess.run(argv, **kwargs)
......
......@@ -55,6 +55,7 @@ passenv =
#
setenv =
py{35,36,37}: COVERAGE_FILE = {envtmpdir}/.coverage
py{35,36,37}: HOME = {envtmpdir}
py{35,36,37}: XDG_CACHE_HOME = {envtmpdir}/cache
py{35,36,37}: XDG_CONFIG_HOME = {envtmpdir}/config
py{35,36,37}: XDG_DATA_HOME = {envtmpdir}/share
......