Skip to content

Make include verification aware of Windows case-insensitivity#28810

Closed
fmeum wants to merge 9 commits intobazelbuild:masterfrom
fmeum:28803-inclusion-check
Closed

Make include verification aware of Windows case-insensitivity#28810
fmeum wants to merge 9 commits intobazelbuild:masterfrom
fmeum:28803-inclusion-check

Conversation

@fmeum
Copy link
Copy Markdown
Collaborator

@fmeum fmeum commented Feb 26, 2026

Description

Motivation

Fix #28803

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: None

@iancha1992
Copy link
Copy Markdown
Member

Hi @fmeum. Is the test being fixed currently?

@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Mar 3, 2026

On it. Still trying to find the least bad fix.

@iancha1992
Copy link
Copy Markdown
Member

iancha1992 commented Mar 4, 2026

@fmeum Any update on this? We hope to get the 9.0.1 RC1 tomorrow

@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Mar 4, 2026

I talked about a fix with @lberki and can likely finish it tomorrow.

@fmeum fmeum force-pushed the 28803-inclusion-check branch 2 times, most recently from a37b404 to 9eb72e1 Compare March 5, 2026 09:42
@fmeum fmeum force-pushed the 28803-inclusion-check branch from 3083034 to 3b19125 Compare March 5, 2026 14:30
@meisterT
Copy link
Copy Markdown
Member

meisterT commented Mar 5, 2026

What's the expection RAM regression of this?

@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Mar 5, 2026

@lberki is running a benchmark

@iancha1992 let's defer this to a 9.0.2 release if it's the last blocker for 9.0.1 - the fix is too uncertain at this point

@lberki
Copy link
Copy Markdown
Contributor

lberki commented Mar 5, 2026

Uh, I can run a benchmark once there is code, but I'm not at the moment. What I did do is to check how many source artifacts there are in a large build (I can tell you the exact one in private) and the end result is ~500K. With 16 bytes per Java object that comes out to 8MB of wastage for the wrappers.

Reasonable, I think, but we do have a few builds dancing on the edge already so I didn't want to agree to it just willy-nilly.

@fmeum fmeum force-pushed the 28803-inclusion-check branch from 3b19125 to 9636181 Compare March 6, 2026 09:15
@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Mar 6, 2026

@lberki This is functional now - could you run a benchmark?

I had to drop the wrapper optimization since lookup via a PathFragment would not match a wrapper. Alternatives would be to use a ConcurrentSkipListMap with a custom comparator to avoid the wrapper or to vendor in a ConcurrentHashMap implementation and make hashCode overridable. Neither of those sounds great to me.

@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Mar 6, 2026

I tested this on Bazel's own build and found ConcurrentSkipListMap to use the least memory. I switched to it now.

@fmeum fmeum force-pushed the 28803-inclusion-check branch 2 times, most recently from cc9c458 to 0a47cf5 Compare March 8, 2026 09:31
@fmeum fmeum marked this pull request as ready for review March 8, 2026 09:33
@fmeum fmeum requested review from lberki, pzembrod and trybka as code owners March 8, 2026 09:33
@github-actions github-actions Bot added team-Performance Issues for Performance teams team-Rules-CPP Issues for C++ rules awaiting-review PR is awaiting review from an assigned reviewer labels Mar 8, 2026
@iancha1992
Copy link
Copy Markdown
Member

@lberki @pzembrod What's the status on this? We want to include this fix in our upcoming 9.0.2 RC1 on Wednesday.

@fmeum fmeum force-pushed the 28803-inclusion-check branch from 0a47cf5 to d9f5d44 Compare March 20, 2026 14:05
@lberki
Copy link
Copy Markdown
Contributor

lberki commented Mar 20, 2026

I ran some benchmarks. The first one is encouraging: the memory impact for n=5 builds is ~7MB median, which is about half a standard deviation.

I kicked off some more benchmarks just in case, because it has happened in the past that my ad hoc benchmark said "OK" and it wasn't.

@lberki
Copy link
Copy Markdown
Contributor

lberki commented Mar 23, 2026

Next set of benchmarks is doubly encouraging: it was a big build without special focus on C++ and the memory hit is well within measurement error. So on the memory use side, we're good.

@lberki
Copy link
Copy Markdown
Contributor

lberki commented Mar 23, 2026

Let me know when I should actually review the code of this pull request!

@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Mar 23, 2026

@lberki It's ready now, thanks for all the testing!

@iancha1992
Copy link
Copy Markdown
Member

@lberki Please let me know if you need help merging this. Thanks!

@yuzhy8701
Copy link
Copy Markdown
Contributor

I drafted 2 changes on top of your code:

I feel like if we allow having incorrect cases (the current impl), we should at least allow option 1.

@iancha1992
Copy link
Copy Markdown
Member

Please review the changes @lberki

Comment thread src/main/java/com/google/devtools/build/lib/actions/ArtifactFactory.java Outdated
Comment thread src/main/java/com/google/devtools/build/lib/actions/ArtifactFactory.java Outdated
Comment thread src/main/java/com/google/devtools/build/lib/actions/ArtifactFactory.java Outdated
@fmeum fmeum requested a review from lberki March 31, 2026 21:41
@lberki lberki added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Apr 1, 2026
@copybara-service copybara-service Bot closed this in 246ea98 Apr 2, 2026
@github-actions github-actions Bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Apr 2, 2026
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Apr 2, 2026
…uild#28810)

### Description

### Motivation
Fix bazelbuild#28803

### Build API Changes

No

### Checklist

- [ ] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

### Release Notes

RELNOTES: None

Closes bazelbuild#28810.

PiperOrigin-RevId: 893719641
Change-Id: I4cd7a5ac6b1a35467ea38fdfd1063dc3ed35ffa0
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Apr 2, 2026
…uild#28810)

Fix bazelbuild#28803

No

- [ ] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

RELNOTES: None

Closes bazelbuild#28810.

PiperOrigin-RevId: 893719641
Change-Id: I4cd7a5ac6b1a35467ea38fdfd1063dc3ed35ffa0
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Apr 2, 2026
…uild#28810)

### Description

### Motivation
Fix bazelbuild#28803

### Build API Changes

No

### Checklist

- [ ] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

### Release Notes

RELNOTES: None

Closes bazelbuild#28810.

PiperOrigin-RevId: 893719641
Change-Id: I4cd7a5ac6b1a35467ea38fdfd1063dc3ed35ffa0
github-merge-queue Bot pushed a commit that referenced this pull request Apr 3, 2026
…#28810) (#29213)

### Description

### Motivation
Fix #28803

### Build API Changes

No

### Checklist

- [ ] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

### Release Notes

RELNOTES: None

Closes #28810.

PiperOrigin-RevId: 893719641
Change-Id: I4cd7a5ac6b1a35467ea38fdfd1063dc3ed35ffa0

Commit
246ea98

Co-authored-by: Fabian Meumertzheim <[email protected]>
sync-agent-neo Bot pushed a commit to aosp-mirror-neo/platform_prebuilts_bazel_linux-x86_64 that referenced this pull request Apr 21, 2026
This binary is based on bazel 9.0.1, with the following patches on top:

* bazelbuild/bazel#28810
* bazelbuild/bazel#29057
* cl/890821032

It resolves build problems with bazel 9 when targeting windows. The patches will
be included in a future version of bazel, which we'll upgrade to when released.

Bug: 404623658
Change-Id: I4d0e56270c9fb6565eb5ccda6a135f486a6a6964
sync-agent-neo Bot pushed a commit to aosp-mirror-neo/platform_prebuilts_bazel_windows-x86_64 that referenced this pull request Apr 21, 2026
This binary is based on bazel 9.0.1, with the following patches on top:

* bazelbuild/bazel#28810
* bazelbuild/bazel#29057
* cl/890821032

It resolves build problems with bazel 9 when targeting windows. The patches will
be included in a future version of bazel, which we'll upgrade to when released.

Bug: 404623658
Change-Id: Idd6d5dde35d57b1654cefdebc4c9f2db6a6a6964
sync-agent-neo Bot pushed a commit to aosp-mirror-neo/platform_prebuilts_bazel_darwin-x86_64 that referenced this pull request Apr 21, 2026
This binary is based on bazel 9.0.1, with the following patches on top:

* bazelbuild/bazel#28810
* bazelbuild/bazel#29057
* cl/890821032

It resolves build problems with bazel 9 when targeting windows. The patches will
be included in a future version of bazel, which we'll upgrade to when released.

Bug: 404623658
Change-Id: Ibf2ebcde8ae7acb526fc466c689e55f96a6a6964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Performance Issues for Performance teams team-Rules-CPP Issues for C++ rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[regression] Bazel 9 Cpp inclusion checking fails on Windows due to case sensitivity

5 participants