aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
Commit message (Collapse)AuthorAge
* Disable broken tests.Gravatar Cal Peyser2016-08-22
| | | | | -- MOS_MIGRATED_REVID=130761732
* fix ci breakage on MacGravatar Yue Gan2016-08-19
| | | | | -- MOS_MIGRATED_REVID=130745524
* Implement the first stage of Bazel's "Sandbox 2.0" for Linux.Gravatar Philipp Wollermann2016-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has the following improvements upon the older one: - Uses PID namespaces, PR_SET_PDEATHSIG and a number of other tricks for further process isolation and 100% reliable killing of child processes. - Uses clone() instead of unshare() to work around a Linux kernel bug that made creating a sandbox unreliable. - Instead of mounting a hardcoded list of paths + whatever you add with --sandbox_add_path, this sandbox instead mounts all of /, except for what you make inaccessible via --sandbox_block_path. This should solve the majority of "Sandboxing breaks my build, because my compiler is installed in /opt or /usr/local" issues that users have seen. - Instead of doing magic with bind mounts, we create a separate execroot for each process containing symlinks to the input files. This is simpler and gives more predictable performance. - Actually makes everything except the working directory read-only (fixes #1364). This means that a running process can no longer accidentally modify your source code (yay!). - Prevents a number of additional "attacks" or leaks, like accidentally inheriting file handles from the parent. - Simpler command-line interface. - We can provide the same semantics in a Mac OS X sandbox, which will come in a separate code review from yueg@. It has the following caveats / known issues: - The "fallback to /bin/bash on error" feature is gone, but now that the sandbox mounts everything by default, the main use-case for this is no longer needed. The following improvements are planned: - Use a FUSE filesystem if possible for the new execroot, instead of creating symlinks. - Mount a base image instead of "/". FAQ: Q: Why is mounting all of "/" okay, doesn't this make the whole sandbox useless? A: This is still a reasonable behavior, because the sandbox never tried to isolate your build from the operating system it runs in. Instead it is supposed to protect your data from a test running "rm -rf $HOME" and to make it difficult / impossible for actions to use input files that are not declared dependencies. For even more isolation the sandbox will support mounting a base image as its root in a future version (similar to Docker images). Q: Let's say my process-specific execroot contains a symlink to an input file "good.h", can't the process just resolve the symlink, strip off the file name and then look around in the workspace? A: Yes. Unfortunately we could not find any way on Linux to make a file appear in a different directory with *all* of the semantics we would like. The options investigated were: 1) Copying input files, which is much too slow. 2) Hard linking input files, which is fast, but doesn't work cross- filesystems and it's also not possible to make them read-only. 3) Bind mounts, which don't scale once you're up in the thousands of input files (across all actions) - it seems like the kernel has some non-linear performance behavior when the mount table grows too much, resulting in the mount syscall taking more time the more mounts you have. 4) FUSE filesystem, good in theory, but wasn't ready for the first iteration. RELNOTES: New sandboxing implementation for Linux in which all actions run in a separate execroot that contains input files as symlinks back to the originals in the workspace. The running action now has read-write access to its execroot and /tmp only and can no longer write in arbitrary other places in the file system. -- Change-Id: Ic91386fc92f8eef727ed6d22e6bd0f357d145063 Reviewed-on: https://bazel-review.googlesource.com/#/c/4053 MOS_MIGRATED_REVID=130638204
* Fix tmpdir with standalone test strategyGravatar Kristina Chodorow2016-08-18
| | | | | | | | | | | | | | | | | If the tmpdir wasn't below the execroot, Bazel would crash and print a stack trace. Also, the test was incorrect because the EOF wasn't quoted, so it was actually just executing "echo TEST_TMPDIR=/path/to/tmpdir" which (surprise surprise) matched TEST_TMPDIR=/path/to/tmpdir. Finally, the test was _also_ incorrect because it was using the cached test result for the second case, since changing the tmpdir doesn't invalidate the test result. So it not only was comparing a constant string to a constant string, but it wasn't even re-evaluating the constant string. -- MOS_MIGRATED_REVID=130637221
* Add a test for sandboxing when nobody's UID is differentGravatar Brian Silverman2016-08-18
| | | | | | | | | | | | | | | | Please don't merge before I8b8c3596fd2a4c125071406eefd407ca402099dd. The test will fail then. I've seen two issues with this functionality breaking: #481 and #1637. Seems like it's time to add a test which catches the issue on the Debian/Ubuntu machines people commonly test on. The test fails on my Debian system before I8b8c3596fd2a4c125071406eefd407ca402099dd, and passes with that change applied. -- Change-Id: Ib785c874cdb9192920f9935b696bfd6c9c0e5f4f Reviewed-on: https://bazel-review.git.corp.google.com/#/c/5451/ MOS_MIGRATED_REVID=130635565
* Add export ZERO_AR_DATE=1 to libtool.sh to make the output hermetic, and ↵Gravatar Chris Parsons2016-08-16
| | | | | | | touch the output of libtool to avoid hitting a bug in ld. -- MOS_MIGRATED_REVID=130093791
* Prefer IP agnostic terms/operations in favor of those that work only with ipv4.Gravatar Shreya Bhattarai2016-08-12
| | | | | -- MOS_MIGRATED_REVID=129997924
* Sets SONAME on shared objects in Android binaries.Gravatar Adam Michael2016-08-11
| | | | | | | | | | | | | | | Adds a linker flag to set the internal DT_SONAME. This fixes #1578 for SDK 24 and removes the warnings for previous SDKs. There is no need to set the linker flag for android_librarys that depend on native code, because the linker flag will be set by the android_binarys that depend on that android_library. Testing is done via `readelf` executable that is shipped with the NDK. -- Change-Id: I16fdfe6522c8694ce51554289122bf035a61d9ec Reviewed-on: https://bazel-review.googlesource.com/#/c/4302/ MOS_MIGRATED_REVID=129920256
* Put runfiles tree under 'runfiles' directory to avoid conflictGravatar Yun Peng2016-08-11
| | | | | | | | | | | | | Currently, in python executable zip file, the default workspace name "__main__" conflicts with __main__.py file. This change fixes it. Also refactored the bazel_windows_example_test -- Change-Id: I8b9d64d72335148dba41032ce93643d34670a771 Reviewed-on: https://bazel-review.googlesource.com/#/c/5351 MOS_MIGRATED_REVID=129879570
* Added support for null terminated queries.Gravatar Andreas Bergmeier2016-08-10
| | | | | | | | Closes #1496. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/1496 MOS_MIGRATED_REVID=129846158
* Using stub_template.txt as __main__.py and zip header in python executable zipGravatar Yun Peng2016-08-10
| | | | | | | | | | | | | | | | | | In stub_template.txt, we now unzip the python zip file to a temp directory if needed. This will get rid of bash in python executable file completely. Users can run the binary directly or using python <zip>, like: ./bazel-bin/examples/py_native/bin or python ./bazel-bin/examples/py_native/bin On Windows, we can use the second way to run python binary from native Windows command line (cmd.exe). -- Change-Id: I73fdd88f05f8f343dd19b2f3686ae031dfb476ba Reviewed-on: https://bazel-review.googlesource.com/#/c/5310 MOS_MIGRATED_REVID=129767890
* Rollback of commit 79a5d650a8ee4ff675b76ccf607ba92f0a92a797.Gravatar Yue Gan2016-08-08
| | | | | | | | | | | | | *** Reason for rollback *** Break test //src/test/shell/bazel:linux_sandbox_test *** Original change description *** Prefer IP agnostic terms in favor of those only for ipv4. -- MOS_MIGRATED_REVID=129616589
* Prefer IP agnostic terms in favor of those only for ipv4.Gravatar Shreya Bhattarai2016-08-08
| | | | | -- MOS_MIGRATED_REVID=129438985
* ExperimentalEventHandler: narrow scope of synchronized blocksGravatar Klaus Aehlig2016-08-02
| | | | | | | | | | | | | | | | ...to in particular never own a lock while waiting for the update thread to finish. This avoids a deadlock when the update thread tries to enter the synchronized part of doRefresh while the thread trying to stop the update thread holds the lock. Also renable experimental_ui_test now that the race condition leading to the deadlock is fixed. The absence of flakiness has been verified by running the test locally 100 times. Fixes #1560. -- Change-Id: I5d85b347e6cb7a1da8d5a724d6f9cd7461e33e5b Reviewed-on: https://bazel-review.googlesource.com/#/c/4225 MOS_MIGRATED_REVID=129079398
* Rollback of commit 49dfc29a40764ae48f2343007f88f3a4938498f1.Gravatar Yun Peng2016-08-02
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** This change causes android_integration_test failing on Mac. *** Original change description *** Sets SONAME on shared objects in Android binaries. Adds a linker flag to set the internal DT_SONAME. This fixes #1578 for SDK 24 and removes the warnings for previous SDKs. There is no need to set the linker flag for android_librarys that depend on native code, because the linker flag will be set by the android_binarys that depend on that android_library. -- MOS_MIGRATED_REVID=129074607
* Add 'local=1' to sandbox tests, as they can't run on remote execution nor ↵Gravatar Yue Gan2016-08-01
| | | | | | | | | inside a sandboxed Bazel on OS X -- Change-Id: I751b77c9a8dd7afc992dba0218f990118f06f98d Reviewed-on: https://bazel-review.googlesource.com/#/c/4201/3 MOS_MIGRATED_REVID=128976206
* Add a way to set build configuration values (defines) on swift_library targets.Gravatar Dmitry Shevchenko2016-08-01
| | | | | -- MOS_MIGRATED_REVID=128838998
* Sets SONAME on shared objects in Android binaries.Gravatar Adam Michael2016-08-01
| | | | | | | | | | | | | Adds a linker flag to set the internal DT_SONAME. This fixes #1578 for SDK 24 and removes the warnings for previous SDKs. There is no need to set the linker flag for android_librarys that depend on native code, because the linker flag will be set by the android_binarys that depend on that android_library. -- Change-Id: If6422f2c2677ec974a3682e3038d7fe159ed4978 Reviewed-on: https://bazel-review.googlesource.com/#/c/4210/ MOS_MIGRATED_REVID=128833820
* Add the jdk8 tag to the worker testGravatar Damien Martin-Guillerez2016-07-29
| | | | | | | This test should not be run with the JDK 7 since JavaBuilder for it does not support worker strategy. -- MOS_MIGRATED_REVID=128820130
* Mark experimental_ui_test as manual...Gravatar Damien Martin-Guillerez2016-07-29
| | | | | | | ...and do it correctly this time, so not loading_phase_tests. -- MOS_MIGRATED_REVID=128808204
* workers: Use workers by default for Javac.Gravatar Philipp Wollermann2016-07-29
| | | | | | | RELNOTES: Persistent workers are now used by default for Java compilation in Bazel, which should speed up your Java builds by ~4x. You can switch back to the old behavior via --strategy=Javac=standalone. Check out http://www.bazel.io/blog/2015/12/10/java-workers.html for more details. -- MOS_MIGRATED_REVID=128801059
* Revert "Sets SONAME on shared objects in Android binaries."Gravatar Damien Martin-Guillerez2016-07-29
| | | | | | | | This reverts commit e65876a28965c72f7a48a16be3390ba7c5c97a6f. This commit have not gone through the proper workflow. Fixes #1582.
* Rollforward of change that broke #1579 with test fix (need to specify ↵Gravatar Chris Parsons2016-07-29
| | | | | | | | | | | | | ios_sdk_version and xcode_version for our CI macs) *** Original change description *** Remove apple_binary's implicit output _lipo.a. This also removes the restriction that apple_binary targets must have at least one src file specified. -- MOS_MIGRATED_REVID=128721251
* Rollback of commit 8643954b818547339e8055d0aa4867c1286ebca1.Gravatar Damien Martin-Guillerez2016-07-29
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke //src/test/shell/bazel:bazel_apple_test Fixes #1579 *** Original change description *** Remove apple_binary's implicit output _lipo.a. This also removes the restriction that apple_binary targets must have at least one src file specified. -- MOS_MIGRATED_REVID=128698089
* Increase the shard count of //src/test/shell/bazel:bazel_test_testGravatar Damien Martin-Guillerez2016-07-29
| | | | | | | | | This test has some occasional timeout flakes. See http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=latest,PLATFORM_NAME=darwin-x86_64/148/console -- MOS_MIGRATED_REVID=128684898
* Remove apple_binary's implicit output _lipo.a.Gravatar Chris Parsons2016-07-28
| | | | | | | This also removes the restriction that apple_binary targets must have at least one src file specified. -- MOS_MIGRATED_REVID=128633173
* Add a resource parsing action.Gravatar Googler2016-07-28
| | | | | | | | | | | | | | | | | | | | | | Part of 3 proposed new actions: - parsing action - merging action - validating action Dependencies (directData and transitiveData) expect the symbol files. If the merge action produces the symbol files, then each merge action depends on each other. Instead, produce it in an action with just source resources as prereqs to allow more parallelism. Technically, we don't need a manifest as part of the parameters. I debated about whether to introduce a basic version of UnvalidatedAndroidData or not. -- MOS_MIGRATED_REVID=128599714
* JavaBuilder: Reintroduce the -extra_checks flag.Gravatar Philipp Wollermann2016-07-28
| | | | | | | Fixes #1570. -- MOS_MIGRATED_REVID=128585415
* Start worker processes with a clean environment, instead of accidentally ↵Gravatar Philipp Wollermann2016-07-28
| | | | | | | inheriting a copy of the server's environment. -- MOS_MIGRATED_REVID=128584538
* Sets SONAME on shared objects in Android binaries.Gravatar Adam2016-07-28
| | | | | | | | | | Adds a linker flag to set the internal DT_SONAME. This fixes #1578 for SDK 24 and removes the warnings for previous SDKs. There is no need to set the linker flag for android_librarys that depend on native code, because the linker flag will be set by the android_binarys that depend on that android_library. Change-Id: I0d4fd78ffaf03c19ae3712bdeb28a52722a22f6f
* Mark //src/test/shell/bazel:experimental_ui_test as manualGravatar Damien Martin-Guillerez2016-07-27
| | | | | | | | This test is timeout flaky (#1560) and the flake seems like genuine. While waiting for a proper fix, deactivate this test on ci.bazel.io. -- MOS_MIGRATED_REVID=128571273
* Bump the test size of //src/test/shell/bazel:bazel_apple_testGravatar Damien Martin-Guillerez2016-07-25
| | | | | | | | | Fixes #1561. -- Change-Id: I0527edaca9d429157e0db45e4406288ade12e369 Reviewed-on: https://bazel-review.googlesource.com/#/c/4157 MOS_MIGRATED_REVID=128351878
* Bump the size of //src/test/shell/bazel:execroot_testGravatar Damien Martin-Guillerez2016-07-25
| | | | | | | | | | | It was timeout flaky on ci.bazel.io Fixes #1559. -- Change-Id: Ie116fd70cf167ac152782f766b9ae541cc041ab4 Reviewed-on: https://bazel-review.googlesource.com/#/c/4156 MOS_MIGRATED_REVID=128347912
* Create a symlink with the right workspace name under the execrootGravatar Kristina Chodorow2016-07-22
| | | | | | | | | | | | | | | | | | The execution root currently uses the basename of the workspace directory for the workspace name, not the name in the WORKSPACE file. (For example, if our sources were in /path/to/foo and our WORKSPACE file had workspace(name = "bar"), our execution root would look like execroot/foo.) This creates a symlink bar -> foo, so that accessing ../repo_name actually works for the main repository. RELNOTES[INC]: The main repository's execution root is under the main repository's workspace name, not the source directory's basename. This shouldn't have any effect on most builds, but it's possible it could break someone doing weird things with paths in actions. -- MOS_MIGRATED_REVID=128175455
* Export xcode_locator's source file under tools/osx/ to make it available for ↵Gravatar Chris Parsons2016-07-21
| | | | | | | reference by future repository rules. Removes the xcode-locator binary file under tools/objc. Originally, the precompiled binary was going to be referenced, but it's easier to build from source in the repository rule. -- MOS_MIGRATED_REVID=128063694
* Checks for Android SDK in the Android integration test by checking presence ↵Gravatar Adam2016-07-21
| | | | | | | | | | of `tools/android` `SDK Readme.txt` is not necessarily present in an SDK installation. -- Change-Id: I98569b7e480e3fa47b9458a0bc950d87712f89cc MOS_MIGRATED_REVID=127999306
* Fix NPE with unset maven_jar sha1Gravatar Kristina Chodorow2016-07-20
| | | | | | | Fixes #1537. -- MOS_MIGRATED_REVID=127945452
* Renamed Windows shell test and added java example testsGravatar Yun Peng2016-07-20
| | | | | | | | | I reused some functions defined in test-setup.sh and some test cases in bazel_example_test.sh -- Change-Id: Ic9a20a819bfcc52f2ff72db74d017e6cdc062fc3 Reviewed-on: https://bazel-review.googlesource.com/#/c/4090 MOS_MIGRATED_REVID=127926337
* workers: WorkerSpawnStrategy will now only execute SpawnActions if their ↵Gravatar Philipp Wollermann2016-07-19
| | | | | | | | | | | ExecutionInfo contains the tag "support-workers" set to "1" and fallback to non-worker execution if it is not present. This will eventually allow us to safely automatically decide whether to use workers to execute an action or not. RELNOTES[INC]: If you maintain a rule that uses persistent workers, you'll have to specify execution_requirements={"supports-workers": 1} in the ctx.action that intends to run a tool with workers. The WorkerSpawnStrategy will alert you with a warning message if you forget to make this change and fallback to non-worker based execution. -- MOS_MIGRATED_REVID=127822788
* Rename namespace-sandbox/-runner to linux-sandbox.Gravatar Philipp Wollermann2016-07-18
| | | | | -- MOS_MIGRATED_REVID=127538990
* Fix Windows tests.Gravatar Dmitry Lomov2016-07-15
| | | | | | | -- Change-Id: Ib480661ebbc522007edd77b374d6720d216b4508 Reviewed-on: https://bazel-review.googlesource.com/#/c/4050 MOS_MIGRATED_REVID=127534581
* StandaloneTestStrategy: Use relative paths for environmental variables ↵Gravatar Philipp Wollermann2016-07-14
| | | | | | | | | | | related to tests. This allows for better caching and also makes it easy to run tests in a different directory than the global execroot. The paths are rewritten to absolute paths in test-setup.sh, because Test Encyclopedia says that we pass absolute paths to tests in these variables. -- MOS_MIGRATED_REVID=127432675
* Fix TMPDIR in test_genrule_default_envGravatar Klaus Aehlig2016-07-13
| | | | | | | | | | | | | | | | | | TMPDIR is not just an arbitrary environment variable that we expect to be passed to tests; it is the place where we temporary files may be stored. This semantic rule also applies to bazel itself. So TMPDIR has to point to a directory where we can write to. Unfortunately, the only way we have to find out a directory to write to is TMPDIR itself. So, create a fresh directory there and pass that directory on as new value for TMPDIR to see if it is passed through to the action. Also, fix up the resetting of TMPDIR: do not assume unset is the same as set to the empty string. -- Change-Id: I378ae9196c33d988686e8a2a6d3c142238fe8aab Reviewed-on: https://bazel-review.googlesource.com/#/c/4030 MOS_MIGRATED_REVID=127196634
* Enable @testable import in swift_libraryGravatar Dmitry Shevchenko2016-07-11
| | | | | | | * Debug and fastbuild compilation modes now pass -enable-testing flag enabling internal symbol imports in test code. -- MOS_MIGRATED_REVID=126925229
* Make swift_library explicitly specify the module maps it is using.Gravatar Dmitry Shevchenko2016-07-11
| | | | | | | * This seems to fix an issue with Clang loading the same header twice when it's discovering module maps implicitly. Also makes the command line cleaner. -- MOS_MIGRATED_REVID=126922449
* More pieces of RClassGeneratorActionGravatar Googler2016-07-08
| | | | | | | | | | | | Add the rclass_generator.sh, and fill in the boiler-plate for mock tools, etc. Mostly cargo- culting references to resources_processor.sh. Rename earlier pieces to use RClassGenerator prefix instead of AndroidResourceCompilation. -- MOS_MIGRATED_REVID=126831848
* Rollback of commit 1e37a5375f918376c132fa537e25695f673f41b8.Gravatar Dmitry Lomov2016-07-07
| | | | | | | | | | | | | *** Reason for rollback *** Apparently we now try to open output files for the process twice: once when we are constructing the output streams, and the second time when we tell the process to redirect its outputs. This causes the outputs to be empty on Windows *** Original change description *** Do redirection of stdout / stderr in Java instead of reimplementing it in every process wrapper again. -- MOS_MIGRATED_REVID=126801016
* Add some debugging to bazel_worker_test.sh to hopefully catch a flaky test.Gravatar Philipp Wollermann2016-07-04
| | | | | | | It seems like the Bazel server dies (or isn't reused) between the first and the second "bazel build" in test_input_digests. -- MOS_MIGRATED_REVID=126511647
* Add all the sources to //:srcs filegroup and add a check to detectGravatar Damien Martin-Guillerez2016-07-01
| | | | | | | | | | | missing file to it. We need to activate this check on presubmits -- Change-Id: Ia95e92d3816ce92bb69bc0e2cf56e9c60b68d970 Reviewed-on: https://bazel-review.googlesource.com/#/c/3949/ MOS_MIGRATED_REVID=126404792
* Make repository name warning less noisyGravatar Kristina Chodorow2016-07-01
| | | | | | | This way it won't print if the repo maintainer doesn't set the repo name. -- MOS_MIGRATED_REVID=126300205