aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
Commit message (Collapse)AuthorAge
* Add new skyframe function to lookup the repository given a path, and use thatGravatar John Cater2016-10-25
| | | | | | | to report invalid package references. Fixes #1592. -- MOS_MIGRATED_REVID=137164164
* Trim labels in location expressions before expansion.Gravatar Tobias Werth2016-10-25
| | | | | | | -- Change-Id: If626fd448ddbfbdf65b71569fda7a9b206e5f8b2 Reviewed-on: https://bazel-review.googlesource.com/c/6890/ MOS_MIGRATED_REVID=137155361
* Reimplement whole archive on WindowsGravatar Yun Peng2016-10-25
| | | | | | | | | | | | Use wrapper script to get object files if /WHOLEARCHIVE is not supported. fix https://github.com/bazelbuild/bazel/issues/1978 work towards https://github.com/bazelbuild/bazel/issues/1918 -- Change-Id: I675311478e65a1e1f3fa963187a5a8da531150d3 Reviewed-on: https://bazel-review.googlesource.com/#/c/6833 MOS_MIGRATED_REVID=137151817
* VFS: implement a Windows-specific Path subclassGravatar Laszlo Csomor2016-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change rolls forward commit e0d7a540e3c615c628f63fcaaaba0c47fca2cb25 and commit 8bb4299b28de14eed9d3b57bcaeb9350c81c7db3, and adds a bugfix: - FileSystem.PathFactory got a new translatePath method that WindowsFileSystem.PathFactory overrides to translate absolute Unix paths to MSYS-relative paths - Path.getCachedChildPath calls this translatePath method so the child path is registered with the correct (translated) parent and under the correct name (e.g. "C:" instead of say "c") Below is the rest of the original change description: The new subclass WindowsFileSystem.WindowsPath is aware of Windows drives. This change: - introduces a new factory for Path objects so FileSystems can return a custom implementation that instantiates filesystem-specific Paths - implements the WindowsPath subclass of Path that is aware of Windows drives - introduces the bazel.windows_unix_root JVM argument that defines the MSYS root, which defines the absolute Windows path that is the root of all Unix paths that Bazel creates (e.g. "/usr/lib" -> "C:/tools/msys64/usr/lib") except if the path is of the form "/c/foo" which is treated as "C:/foo" - removes all Windows-specific logic from Path PathFragment is still aware of drive letters and it has to remain so because it is unaware of file systems. WindowsPath restricts the allowed path strings to absolute Unix paths where the first segment, if any, is a volume specifier. From now on if Bazel attempts to create a WindowsPath from an absolute Unix path, Bazel will make it relative to WindowsPath.UNIX_ROOT, unless the first component is a single-letter name (e.g. "/c/foo" which is "C:/foo"). Subclassing Path is necessary because a Unix-style absolute path doesn't sufficiently define a full Windows path, as it may be relative to any drive. Fixes https://github.com/bazelbuild/bazel/issues/1463 -- MOS_MIGRATED_REVID=137149483
* Enables AllowValues and DisallowValues invocation policy operations to takeGravatar Alex Humesky2016-10-25
| | | | | | | | | a value to use instead of the given flag value if it is disallowed by the policy. This is a generalization of the existing new_default_value behavior to cover any value of the flag, not just the default value if the flag is unset. -- MOS_MIGRATED_REVID=137104944
* If a group of deps has only one unique element, store it bare.Gravatar Janak Ramakrishnan2016-10-25
| | | | | | | | | | Not storing it bare both breaks equality comparison for GroupedList and uses more space. -- Change-Id: Iaf4f88908ecf4293cfc31dbd896f46e1da3b4184 Reviewed-on: https://bazel-review.googlesource.com/#/c/6850/ MOS_MIGRATED_REVID=137099785
* Accept valid relative symlinks in TreeArtifacts.Gravatar Rumou Duan2016-10-25
| | | | | -- MOS_MIGRATED_REVID=137072310
* Remove hack from bazel_apple_test to select an xcode that is 7-series or ↵Gravatar Chris Parsons2016-10-24
| | | | | | | | | | 8-series. The test now relies on the auto-detection skylark repository rule (querying the result for an appropriate 7-series or 8-series alternative) -- MOS_MIGRATED_REVID=137050518
* Move -l/-L link opts to FeatureConfigurationGravatar Marcel Hlopko2016-10-24
| | | | | | | | | | This cl moves -l/-L link opts generation from Java to FeatureConfiguration making it possible to alter the flags in CROSSTOOL. Change-Id: I1ea7501435ab7e62992e1e9b0cb7f5e22d52c521 -- MOS_MIGRATED_REVID=137004610
* intellij_info.bzl: Fix typo 'Implementaion' => 'Implementation'.Gravatar Ivan Vucica2016-10-24
| | | | | -- MOS_MIGRATED_REVID=136832073
* Bump test size for //src/test/shell/bazel:process_wrapper_test from small to ↵Gravatar Philipp Wollermann2016-10-21
| | | | | | | medium, because on my workstation the test takes ~42s, which is close enough to the 60s timeout so that it occasionally times out on a busy CI machine. -- MOS_MIGRATED_REVID=136827226
* Fix bazel_apple_test and Swift example to work with Xcode 8.0.Gravatar Philipp Wollermann2016-10-21
| | | | | | | This is needed to make Bazel CI green(er) again, because CI machines are being upgraded to macOS Sierra and Xcode 8.0. -- MOS_MIGRATED_REVID=136825401
* Fix and re-enable bazel_windows_example_testGravatar Yun Peng2016-10-21
| | | | | | | -- Change-Id: I09d8ef5daceb48066ec40420ad5cf21514059f4a Reviewed-on: https://bazel-review.googlesource.com/#/c/6770 MOS_MIGRATED_REVID=136825145
* Use a select in the data attribute of bazel_toolchain_test to remove the ↵Gravatar Philipp Wollermann2016-10-21
| | | | | | | | | Linaro compiler filegroup on macOS. This fixes the broken bazel_toolchain_test on macOS. I filed a bug to track the real issue (HardlinkedExecRoot sometimes seems to fail when inputs contain directories): https://github.com/bazelbuild/bazel/issues/1974 -- MOS_MIGRATED_REVID=136823559
* Proper action output checks for TreeArtifacts. Instead of crashing Bazel, we ↵Gravatar Rumou Duan2016-10-19
| | | | | | | now handle failed TreeArtifact output checks gracefully. -- MOS_MIGRATED_REVID=136627086
* Add swiftmodule outputs to the linking step.Gravatar Dmitry Shevchenko2016-10-19
| | | | | | | | * This change enables most of LLDB functionality on binaries built by swift_library. It makes the linker record references to the .swiftmodule outputs, which then can be read by LLDB to deserialize Swift modules and provide debug info. -- MOS_MIGRATED_REVID=136620475
* Made HttpDownloader download calls non-static.Gravatar Jingwen Chen2016-10-19
| | | | | | | | | | | | | | | To set and use a RepositoryCache instance in HttpDownloader while parsing the command line options, we can pass an AtomicReference<HttpDownloader> instance from BazelRepositoryModule to the HttpArchiveFunctions. However, we'll need to change HttpDownloader download() calls to be non-static in order to initialize an instance of HttpDownloader in BazelRepositoryModule. Remaining TODOs: - RepositoryCache implementation and unit testing - RepositoryCache lockfiles - RepositoryCache integration testing GITHUB: #1752 -- MOS_MIGRATED_REVID=136593517
* Add more useful bazelrc options.Gravatar John Cater2016-10-19
| | | | | -- MOS_MIGRATED_REVID=136590448
* Rollback of commit e6191f7209ebf3f67480bc7aa9db5ac58beb2156.Gravatar Damien Martin-Guillerez2016-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll-forward with fix. Tested with `bazel build src:srcs //src/test/...` using a bootstrapped bazel. Fixes #1923. RELNOTES[INC]: Non test-only targets can no longer depends on test-only targets. *** Original change description *** Automated [] rollback of commit a9f20b0d6459d395444c45cf5e94a899f3443633. *** Reason for rollback *** Broke Bazel CI: ERROR: /home/ci/workspace/Bazel/JAVA_VERSION/1.8/PLATFORM_NAME/linux-x86_64/src/BUILD:284:1: in filegroup rule //src:srcs: non-test target '//src:srcs' depends on testonly target '//src/java_tools/junitrunner/java/com/google/testing/junit/junit4:srcs' and doesn't have testonly attribute set. ERROR: Analysis of target '//scripts/packages:packages' failed; build aborted. http://ci.bazel.io/view/Bazel%20b... *** -- MOS_MIGRATED_REVID=136589937
* Fix android_integration_test to include the integration_test_setup instead ↵Gravatar Philipp Wollermann2016-10-19
| | | | | | | of the old test-setup. -- MOS_MIGRATED_REVID=136589691
* Fix Bazel-JDK7 breakage on CIGravatar Philipp Wollermann2016-10-19
| | | | | | | | | | src/test/java/com/google/devtools/build/lib/skyframe/TreeArtifactBuildTest.java:154: error: local variable normalOutput is accessed from within inner class; needs to be declared final touchFile(normalOutput); http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD-jdk7,PLATFORM_NAME=linux-x86_64/290/console -- MOS_MIGRATED_REVID=136588819
* Rollback of commit e0d7a540e3c615c628f63fcaaaba0c47fca2cb25.Gravatar Philipp Wollermann2016-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Suspected root cause for Windows bootstrap on Bazel CI breakage: java.lang.NullPointerException at com.google.devtools.build.lib.vfs.Path$1.run(Path.java:123) http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/922/JAVA_VERSION=1.8,PLATFORM_NAME=windows-x86_64/console *** Original change description *** VFS: implement a Windows-specific Path subclass The new subclass WindowsFileSystem.WindowsPath is aware of Windows drives. This change: - introduces a new factory for Path objects so FileSystems can return a custom implementation that instantiates filesystem-specific Paths - implements the WindowsPath subclass of Path that is aware of Windows drives - introduces the bazel.windows_unix_root JVM argument that defines the MSYS root, which defines the absolute Windows path that is the... *** -- MOS_MIGRATED_REVID=136583352
* Set show_progress_rate_limit to -1 for all tests to ensure progress messagesGravatar John Cater2016-10-19
| | | | | | | are not lost. -- MOS_MIGRATED_REVID=136579898
* Rollback of commit a9f20b0d6459d395444c45cf5e94a899f3443633.Gravatar Philipp Wollermann2016-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke Bazel CI: ERROR: /home/ci/workspace/Bazel/JAVA_VERSION/1.8/PLATFORM_NAME/linux-x86_64/src/BUILD:284:1: in filegroup rule //src:srcs: non-test target '//src:srcs' depends on testonly target '//src/java_tools/junitrunner/java/com/google/testing/junit/junit4:srcs' and doesn't have testonly attribute set. ERROR: Analysis of target '//scripts/packages:packages' failed; build aborted. http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=linux-x86_64/923/console *** Original change description *** Enforce that non test-only targets cannot depends on test-only targets This behavior was not enforced since we open-sourced Bazel even though this was documented and the attributed existed. Also removed the incorrect part from the documentations: we do not enforce restrictions on javatests package. Fixes #1923. RELNOTES[INC]: Non test-only targets can no longer depends on test-only targets. -- MOS_MIGRATED_REVID=136574806
* Per action file caching for input TreeArtifact.Gravatar Rumou Duan2016-10-19
| | | | | -- MOS_MIGRATED_REVID=136475556
* Create a proper wrapper script for executing "bazel" in the integration tests.Gravatar Luis Fernando Pino Duque2016-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently a call to "bazel" in an integration test means calling a (quite hidden) function in test-setup.sh which actually calls "$bazel" defined in "shell/bazel/testenv.sh" which is equal to "$(rlocation io_bazel/src/bazel)". This is extremely confusing and error prone. The new mechanism is to add a wrapper script to shell/bin called bazel and export this directory to the PATH. Moreover, not every test loads the same test environment, for instance consider how bazel_query_test loads the test environment: - Load shell/integration/testenv.sh which loads, - shell/bazel/test-setup.sh which loads, - shell/bazel/testenv.sh which loads, - shell/unittest.bash which loads, - shell/testenv.sh Again this is error prone and specially hard to understand, in fact each test writer needs to decide which of these testenv to load. This change fixes all of this by having only one testenv.sh and summarizing the test setup in integration_test_setup.sh. Namely, for any new integration test, the developer needs to load integration_test_setup to get the environment set up including the unittest framework (also it helps to attract contributions). This change also allows to open sourcing client_sigint_test: Since bazel was a function client_sigint_test was using a wrong process id to interrupt the build. The problem is that $! returns bash's id instead of the id of the process running in the background when using a function instead of an executable. A few tests needed to be adapted to the new infrastructure. -- MOS_MIGRATED_REVID=136470360
* Rollback of commit ffdc05d2278d7f9c6e299c923019f689cde5fe76.Gravatar Yun Peng2016-10-19
| | | | | | | | | *** Reason for rollback *** Causes huge memory blow-up after the analysis phase in CppLinkAction (LinkCommandLine). -- MOS_MIGRATED_REVID=136467836
* Move the RuleModule interface to ConfiguredRCP and rename it to RuleSet.Gravatar Ulf Adams2016-10-19
| | | | | -- MOS_MIGRATED_REVID=136463385
* Enforce that non test-only targets cannot depends on test-only targetsGravatar Damien Martin-Guillerez2016-10-19
| | | | | | | | | | | | | | | This behavior was not enforced since we open-sourced Bazel even though this was documented and the attributed existed. Also removed the incorrect part from the documentations: we do not enforce restrictions on javatests package. Fixes #1923. RELNOTES[INC]: Non test-only targets can no longer depends on test-only targets. -- MOS_MIGRATED_REVID=136459421
* Replace grep by expect_log in java_integration_test#test_java_pluginGravatar Damien Martin-Guillerez2016-10-19
| | | | | | | | | | | | This fixes #1888: on my laptop (Mac Book Air), the test is highly flaky (6-7 tests fails out of 10) but with this change, I observe no failures. I cannot explains it but it seems to be some kind of race in the stream handling. -- Change-Id: I09eb9d5a1c8468c7a0299966a5ea20e7a5fc86f0 Reviewed-on: https://bazel-review.googlesource.com/c/6696/ MOS_MIGRATED_REVID=136459264
* Rollback of commit b776d6c12e952eb358c1a036cc9d93d8944c4c77.Gravatar Nathan Harmata2016-10-18
| | | | | | | *** Reason for rollback *** -- MOS_MIGRATED_REVID=136448178
* Rollback of commit 72cc756faffa93781942df261974572c65941c95.Gravatar Tobias Werth2016-10-18
| | | | | -- MOS_MIGRATED_REVID=136447767
* Split up rule sets into smaller chunks.Gravatar Ulf Adams2016-10-18
| | | | | | | | | Move the Bazel-specific setup into a separate RuleSet and don't explicitly depend on that - instead, implicitly call it's init() whenever we need a valid RCP. -- MOS_MIGRATED_REVID=136444074
* Refactor the rule class provider.Gravatar Ulf Adams2016-10-18
| | | | | | | | | | | | - add a convenience method to make adding options + fragment factories a bit simpler - sort the objc rules alphabetically - split the j2objc rules from the objc rules - unfortunately, the objc rules depend on the j2objc configuration, so that has to stay -- MOS_MIGRATED_REVID=136442577
* Fix unnecessary static imports of typesGravatar Liam Miller-Cushon2016-10-18
| | | | | -- MOS_MIGRATED_REVID=136431274
* Add file extension property to SkylarkGravatar Paul Roberts2016-10-18
| | | | | | | RELNOTES[NEW]: Files now have an "extension" property in Skylark. -- MOS_MIGRATED_REVID=136425934
* Rename BUILD into BUILD.linaro for the linaro toolchain exampleGravatar Damien Martin-Guillerez2016-10-18
| | | | | | | | | | | | Those BUILD files were broken in the default bazel set-up, preventing test on //src/test/... The bazel_toolchain_test now rename those file. Fixes #1957. -- Change-Id: Ie0a1dbde349a307998fd4d42f73fffabc67c113c Reviewed-on: https://bazel-review.googlesource.com/6693 MOS_MIGRATED_REVID=136379678
* cpp: header hygienizationGravatar Thiago Farina2016-10-18
| | | | | | | | | | | * remove "using std::" declarations from header files * add missing "std::" to some string declarations at some header files * add "using std::string;" to some source files where necessary -- Change-Id: Ib64f62b5add499d6171fa922227194ac992fa542 Reviewed-on: https://bazel-review.googlesource.com/#/c/6630/ MOS_MIGRATED_REVID=136355671
* Don't bother getting the not-real FileStateValue for a path whose parent ↵Gravatar Nathan Harmata2016-10-18
| | | | | | | | | doesn't exist. In addition to saving a filesystem operation, this removes a source of a potential filesystem inconsistency. -- MOS_MIGRATED_REVID=136355008
* VFS: implement a Windows-specific Path subclassGravatar Laszlo Csomor2016-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new subclass WindowsFileSystem.WindowsPath is aware of Windows drives. This change: - introduces a new factory for Path objects so FileSystems can return a custom implementation that instantiates filesystem-specific Paths - implements the WindowsPath subclass of Path that is aware of Windows drives - introduces the bazel.windows_unix_root JVM argument that defines the MSYS root, which defines the absolute Windows path that is the root of all Unix paths that Bazel creates (e.g. "/usr/lib" -> "C:/tools/msys64/usr/lib") except if the path is of the form "/c/foo" which is treated as "C:/foo" - removes all Windows-specific logic from Path PathFragment is still aware of drive letters and it has to remain so because it is unaware of file systems. WindowsPath restricts the allowed path strings to absolute Unix paths where the first segment, if any, is a volume specifier. From now on if Bazel attempts to create a WindowsPath from an absolute Unix path, Bazel will make it relative to WindowsPath.UNIX_ROOT, unless the first component is a single-letter name (e.g. "/c/foo" which is "C:/foo"). Subclassing Path is necessary because a Unix-style absolute path doesn't sufficiently define a full Windows path, as it may be relative to any drive. Fixes https://github.com/bazelbuild/bazel/issues/1463 -- MOS_MIGRATED_REVID=136350304
* Update linaro toolchain version and sourcesGravatar Xin Gao2016-10-17
| | | | | | | | | Fixes #1903. -- Change-Id: Ifd8f3676ed8cf6cef514a0294a22330cc326e6b5 Reviewed-on: https://bazel-review.googlesource.com/#/c/6590/ MOS_MIGRATED_REVID=136348803
* Fix #1719: Sandbox should print better error message on execvp failure.Gravatar Philipp Wollermann2016-10-17
| | | | | -- MOS_MIGRATED_REVID=136338300
* Split up BazelRuleClassProvider into per-language modules.Gravatar Ulf Adams2016-10-17
| | | | | | | | | | | | | Add a test to ensure each module is internally consistent / correctly declares its dependencies. This enforces a certain amount of rule set modularity, and may allow us to move the rule modules to the rule packages in the future, which would very much clean up the RuleClassProvider (which currently depends on everything and the kitchen sink). -- MOS_MIGRATED_REVID=136321762
* Augment the CppLinkInfo extra action proto with the command line of the linker.Gravatar Googler2016-10-17
| | | | | | | Currently, the proto only includes the linkopt arguments collected from the rules, which are insufficient for reconstructing the linking step in the extra action listener. This CL adds the complete command line needed to re-run the linking step. -- MOS_MIGRATED_REVID=136211307
* Rollback of commit 0c7a42a09d85ddffd9b860bcb31e4c43a00632c1.Gravatar Nathan Harmata2016-10-17
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** [] *** Original change description *** Slight refactor of ExternalFilesHelper: -Make FileType and ExternalFileAction public. -Have producers use ExternalFileAction, rather than a boolean, to specify the desired behavior. And a big change in semantics (doesn't affect Bazel): -Replace ExternalFileAction.ERROR_OUT with ExternalFileAction.ASSUME_NON_EXISTENT_AND_IMMUTABLE, which does what it sounds like. This new action, like the old ERROR_OUT, is _not_ used in Bazel. -- MOS_MIGRATED_REVID=136206810
* Exclude JarFilterTest from Windows.Gravatar Googler2016-10-14
| | | | | -- MOS_MIGRATED_REVID=136175679
* Make --watchfs a common command option.Gravatar Ulf Adams2016-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | Adding an options parameter to DiffAwareness#getCurrentView seems like the simplest way to achieve that. Alternatives considered: 1. Making the diff awareness modules stateful. However, I did not want to do so as I've also been working on improving the module API to reduce state, or at least to have a proper lifecycle management for any necessary state. 2. Making the watchFs flag a constructor parameter. However, that would also invalidate any implementations that don't use the flag (of which we have several). 3. Only passing in a single boolean flag instead of an options class provider; however, this is a more principled, futureproof API, which allows other modules / awareness implementations to use their own options. RELNOTES: --watchfs is now a command option; the startup option of the same name is deprecated. I.e., use bazel build --watchfs, not blaze --watchfs build. -- MOS_MIGRATED_REVID=136154395
* Cleanup, remove differences between Build and Skylark environments.Gravatar Laurent Le Brun2016-10-14
| | | | | | | | | | | | | The only visible difference for users is that a few more functions are available in BUILD files. That's fine, this difference was not even documented. RELNOTES: A few functions are added to BUILD files for consistency (hash, dir, hasattr, getattr) with .bzl files, although they are not very useful. -- MOS_MIGRATED_REVID=136151633
* Stop storing a set in GroupedListHelper to deduplicate SkyKey dep requests. ↵Gravatar Janak Ramakrishnan2016-10-14
| | | | | | | Instead, deduplicate when the helper is actually added to a GroupedList. -- MOS_MIGRATED_REVID=136145321
* Support input srcjar in filtered gen jar.Gravatar Googler2016-10-14
| | | | | | | | | | | This supports genrules that output srcjars that are then inputs to java_libraries. Also add support to produce a source jar with the contents of the gen jar. -- MOS_MIGRATED_REVID=136099457