| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
| |
A bug in the lexer ignored indentation on the first line of a file. This now
causes an error.
Also, remove the COMMENT token from the lexer. Comments are now accessed separately. This will allow further optimizations in the lexer. It also aligns the code a bit more with the Go implementation.
RELNOTES[INC]:
Indentation on the first line of a file was previously ignored. This is now fixed.
PiperOrigin-RevId: 197889775
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset introduces tests for the `shallow_since` functionality that was introduced in 6496b1d1d25025f33406b1eaf9949cab126f08bd.
We test that if the user specifies a tag as well as a `shallow_since` that it fails since they are incompatible. We also verify that specifying a commit before the `shallow_since` date causes the clone to fail (albeit currently with a non-useful error message; perhaps that could be improved at a later date).
It also documents more clearly how to use the feature by explaining the format of the 'since' string.
Closes #5183.
PiperOrigin-RevId: 197875727
|
|
|
|
|
|
|
|
|
|
|
|
| |
...and point --experimental_distdir there, so that offline builds
are again possible out of the distribution archive.
Related #5175.
Fixes #5202.
To be cherry-picked for #5056.
Change-Id: I634296e9d83e4e18ed966b42f35acc63061259d9
PiperOrigin-RevId: 197866998
|
|
|
|
|
| |
RELNOTES: --batch is deprecated
PiperOrigin-RevId: 197780675
|
|
|
|
|
|
|
|
|
|
| |
Prune down the list of attributes to the explicitly set ones when reporting
the original attributes. The attribute list also contains attributes implicitly
added from default values, but the original attributes are intended to record
the original way the rule was invoked from the WORKSPACE file.
Change-Id: I918656159850a52e9afc9f045701b0ea065f4125
PiperOrigin-RevId: 197702283
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change makes Bazel respect artifact name patterns specified in
CROSSTOOL.
Users cannot specify any arbitrary name pattern, it must ends with allowed
extensions. For example, for dynamic library, it can only ends with .so,
.dylib or .dll, otherwise Bazel throws an error.
Change-Id: I21d9e6fa7c3a282e1a9b8ff29679b00925cddb33
PiperOrigin-RevId: 197553413
|
|
|
|
|
|
|
|
| |
it off after a release.
Discarding actions hasn't been shown to have a significant positive effect on heap memory usage, after careful research by mschaller@. It's holding back other projects (threading Fileset metadata through) and adding complexity, so it's time to kill it. Out of an abundance of caution, I'll keep actions in memory via a flag flip, then, if it sticks, I'll change the default, and then I'll unwire everything.
PiperOrigin-RevId: 196682768
|
|
|
|
|
|
|
|
| |
The local JDK is now the default --javabase and needs to be available for these
tests, see:
https://github.com/bazelbuild/bazel/commit/849df36c5ad31ebe8791c4228321c38c6d0ae56c
PiperOrigin-RevId: 196575260
|
|
|
|
|
|
|
| |
It is a left over from long ago, and nothing should be using it as the
swift support is now via skylark rules and no longer native code.
PiperOrigin-RevId: 196541787
|
|
|
|
|
|
|
|
|
| |
Create junctions to jar's directory when java launcher and its jar are under different drives
Fixed https://github.com/bazelbuild/bazel/issues/5135
Change-Id: I21c5b28f5f36c1fe234f8b781fe40d526db846cc
PiperOrigin-RevId: 196477704
|
|
|
|
|
|
| |
and continue to use the embedded JDK as the default host_javabase.
PiperOrigin-RevId: 196471714
|
|
|
|
| |
PiperOrigin-RevId: 195971237
|
|
|
|
|
|
|
|
|
|
|
| |
We allow repository rules to return a reproducible version of themselves,
or a list of fully reproducible rules they expand to. Add a module collecting
all those answers, logging them at each invocation, if requested; this
collection can also be used by the upcoming 'sync' command to generate
a WORKSPACE.resolved file.
Change-Id: Iac1358de1b74633810d300ba2bf45bba8b3992dc
PiperOrigin-RevId: 195427096
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is mostly a roll-forward of 4465dae23de989f1452e93d0a88ac2a289103dd9, which
was reverted by fa36d2f48965b127e8fd397348d16e991135bfb6. The main difference is
that the new behavior is now gated behind the --noremote_allow_symlink_upload
flag.
https://docs.google.com/document/d/1gnOYszitgrLVet3sQk-TKGqIcpkkDsc6aw-izoo-d64
is a design proposal to support symlinks in the remote cache, which would render
this change moot. I'd like to be able to prevent incorrect cache behavior until
that change is implemented, though.
This fixes https://github.com/bazelbuild/bazel/issues/4840 (again).
Closes #5122.
Change-Id: I2136cfe82c2e1a8a9f5856e12a37d42cabd0e299
PiperOrigin-RevId: 195261827
|
|
|
|
|
|
|
|
| |
...to distinguish files with the same name that go through a repository
symlink that has changed.
Change-Id: I611c15ea5a48f4b797a725785165bf5a3aba387f
PiperOrigin-RevId: 195226865
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consolidate the --experimental_local_disk_cache and --experimental_local_disk_cache_path
flags into a single --disk_cache= flag. Also, create the cache directory
if it doesn't exist.
RELNOTES: We replaced the --experimental_local_disk_cache and
--experimental_local_disk_cache_path flags into a single --disk_cache
flag. Additionally, Bazel now tries to create the disk cache directory
if it doesn't exist.
Closes #5119.
PiperOrigin-RevId: 195070550
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no need for the cache to be on disk. Originally, there was a
desire to share this cache with other tools... but this never happened.
And, actually, because Bazel is in control of what it runs, it can just
inject the "cached" values into those tools via flags.
Instead, just store the cache in-memory. This avoids having to open and
read the cache on every single action that is locally executed on a Mac.
Results when building a large iOS app from a clean slate show up to a
1% wall time improvement on my Mac Pro 2013 and a reduction in the
variance of the measurements.
This change also gets rid of the OS check from the action execution's
critical path. There is not much use in checking this: if we instantiate
this by mistake, the actual calls will fail. But sometimes we want to
actually run this code on non-macOS systems (e.g. for unit-testing with
mocked tools), so we should allow that. And this change also ensures
that XcodeLocalEnvProviderTest builds and runs...
RELNOTES: None.
PiperOrigin-RevId: 194681802
|
|
|
|
|
|
|
| |
RELNOTES: Bazel now supports running actions inside Docker containers.
To use this feature, run "bazel build --spawn_strategy=docker
--experimental_docker_image=myimage:latest".
PiperOrigin-RevId: 194582691
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this commit:
- split //src/test/shell:shell_utils_test into a
symlink-specific part and the rest
- use the Bash runfiles library
- add "windows_tests" and "all_windows_tests"
targets as we do in other platforms (e.g. in
//src:BUILD)
See https://github.com/bazelbuild/bazel/issues/4930
See https://github.com/bazelbuild/bazel/issues/4292
Change-Id: I111a7fed223f1f9b767dc6411389465f8da3e043
PiperOrigin-RevId: 194395011
|
|
|
|
| |
PiperOrigin-RevId: 194284627
|
|
|
|
|
|
|
|
|
|
|
|
| |
Design: https://docs.google.com/document/d/1ubah6phuvWnugShtVgSQnaopQ1BtKtNxQASVwGZA7k0/
* Moves action construction out into java_common.run_ijar, java_common.pack_sources
* Deprecates corresponding arguments in JavaInfo
An incompatible flag will be added in another CL since it is not possible to add incompatible flags at the same time as new functionality is added.
RELNOTES: Adds new-style JavaInfo provider constructor.
PiperOrigin-RevId: 194111925
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Even if downloading a file without a predicted hash, add it to the cache.
This step is necessary to avoid redownloading when we switch to resolved
WORKSPACES. Starting from a plain URL, the file is downloaded and the hash
is added to the resolved version of the rule. Then we still want the resolved
form of the rule (which still has different arguments) to download the
same file again.
Even before the design of resolved WORKSPACES is implemented, this caching
is useful for the manual workflow: take the hash that is printed for every
file downloaded without predicted hash and manually add it to the parameters
of the rule. Then we prefer not to redownload the file again.
Change-Id: I90eefa9efed7c47514cc481dc09d9e938efa5a39
PiperOrigin-RevId: 193907109
|
|
|
|
|
|
|
|
| |
Bazel now has its own subclass of StartupOptions to specify bazel-only options. This is needed for https://github.com/bazelbuild/bazel/issues/4502.
RELNOTES(INC): No longer accepts --blazerc or --[no]master_blazerc, accepts bazelrc name only.
PiperOrigin-RevId: 193718297
|
|
|
|
|
|
|
|
|
| |
In particular, update run_test so that the little test binary used to check ANSI escape code stripping explicitly marks the beginning of its output and delete a bunch of tests run RunCommandTest that verified the output of the binary. They are not relevant anymore now that the output is not piped through the server.
Also drive-by fix a few linter issues in RunCommand.
RELNOTES: None.
PiperOrigin-RevId: 193655720
|
|
|
|
|
|
|
|
|
|
|
| |
The native version of http_archive is deprecated in favor of the
Skylark version. Both versions use the repository cache in the same
way, in fact, they eventually call the same HttpDownloader. So change
the integration tests to test the repository cache via the non-deprecated
repository function instead.
Change-Id: I2583af0d70a4e701ce6e6d5dc77ab2c734c367c3
PiperOrigin-RevId: 193363214
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
The no-cache tag is not respected (see b/77857812) and thus this breaks remote caching for all projects with symlink outputs.
*** Original change description ***
Only allow regular files and directories spawn outputs to be uploaded to a remote cache.
The remote cache protocol only knows about regular files and
directories. Currently, during action output upload, symlinks are
resolved into regular files. This means cached "executions" of an
action may have different output file types than the original
execution, which can be a footgun. This CL bans symlinks from cachable
spawn outputs and fixes http...
***
PiperOrigin-RevId: 193338629
|
|
|
|
|
|
|
| |
It breaks downstream rules_nodejs. See https://github.com/bazelbuild/bazel/issues/5028 for details.
RELNOTES: None.
PiperOrigin-RevId: 193074798
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bazel automatically detects the local Bash and
creates a custom toolchain rule for it.
Later, rules that use Bash will require this
toolchain and retrieve Bash's path from it instead
of relying on hardcoded paths or the
`--shell_executable` flag.
See https://github.com/bazelbuild/bazel/issues/4319
Change-Id: Idd8242a20d202b1f5a56cddac95b625c6c08ede9
Closes #4980.
Change-Id: Ic2406a4da260b284e15852070d58472ca18340af
PiperOrigin-RevId: 193022708
|
|
|
|
|
|
|
|
|
| |
The flag --experimental_repository_cache has been renamed to --repository_cache
(with the old name still usable for some releases). Adapt the shell tests to
use the preferred name of that flag.
Change-Id: I88ba70d386d5e8bb1bb60bcac58b2f1cc325ff17
PiperOrigin-RevId: 193003482
|
|
|
|
|
|
|
|
|
|
|
|
| |
... in register_toolchains and register_execution_platforms.
Fixes #5000.
Change-Id: Iac06b3cb79746ea720de8835b7bd1abb19149526
Closes #5001.
PiperOrigin-RevId: 192615586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the .useShell method, expect callers to
just pass the shell interpreter if they need it.
This removes the argument vector transformation
heuristic, and stops shelling out to cmd.exe on
Windows.
Also remove the .setWorkingDir method because
callers always had to set the working directory.
Instead, the CommandBuilder constructor takes the
working directory.
Closes #2190. (Test code still shells out to
cmd.exe though.)
Closes #5007.
Change-Id: I545e01c811daaf34913cb585492923da81aa02ee
PiperOrigin-RevId: 192611370
|
|
|
|
|
|
|
|
|
| |
BuildConfiguration.Fragment#compatibleWithStrategy().
The experiment did not work out.
RELNOTES: None.
PiperOrigin-RevId: 192567832
|
|
|
|
|
|
|
|
|
|
|
| |
...so that a repository rule can access them in any order without being
restarted. Restarting a repository rule can be expensive, if it already
accessed the network or executed expensive commands.
Improves on #4533.
Change-Id: I618c25322511dab42a80c1dddb0798fc9aea3106
PiperOrigin-RevId: 192420257
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 192313667
|
|
|
|
|
|
|
|
|
|
|
|
| |
While we still recommend to name repositories in canonical way, a canonical way
can not always be ensured, e.g., if different versions of the same external
repository have to be used. Our design for upcoming renaming repositories honors
this observation. So remove the old warning about the name in an external
repository's WORKSPACE file not matching the name given to it in the global
WORKSPACE file; we certainly will not make this an error in the future.
Change-Id: I5eef92ec61dc81d25734d71187a635024630322c
PiperOrigin-RevId: 192114195
|
|
|
|
|
|
|
|
| |
Fixes https://github.com/bazelbuild/bazel/issues/4409
Closes #4522.
PiperOrigin-RevId: 192112573
|
|
|
|
|
|
|
| |
This will mean the messages will make it to the right output stream.
RELNOTES:
PiperOrigin-RevId: 191925662
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also include the test target in the test log for easier debugging of tests.
Fixes #4960.
Change-Id: Ic79bf21e8eeba765b607755c1d290ee4e910d01f
Closes #4972.
Sample output:
```
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //src/test/shell/bazel:bazel_example_test
-----------------------------------------------------------------------------
```
Change-Id: I433cd9251a564b269da5566bb8401151ae4c99b7
PiperOrigin-RevId: 191891278
|
|
|
|
|
|
|
|
|
|
|
| |
...so that a repository rule can access them in any order without being
restarted. Restarting a repository rule can be expensive, if it already
accessed the network or executed expensive commands.
Improves on #4533.
Change-Id: I1d27f88492e4e51fb955f3f066a28a75c5016169
PiperOrigin-RevId: 191874363
|
|
|
|
|
|
|
| |
Fixes: 2846
RELNOTES: Bazel now displays information about remote cache hits and execution strategies used in its UI after every build and test, and adds a corresponding line "process stats" to BuildToolLogs in BEP.
PiperOrigin-RevId: 191441770
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't ask me how so many things can be wrong in a single test...
Progress towards #4770.
FYI @rupertks @buchgr @ulfjack
## Replace 25000 invocations of perl with a single "sha256sum"
This speeds up the test by a factor 2x on my iMac (before: 1200s, now: 600s).
On macOS, "shasum" is a Perl script. Instead of simply passing all input files to the thing at once, we were invoking it once per file. This means roughly 25,000 invocations of Perl per test run. And it's even worse - it wasn't just a call to that Perl script, it was wrapped in a "cat | shasum | cut" pipeline, resulting in silent data loss when you accidentally passed multiple input files to the thing, 75,000 processes being spawned just to compute hashes and losing the file name of what was actually hashed. WTF.
Also, we were using SHA256 to essentially verify that two directory trees are equal. For this purpose, relying on SHA1 should be absolutely fine - and that is, provided by a good native implementation, four times faster than `shasum`. It saves another 10 seconds of the overall run.
With this change, the test also prints the result of a failed determinism check in an easier to read format "filename hash" instead of "hash filename" and on top of that, it also prints the filenames in the diff on macOS, which was missing formerly. Without this, it was basically impossible to debug failures of this test on macOS, as you couldn't see *which files were different*. You had *one* job, bazel_determinism_test.
Before:
```
-- Test log: -----------------------------------------------------------
--- /private/var/tmp/_bazel_buildkite/30004132848cb6cbb0d8bc124cd9712b/bazel-sandbox/8820973750646175047/execroot/io_bazel/_tmp/e503f3f3df14b71e247bc3d7d9bf3608/sum1 2018-03-28 18:00:43.000000000 +0000
+++ /private/var/tmp/_bazel_buildkite/30004132848cb6cbb0d8bc124cd9712b/bazel-sandbox/8820973750646175047/execroot/io_bazel/_tmp/e503f3f3df14b71e247bc3d7d9bf3608/sum2 2018-03-28 18:10:34.000000000 +0000
@@ -10417,0 +10418 @@
+ecd53ba69a8d479d3fa4234e959f869cd10f7ebc68860d2b7915879f8b8b2c54
@@ -10605 +10605,0 @@
-f1954b59039b74d0a0ee3b2bced748604b95b8455a5bf80489296bd81878a5c8
------------------------------------------------------------------------
```
Now (I artificially introduced non-hermeticism to show how a failure would look like):
```
-- Test log: -----------------------------------------------------------
--- /private/var/tmp/_bazel_philwo/7a01905b4627ca044e5e3f5ad5b14d26/bazel-sandbox/5464595340038418595/execroot/io_bazel/_tmp/e503f3f3df14b71e247bc3d7d9bf3608/sum1 2018-03-30 17:12:39.000000000 +0000
+++ /private/var/tmp/_bazel_philwo/7a01905b4627ca044e5e3f5ad5b14d26/bazel-sandbox/5464595340038418595/execroot/io_bazel/_tmp/e503f3f3df14b71e247bc3d7d9bf3608/sum2 2018-03-30 17:17:27.000000000 +0000
@@ -903 +903 @@
-bazel-bin/src/bazel 31d811338ca364f0631560dd4d29406dd6a778ce
+bazel-bin/src/bazel 8f009173894730b00a1d1d6349af7d10f4d21cf3
@@ -5656 +5656 @@
-bazel-bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar f5ec8c4415ad8ecdc0385affc68f2dd4dbf241ef
+bazel-bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar 9899ae35cf431087a34a830bfdaf19d99616689c
@@ -8343 +8343 @@
-bazel-bin/src/main/java/com/google/devtools/build/lib/worker/_javac/worker/libworker_classes/com/google/devtools/build/lib/worker/WorkerFactory.class 780baa17c19ef99ef0b9291db1791ed8e0f1b231
+bazel-bin/src/main/java/com/google/devtools/build/lib/worker/_javac/worker/libworker_classes/com/google/devtools/build/lib/worker/WorkerFactory.class d45c14f09e73e7fcdf01f96aa32646c87b704bc2
@@ -8359 +8359 @@
-bazel-bin/src/main/java/com/google/devtools/build/lib/worker/libworker.jar 60e3afbfec17da7e44c1f0f61cf2a446196717be
+bazel-bin/src/main/java/com/google/devtools/build/lib/worker/libworker.jar 70f557e87d1b32b2e46c79554fe6bf3b89aeaf6e
@@ -11343 +11343 @@
-bazel-genfiles/src/install_base_key 3fad754e4ea19bd1120df5bf16e1f39372e6b9fe
+bazel-genfiles/src/install_base_key 7d7e8b62493912c5ec153032e104640e3980e6b3
@@ -11376 +11376 @@
-bazel-genfiles/src/package.zip 1ce3431b021ca338806162eca72ff84118001df5
+bazel-genfiles/src/package.zip 65f4801d91bbe10cba0d2d4d55c7cf319cd6722d
------------------------------------------------------------------------
test_determinism FAILED: Non-deterministic outputs found! .
```
## Remove obsolete check for BAZEL_TEST_XTRACE
That string does not appear anywhere in our repo, except for these two lines in the test, so there's no point in checking for it.
## Remove obsolete check for Java 7
That was about time.
## Performance improvements and usability fixes
- There's no need to use mktemp to create a unique directory under TEST_TMPDIR, as every test suite has its own TEST_TMPDIR.
- There's no need to remove stuff, as this will just degrade performance and make debugging harder. The surrounding Bazel or system will clean up later.
- There's no need to copy bazel-bin/src/bazel to ./bazel1 before calling it, as you can just call the built bazel from its original location.
- There's no need to run "bazel clean" before the second "bazel build" invocation - it's better to just use two separate output_bases. This is faster and also makes debugging easier, as you can compare the two output_bases in case of a test failure.
- There's no need to call "diff" twice - we can just save the output immediately in the `if` block.
Closes #4945.
PiperOrigin-RevId: 191118833
|
|
|
|
|
|
|
|
|
|
|
| |
We expect that the client passes all startup options to the server, default or explicit. The server's listing of default values should not matter. Yet for a number of these options, the default value in the server was relied upon, because the server command line was not constructed with the client's default value included. Fix visible cases of this, long term this should be tested for, so the invariant is not broken again.
This has been the documented expectation for a long time, but a number of violations have crept up over time. Update the comments that lead to this expectation to be more realistic.
Add debug statement that shows which options are changed when startup options cause the server to be restarted. The detailed logs will only be seen if --client_debug is set to TRUE.
RELNOTES: None.
PiperOrigin-RevId: 191066983
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We suggest our users to regularly test their code base
with --all_incompatible_chages to have time to adapt their
code base to upcoming incompatible changes. When doing so,
it is annoying if that breaks due to the Skylark code embedded
in bazel not being ready for the upcoming incompatible changes.
Therefore, add tests exercising the embedded code enabling
all incompatible changes. This way, hopefully, changes like
f1ad0e6df1528894b will come before the deprecation is added.
Change-Id: Iea60ff6a4019db310d1f1a1ad6a7b2bb53101c6d
PiperOrigin-RevId: 190766449
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 190759949
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
remote cache.
The remote cache protocol only knows about regular files and
directories. Currently, during action output upload, symlinks are
resolved into regular files. This means cached "executions" of an
action may have different output file types than the original
execution, which can be a footgun. This CL bans symlinks from cachable
spawn outputs and fixes https://github.com/bazelbuild/bazel/issues/4840.
The interface of SpawnCache.CacheHandle.store is refactored:
1. The outputs parameter is removed, since that can be retrieved from the underlying Spawn.
2. It can now throw ExecException in order to fail actions.
Closes #4902.
Change-Id: I0d1d94d48779b970bb5d0840c66a14c189ab0091
PiperOrigin-RevId: 190608852
|
|
|
|
|
|
|
|
| |
If a test target is built and testing is requested, nevertheless report what
was built.
Change-Id: Ida25f5f73fd4b5e102f2f4923acc555088495a8a
PiperOrigin-RevId: 190431506
|
|
|
|
|
|
|
| |
To replace blaze_util::die and blaze_util::pdie as well, FATAL statements need to accept blaze exit codes.
RELNOTES: None.
PiperOrigin-RevId: 190285798
|
|
|
|
|
|
| |
in either a FULL or LITE version. Trigger new output with the new --transitions cquery flag in the new CqueryOptions class.
PiperOrigin-RevId: 190278664
|
|
|
|
|
|
| |
TESTED=presubmit
RELNOTES: None
PiperOrigin-RevId: 190056498
|
|
|
|
|
|
| |
Fixes #4897.
PiperOrigin-RevId: 190045930
|