Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lberki 7.4.0 analysis cache discard #23652

Closed
wants to merge 624 commits into from

Conversation

lberki
Copy link
Contributor

@lberki lberki commented Sep 18, 2024

No description provided.

bazel-io and others added 30 commits April 2, 2024 22:17
…Unix cc_toolchain (#21798)

This was missed with a9e5a32. Without
this change, `gcc_quoting_for_param_files` does nothing, because
`FeatureConfiguration.isEnabled()` will always return false. Without
`gcc_quoting_for_param_files`, linking can fail for files with spaces in
them.

Closes #21699.

PiperOrigin-RevId: 617092387
Change-Id: Ifcd4378d2120e2e75e2e72a4b0059b41ba5ce833

Commit
bd2da6e

Co-authored-by: Brentley Jones <github@brentleyjones.com>
Co-authored-by: Ian (Hee) Cha <heec@google.com>
…m operations (#21861)

This requires making the implementation of `renameTo` in
`JavaIoFileSystem` and `WindowsFileSystem` atomic.

Fixes #21823

Closes #21779.

PiperOrigin-RevId: 620719510
Change-Id: Id3ff4baa56c6ef693196e8268614b483713542a5

Commit
753dc97

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
Original commits:
* 239b89a
* 707d065
* b532a46
* e3bd725
* 5dc6170
* 982b9ad
* 40824e1
* 594bd12
* 849da31
* 11498b5
* 55ec5ea
* ad8ea5a
* 6f47024
* 8024a75
* 3798b55
* 6783339
* 59cf396

---------

Signed-off-by: iancha1992 <heec@google.com>
Co-authored-by: Googler <tanzhengwei@google.com>
Co-authored-by: Zheng Wei Tan <tanzhengwei143@gmail.com>
Co-authored-by: Googler <jingwen@google.com>
Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
Co-authored-by: Googler <chiwang@google.com>
Co-authored-by: Yun Peng <pcloudy@google.com>
Co-authored-by: Googler <cushon@google.com>
Co-authored-by: iancha1992 <heec@google.com>
Co-authored-by: hvd <hvadehra@gmail.com>
Co-authored-by: Sren Gjesse <sgjesse@google.com>
#21892)

…lTest to prevent breakage when running on JDK 21."

Amazingly, this fixes the build for release-7.2.0.

For some reason, without this PR, BazelAndroidLocalTestTest fails with
some sort of "artifact does not have generating action" error:
https://storage.googleapis.com/bazel-untrusted-buildkite-artifacts/018ea0c4-55df-44fe-8f65-cc40d8f29482/src/test/java/com/google/devtools/build/lib/bazel/rules/android/AndroidTests/test.log

But that error goes away as soon as I delete the `if` block at line 73.

This reverts commit c70a4b7.
- Reverted #21892
- Cherry-picked
86ac024
to fix the original test failures.

---------

Co-authored-by: Googler <hvd@google.com>
This is in preparation for tracking the hashes of remote (non-`file:`
URL) files in the lockfile. If the tests use local registries, they
wouldn't be representative of the default situation.

Work towards #20369

Closes #21906.

PiperOrigin-RevId: 622290283
Change-Id: Ibe825d2bede84c1b0672dbb699aaf3ee5168a813

Commit
3f9d80c

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
If `--experimental_remote_output_service` is set, Bazel issues a
StartBuild RPC to the output service.

`StartBuildResponse.initial_output_path_contents` still needs to be
handled in a follow-up change.

Highlights:
- Add a new class `BazelOutputService` which is exclusive to
`RemoteOutputService`. Only `startBuild` is implemented by this PR.
Other methods will be implemented in follow-up PRs.
- Add `--experimental_remote_output_service_output_path_prefix` flag
which can be used to set the value of
`StartBuildRequest.output_path_prefix` (defaults to empty string).
- Reuse `RemoteModule#createChannel` method to create
`ReferenceCountedChannel` for `BazelOutputService`. Since there is no
server capabilities associated with this channel, the parameter is
changed to nullable.
- In `RemoteExecutionService#downloadOutputs`, the code skip downloading
outputs if `BazelOutputService` is available, instead it calls
`stageArtifacts` (although, it currently does nothing).

Tests will be added once a MVP is done.

Working towards #21630.

Closes #21674.

PiperOrigin-RevId: 617224074
Change-Id: I872ed06387e90182de2c7c69175989e9a0f663ce

Closes #21738.
If `--experimental_remote_output_service` is set, Bazel issue a
FinalizeBuild RPC to the output service after the build is done.

Working towards #21630.

Closes #21739.

PiperOrigin-RevId: 617487580
Change-Id: Ib07e9c97f74dfa2fe6f78ec46f7674f59e39ae12

Commit
c8187ac

Co-authored-by: Chi Wang <chiwang@google.com>
If `--experimental_remote_output_service` is set, Bazel issues a Clean
RPC to the output service when running `bazel clean`.

Working towards #21630.

Closes #21743.

PiperOrigin-RevId: 617501624
Change-Id: Idf83b45913f5b35acfb1a29231f2fa7e5aedc850

Commit
3b6aac0

Co-authored-by: Chi Wang <chiwang@google.com>
If `--experimental_remote_output_service` is set, Bazel issue
StageArtifacts RPC to the output service after hitting the remote cache
or executing action remotely.

Working towards #21630.

Closes #21746.

PiperOrigin-RevId: 617834441
Change-Id: I85fb544a69d0ca779a793038ff0e6a4b755dd637

Commit
4484f86

Co-authored-by: Chi Wang <chiwang@google.com>
Co-authored-by: Googler <cushon@google.com>
Co-authored-by: Googler <gregce@google.com>
If `--experimental_remote_output_service` is set, Bazel issues a
FinalizeArtifacts RPC to the output service after an action has been
executed.

Working towards #21630.

Closes #21759.

PiperOrigin-RevId: 618190373
Change-Id: I8ed981fcea7ebe146de0b1c48b1933392c86253f

Commit
586bd13

Co-authored-by: Chi Wang <chiwang@google.com>
…#21946)

If `--experimental_remote_output_service` is set, a `XattrProvider`
which uses `BatchStat` RPC to get the digest of a file will be used for
Bazel to get digests for outputs.

Working towards #21630.

Closes #21812.

PiperOrigin-RevId: 619539349
Change-Id: I71364e78c45c37e834c71e120a109c8de602db77

Commit
30aa5d0

Co-authored-by: Chi Wang <chiwang@google.com>
This cherry-picks:
* Stringify `Label`s in display form in `Args`
(9d3a8b0)
* Show display form labels in `java_*` buildozer fixups
(1c99866)

Fixes #21948 
Fixes #21826
This is required by the language spec, but was not implemented in Bazel.

See https://github.com/bazelbuild/starlark/blob/master/spec.md#max

Fixes #15022

Also take the opportunity to adjust sorted's signature for `key` to
match.

RELNOTES: Starlark `min` and `max` buitins now allow a `key` callback,
similarly to `sorted`.
PiperOrigin-RevId: 623547043
Change-Id: I71d44aa715793f9f2260f9b20b876694154ff352

Commit
cf66672

Co-authored-by: Googler <arostovtsev@google.com>
If `--experimental_remote_output_service` is set, `BatchStat` RPC will
be used by Bazel to check stat of many output files at once during the
start of incremental builds.

Working towards #21630.

Closes #21870.

PiperOrigin-RevId: 621500767
Change-Id: I5473d6ac0992215b1fe320b3b76c6510575476cd

Commit
9e37f4e

Co-authored-by: Chi Wang <chiwang@google.com>
Context:
https://bazelbuild.slack.com/archives/C014RARENH0/p1709547684815279?thread_ts=1709324251.252319&cid=C014RARENH0

Closes #21938.

PiperOrigin-RevId: 623421163
Change-Id: I450b1b1e3b3c0544b391e571911f62f0709aa62c (cherry picked from
commit c8fcfd4)
The argument was already available on 'print' and is necessary for full
control over the formatting of error messages that rely on
StarlarkValue's `debugPrint`.

Work towards #20486

Closes #21961.

PiperOrigin-RevId: 625022818
Change-Id: I895b5844d8543f936fc31d367b12bc6291a10bf8

Commit
6b2e0db

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
This makes the build event stream and starlark debugging proto libraries
public. This is for consumption by the vscode-bazel plugin, which
already uses these but in a very hacky way.

Fixes #16335
Fixes #3684

Closes #21196.

PiperOrigin-RevId: 623740758
Change-Id: Ic47d6dd05fcf2af8beec4d9212d4c7fd65bcda44

Commit
adfe016

Co-authored-by: Cameron Martin <cameronmartin123@gmail.com>
Fixes #21821.

PiperOrigin-RevId: 625316799
Change-Id: I2691b0304a80af483d2630491064371783f65422

Commit
d1cecc8

Co-authored-by: Googler <tanzhengwei@google.com>
)

Fixes
#21621 (comment)

PiperOrigin-RevId: 625286656
Change-Id: Ibc5d153af96912de39b146e50f081030d1da7257

Commit
2d54af1

Co-authored-by: Googler <pcloudy@google.com>
Ensures that yanked version information is only downloaded once per
module name, which reduces the number of files fetched during module
resolution. On my machine, this reduces `bazel mod deps` runtime on
Bazel itself by ~15%.

This also prepares for storing yanked version information in the
lockfile.

Work towards #20369

Closes #21909.

PiperOrigin-RevId: 625617556
Change-Id: Ie4184def3b868470f93d584bbbbd7f704e1e9a82

Commit
3052eff

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
…remote patch files (#22035)

Fixes #21885

PiperOrigin-RevId: 625651940
Change-Id: Id8a29c429e3b283dd0e2eecd1e13c023f0feb357

Commit
445dfab

Co-authored-by: Googler <pcloudy@google.com>
Whenever the sandbox base changed via --sandbox_base, the trash base
used by the AsynchronousTreeDeleter wasn't being updated accordingly. If
the new sandbox base was on a different filesystem (like tmpfs), new
async deletions would result in the error (Invalid cross-device link) at
the time of moving.

This would then trigger a precondition crash later when we checked
whether everything had been deleted correctly.

PiperOrigin-RevId: 625430544
Change-Id: I1547b16bdb803eb5dcee649c9988bad73442a140

Commit
dfd1763

Co-authored-by: Pedro Liberal Fernandez <plf@google.com>
Sandboxing tests should always run with Bazel defaults, which include no
tmpfs path.

Work towards #21215

Closes #22002.

PiperOrigin-RevId: 625615279
Change-Id: If4146f04effeaabc1eb22d38cc5ac32247759c8c

Commit
5086f65

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
Support storing repository cache with blake3 hash function.

Closes #21998.

PiperOrigin-RevId: 625727463
Change-Id: I2198adac617c5d6301e56694fe416f3130c61033

Commit
dc5ec2b

Co-authored-by: Son Luong Ngoc <sluongng@gmail.com>
The calling code expects the exception, not a return boolean.

Fixes #21982.

Closes #21987.

PiperOrigin-RevId: 626086576
Change-Id: I4abd7a253715c84c323e036dfbdb2fcb94a4825d

Commit
f8277cf

Co-authored-by: Spencer Putt <sputt@alumni.iu.edu>
Found to fix flaky local behavior of remote tests when invoking `bazel
shutdown`:
```
Load240418 11:57:38.114:XT 85 [com.google.devtools.build.remote.worker.ExecutionServer.lambda$waitExecution$1] Work failed: 9bcaa872-d921-4889-a762-66c242993c59
io.grpc.StatusRuntimeException: CANCELLED: call already cancelled. Use ServerCallStreamObserver.setOnCancelHandler() to disable this exception
	at io.grpc.Status.asRuntimeException(Status.java:526)
	at io.grpc.stub.ServerCalls$ServerCallStreamObserverImpl.onNext(ServerCalls.java:366)
	at com.google.devtools.build.remote.worker.ExecutionServer.lambda$waitExecution$1(ExecutionServer.java:171)
	at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
	at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1298)
	at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1059)
	at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:784)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.afterRanInterruptiblySuccess(TrustedListenableFutureTask.java:136)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:89)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)
```

Closes #22049.

PiperOrigin-RevId: 626953580
Change-Id: Id914dfd77496a50427f59638bd81794f021b9425

Commit
ba8ccaf

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
When a command line item is subject to special default stringification
behavior (currently, `Label` and `File` instances are), it does not
suffice to fingerprint the information that computes the custom
stringification; it is also necessary to track whether each individual
item is subject to this special formatting. Otherwise, as demonstrated
by numerous new test cases, command line items have identical
fingerprints to their naive stringification, but may result in distinct
command lines.

This is fixed by tracking element types via additional UUID markers,
either individually or for entire `NestedSet`s based on the `Depset`
type.

Closes #22025

Original commit:
d8613c2

PiperOrigin-RevId: 627040284
Change-Id: Id0725e7d7a58b439fde4f6644de09ebedb56a14c
Fixes bazelbuild/buildtools#1263

Closes #22045.

PiperOrigin-RevId: 626307672
Change-Id: Ib088e73835ea3d7076976a9de4ab4207ff491b27

Commit
7979dd6

---------

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
…nce.

This didn't work at HEAD because the check there compared the flags in the new configuration with the flags of the old configuration, but overwrote the old configuration with the new one, so running a command that discarded the analysis cache was allowed the second time.

The fix is not as trivial as moving checking the value before setting the new configuration because creating the new configuration entails a Skyframe evaluation, which is a waste if we end up erroring out. So the check is now done by checking the build options of the old configuration and the new build options, which doesn't require creating the new configuration first.

Fixes #23491.

RELNOTES: None.
PiperOrigin-RevId: 675555324
Change-Id: Ib402b699ed9ba9f04542896a40ff1180351471db
@lberki lberki closed this Sep 18, 2024
@github-actions github-actions bot added team-Android Issues for Android team team-Performance Issues for Performance teams team-Configurability platforms, toolchains, cquery, select(), config transitions team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-Rules-Java Issues for Java rules team-Rules-CPP Issues for C++ rules team-Rules-Python Native rules for Python team-Local-Exec Issues and PRs for the Execution (Local) team team-Remote-Exec Issues and PRs for the Execution (Remote) team team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Rules-ObjC Issues for Objective-C maintainers awaiting-review PR is awaiting review from an assigned reviewer team-CLI Console UI labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-Android Issues for Android team team-CLI Console UI team-Configurability platforms, toolchains, cquery, select(), config transitions team-Documentation Documentation improvements that cannot be directly linked to other team labels team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-Local-Exec Issues and PRs for the Execution (Local) team team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website team-Performance Issues for Performance teams team-Remote-Exec Issues and PRs for the Execution (Remote) team team-Rules-CPP Issues for C++ rules team-Rules-Java Issues for Java rules team-Rules-ObjC Issues for Objective-C maintainers team-Rules-Python Native rules for Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.