aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/sandbox
Commit message (Collapse)AuthorAge
* Automated [] rollback of commit 525fa71b0d6f096e9bfb180f688a4418c4974eb4.Gravatar Yue Gan2016-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Contributor finds some bugs and after fixing some bugs there are more bugs to fix now. *** Original change description *** Mount whole directories into the sandbox when possible This halves the overhead with sandboxing enabled vs disabled for a test that basically only mounts a bunch of files out of a directory, and slows that same test with a single extra file added to the directory (but not mounted) by only ~4%. The test is <https://gist.github.com/bsilver8192/10527a862ce16bb7f79a> with 30000 inputs moved to a subdirectory and on... *** ROLLBACK_OF=119138157 -- MOS_MIGRATED_REVID=119828267
* More detailed error message for sandbox failures in test, when ↵Gravatar Yue Gan2016-04-13
| | | | | | | | | --sandbox_debug and --verbose_failures are on. See discussion in #1049. RELNOTES: -- MOS_MIGRATED_REVID=119635080
* Refactor BlazeWorkspace creation to happen after BlazeRuntime construction.Gravatar Ulf Adams2016-04-13
| | | | | | | | As part of that, move a BinTools and the WorkspaceStatusActionFactory to the BlazeWorkspace. -- MOS_MIGRATED_REVID=119633702
* Mount whole directories into the sandbox when possibleGravatar Brian Silverman2016-04-07
| | | | | | | | | | | | | | | | | | | | This halves the overhead with sandboxing enabled vs disabled for a test that basically only mounts a bunch of files out of a directory, and slows that same test with a single extra file added to the directory (but not mounted) by only ~4%. The test is <https://gist.github.com/bsilver8192/10527a862ce16bb7f79a> with 30000 inputs moved to a subdirectory and only 10 genrules. This change means symlinks will be mounted directly as their target rather than as a symlink, but this solves some weird behavior with multi-level symlinks and will only break things which don't declare all of their dependencies. -- Change-Id: I1aa39dccb2e5fca2893bdab9065ee043d34019b2 Reviewed-on: https://bazel-review.googlesource.com/#/c/3220/ MOS_MIGRATED_REVID=119138157
* Move most BlazeRuntime methods related to workspace directories to CommandEnv.Gravatar Ulf Adams2016-03-30
| | | | | -- MOS_MIGRATED_REVID=118561661
* Fix #1063: When a temporary file was created in /etc while we were globbing ↵Gravatar Philipp Wollermann2016-03-21
| | | | | | | the list of files to mount, but was deleted by the time the namespace-sandbox actually mounted the files, it would crash with a "file not found" error. -- MOS_MIGRATED_REVID=117726198
* sandbox:Gravatar Yue Gan2016-03-17
| | | | | | | | | | | | - add flag --sandbox_add_path, which takes a list of additional paths as argument and mount these paths to sandbox. Fixes #884. - mount target of /etc/resolv.conf if it is a symlink. Fixes #738. RELNOTES: - add flag --sandbox_add_path, which takes a list of additional paths as argument and mount these paths to sandbox. - mount target of /etc/resolv.conf if it is a symlink. -- MOS_MIGRATED_REVID=117364211
* Let ActionContextConsumer#getActionContexts() return a Multimap instead of a ↵Gravatar Philipp Wollermann2016-02-28
| | | | | | | | | | | Map. This makes it possible to request multiple implementations of the same ActionContext to be available via Executor#getContext(). Currently, specialized SpawnActionContexts like the sandbox or the worker strategy that might have to do a fallback each instantiate their own private copy of e.g. the StandaloneSpawnStrategy. With this change, they can instead get a global instance from the Executor. -- MOS_MIGRATED_REVID=115705811
* Rename SpawnActionContext#isRemotable() to more appropriate ↵Gravatar Philipp Wollermann2016-02-28
| | | | | | | willExecuteRemotely(). Remove unused parameter "mnemonic". -- MOS_MIGRATED_REVID=115666410
* fix grammar mistakeGravatar Yue Gan2016-02-24
| | | | | -- MOS_MIGRATED_REVID=115440169
* sandbox: Easier debugging of sandbox failures, when using both ↵Gravatar Yue Gan2016-02-19
| | | | | | | | | | | --verbose_failures and --sandbox_debug. RELNOTES: - When using both --verbose_failures and --sandbox_debug, Bazel prints instructions how to spawn a debugging shell inside the sandbox. - When namespace-sandbox is run with the -D (debug) flag and inside a terminal, it spawns a shell inside the sandbox to aid in debugging when the sandboxed command fails. -- MOS_MIGRATED_REVID=114953983
* Reduce the number of stat calls when setting up a sandboxGravatar Brian Silverman2016-02-16
| | | | | | | | | | | | This improved performance for a (somewhat artificial) test which runs 100 genrules each with 3000 inputs by 25% on my laptop (2x hyperthreaded cores, SSD, ext4). Test code at <https://gist.github.com/bsilver8192/10527a862ce16bb7f79a>. -- Change-Id: I7a7aaccdfbe2925c7e962c0192924ef1cf80b33a Reviewed-on: https://bazel-review.git.corp.google.com/#/c/2840/1..2 MOS_MIGRATED_REVID=114694334
* Rename MiddlemanExpander to ArtifactExpander, and refactor it to yield ↵Gravatar Michael Thvedt2016-02-09
| | | | | | | ArtifactFiles. -- MOS_MIGRATED_REVID=114166208
* Make The Build Faster: Drop the describeStrategy() and strategyLocality() ↵Gravatar Philipp Wollermann2016-02-03
| | | | | | | | | methods, as we can simply pass an ActionStatusMessage to the EventBus instead. All SpawnActionContexts now send an appropriate message when they execute a Spawn. This also gets rid of the idiom that an Action knows which strategy will be used to execute it - this decision and knowledge belongs to the executor, not the action. -- MOS_MIGRATED_REVID=113731846
* Rename FilesystemUtils to NativePosixFiles.Gravatar Lukacs Berki2016-01-27
| | | | | | | This helps avoid confusion with File*S*ystemUtils, which differs in only the case of a character but is a completely different class. -- MOS_MIGRATED_REVID=113054116
* Copy output files out of the sandbox even when the action failed.Gravatar Philipp Wollermann2016-01-21
| | | | | -- MOS_MIGRATED_REVID=112683298
* Fix #757: Bazel does not copy xml test output from sandbox.Gravatar Philipp Wollermann2016-01-18
| | | | | -- MOS_MIGRATED_REVID=112404257
* Do not use sandboxing when bootstrappingGravatar Damien Martin-Guillerez2016-01-18
| | | | | | | | This simplify the bootstrap process and remove a C++ tool from the bootstrap binary. -- MOS_MIGRATED_REVID=112394555
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Fix sandbox .params files being left aroundGravatar Brian Silverman2015-12-08
| | | | | | | | | They accumulate indefinitely and take up space. -- Change-Id: I74c7ffd795b21793f8654e0e30785e1b8ba99ca4 Reviewed-on: https://bazel-review.googlesource.com/#/c/2510/ MOS_MIGRATED_REVID=109656651
* Fix up exception declarations; use EnvironmentalExecException.Gravatar Ulf Adams2015-12-04
| | | | | -- MOS_MIGRATED_REVID=109404922
* Reorganize BUILD files.Gravatar Han-Wen Nienhuys2015-11-30
| | | | | -- MOS_MIGRATED_REVID=108985661
* Mount /sbin into the sandbox.Gravatar Brian Silverman2015-11-25
| | | | | | | | | | This is necessary to be able to verify that the network sandbox is active using ifconfig, for example. -- Change-Id: Ia3ea16e18cf1d280f31870c867e56336bb48e7bd Reviewed-on: https://bazel-review.git.corp.google.com/#/c/2361 MOS_MIGRATED_REVID=108685498
* Speed up & deflake bazel_sandboxing_cpp_test (and probably other shell tests).Gravatar Philipp Wollermann2015-11-12
| | | | | | | The "clean" command that is run after each shell test finishes (in the tear_down method of test-setup.sh) tries to remove all subdirectories of the output base. This includes the bazel-sandboxes directory. This, however is already being cleaned up continuously in the background by a thread pool setup in SandboxModule. By waiting for the pool to finish before the clean command runs, the race condition can be solved. -- MOS_MIGRATED_REVID=107578302
* Hook up the network sandboxing codeGravatar Brian Silverman2015-11-05
| | | | | | | | | | RELNOTES: Tests, genrules, and Skylark actions without the "requires-network" tag will no longer be able to access the network. -- Change-Id: I6f7ad209142c6cfa2ad0318adf3dcfbc9af3d724 Reviewed-on: https://bazel-review.git.corp.google.com/#/c/2221/ MOS_MIGRATED_REVID=107043709
* Split off more BUILD files.Gravatar Han-Wen Nienhuys2015-10-28
| | | | | -- MOS_MIGRATED_REVID=106493557
* Separate BUILD file for options and docgen.Gravatar Han-Wen Nienhuys2015-10-16
| | | | | -- MOS_MIGRATED_REVID=105511114
* Split off 2 BUILD files.Gravatar Han-Wen Nienhuys2015-10-13
| | | | | -- MOS_MIGRATED_REVID=105301167
* Make the sandbox handle an arbitrary number of argumentsGravatar Brian Silverman2015-10-13
| | | | | | | | | | I was hitting argument length restrictions when trying to run rules which take 2 GCC installs and a Clang install as inputs. -- Change-Id: Iee27bb6fb50fe94bff4b2500bbcfa9381b05d63d Reviewed-on: https://bazel-review.googlesource.com/#/c/2090 MOS_MIGRATED_REVID=105300670
* Add support for filesets in LinuxSandboxedStrategy.Gravatar Philipp Wollermann2015-10-09
| | | | | -- MOS_MIGRATED_REVID=105052078
* sandbox: Push creation of needed empty directories (like /tmp, TEST_TMPDIR) ↵Gravatar Philipp Wollermann2015-10-08
| | | | | | | into the namespace-sandbox, instead of doing it in Java. This fixes an issue where the namespace-sandbox would check-fail on an mkdir() of a directory that was already created in the LinuxSandboxedStrategy. -- MOS_MIGRATED_REVID=104851563
* sandbox: Improve MountMap to always return entries sorted by path depth and ↵Gravatar Philipp Wollermann2015-10-06
| | | | | | | lexicographical order. This prevents certain edge cases in the sandbox, where a mounted child directory could be hidden by a later mount of a parent directory over its parent. -- MOS_MIGRATED_REVID=104749937
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Heavily refactor ProfileCommand to separate output and statistics generation ↵Gravatar Klaas Boesche2015-09-22
| | | | | | | and enable their reuse -- MOS_MIGRATED_REVID=103634406
* Small cleanup: execPath is available locally.Gravatar Ulf Adams2015-09-21
| | | | | | | -- Change-Id: If84b34393b88bad345ddf76aab0b033e77016f94 Reviewed-on: https://github.com/bazelbuild/bazel/pull/466 MOS_MIGRATED_REVID=103530511
* Extract MountMap to a top-level class.Gravatar Ulf Adams2015-09-21
| | | | | | | -- Change-Id: I26cf10accaa6f62014c65f41637a36fbeab42b0a Reviewed-on: https://github.com/bazelbuild/bazel/pull/465 MOS_MIGRATED_REVID=103529462
* Move Label from the lib.syntax to the lib.cmdline package so that:Gravatar Lukacs Berki2015-09-21
| | | | | | | | | | - Label parsing can be simplified - lib.syntax is only contains the code for Skylark and is reasonably independent from the problem domain of building things This change is mostly only changes to imports declarations. The rest is reversing the dependency between :cmdline and :syntax and moving a tiny amount of code between Printer and FilesetEntry and the addition of SkylarkPrintableValue that I couldn't be bothered to separate out into its own change. -- MOS_MIGRATED_REVID=103527877
* Move the clientEnv to the CommandEnvironment.Gravatar Ulf Adams2015-09-17
| | | | | -- MOS_MIGRATED_REVID=103269584
* Introduce CommandEnvironment and pass it instead of BlazeRuntime.Gravatar Ulf Adams2015-09-15
| | | | | | | | The very long term plan is to make BlazeRuntime immutable, so that we can run multiple commands in the same server. -- MOS_MIGRATED_REVID=103080946
* sandbox: Show user-friendly mount paths in the namespace-sandbox debug log.Gravatar Philipp Wollermann2015-09-08
| | | | | | | Improvement for #424. -- MOS_MIGRATED_REVID=102566748
* sandbox: Better error messages and the noisy debug logs of the ↵Gravatar Philipp Wollermann2015-09-08
| | | | | | | | | namespace-runner now have to be explicitly activated via --sandbox_debug. Fixes #424. -- MOS_MIGRATED_REVID=102566625
* sandbox: We have to move all generated outputs, not just regular files.Gravatar Philipp Wollermann2015-09-08
| | | | | | | Fix for a part of bug #397. -- MOS_MIGRATED_REVID=102564902
* Display TIMEOUT for test that times outGravatar Damien Martin-Guillerez2015-09-08
| | | | | | | | | Previously the timing out information wasn't propagated to the user, leading to a wrong FAILED message whereas the test was timing out. -- MOS_MIGRATED_REVID=102535481
* Rollback of commit 369635536db085dd70124ace2e4ef604680148b4.Gravatar Damien Martin-Guillerez2015-09-04
| | | | | | | | | | | | | | | | *** Reason for rollback *** Totally broke Bazel tests (100% failures!). Found by git bisect after running the update script. *** Original change description *** sandbox: We have to move all generated outputs, not just regular files. Fix for a part of bug #397. -- MOS_MIGRATED_REVID=102354724
* sandbox: We have to move all generated outputs, not just regular files.Gravatar Philipp Wollermann2015-09-04
| | | | | | | Fix for a part of bug #397. -- MOS_MIGRATED_REVID=102343972
* sandbox: Use a better data structure for the mounts.Gravatar Philipp Wollermann2015-09-04
| | | | | -- MOS_MIGRATED_REVID=102330179
* Code cleanupGravatar Laurent Le Brun2015-09-03
| | | | | -- MOS_MIGRATED_REVID=102239051
* sandbox: Better parsing of runfiles manifest files, fixes #413.Gravatar Philipp Wollermann2015-09-02
| | | | | -- MOS_MIGRATED_REVID=102145100
* sandbox: When spawn.getInputs() contains a directory, recurse into it and ↵Gravatar Philipp Wollermann2015-09-02
| | | | | | | mount the individual files. -- MOS_MIGRATED_REVID=102142064
* sandbox: Do not print the output of the isSupported() check.Gravatar Philipp Wollermann2015-09-02
| | | | | -- MOS_MIGRATED_REVID=102058774