Skip to content

bazel: add Qt corelib bootstrap headers for hermetic builds#9744

Closed
oharboe wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
Pinata-Consulting:qt-fix
Closed

bazel: add Qt corelib bootstrap headers for hermetic builds#9744
oharboe wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
Pinata-Consulting:qt-fix

Conversation

@oharboe
Copy link
Collaborator

@oharboe oharboe commented Mar 12, 2026

@hzeller Thoughts?

Qt public headers in build/include/QtCore/ internally include bootstrap headers from src/corelib/ subdirectories. Under strict Bazel sandboxing, these transitive includes are undeclared and cause build failures. Add a patch to the qt-bazel git_override that explicitly declares the corelib bootstrap headers in the QtCore target's hdrs.

Test: bazelisk query on @qt-bazel//qt_source:bootstrap hdrs

Before (without patch): 2 src/corelib headers declared
src/corelib/text/qlocale_data_p.h
src/corelib/time/qromancalendar_data_p.h

After (with patch): 383 src/corelib headers declared across
src/corelib/global/.h
src/corelib/io/
.h
src/corelib/kernel/.h
src/corelib/plugin/
.h
src/corelib/serialization/.h
src/corelib/text/
.h
src/corelib/time/.h
src/corelib/tools/
.h

Qt public headers in build/include/QtCore/ internally include bootstrap
headers from src/corelib/ subdirectories. Under strict Bazel sandboxing,
these transitive includes are undeclared and cause build failures. Add a
patch to the qt-bazel git_override that explicitly declares the corelib
bootstrap headers in the QtCore target's hdrs.

Test: bazelisk query on @qt-bazel//qt_source:bootstrap hdrs

Before (without patch): 2 src/corelib headers declared
  src/corelib/text/qlocale_data_p.h
  src/corelib/time/qromancalendar_data_p.h

After (with patch): 383 src/corelib headers declared across
  src/corelib/global/*.h
  src/corelib/io/*.h
  src/corelib/kernel/*.h
  src/corelib/plugin/*.h
  src/corelib/serialization/*.h
  src/corelib/text/*.h
  src/corelib/time/*.h
  src/corelib/tools/*.h

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request resolves a hermetic build issue with Qt under Bazel by explicitly declaring bootstrap headers. A patch is applied to the qt-bazel dependency to add the required header files to the QtCore target. The changes are correct and effectively address the build failure. I have no further recommendations.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@oharboe oharboe requested a review from maliberty March 13, 2026 05:54
@oharboe
Copy link
Collaborator Author

oharboe commented Mar 13, 2026

@hzeller Claude told me this had to be fixed 😺

  1. Hallucinations?
  2. Accept this PR to show that it works, is necessary and to board up the broken window
  3. Fix upstream
  4. Upgrade and fix the broken window

?

@QuantamHD
Copy link
Collaborator

Is this actually breaking something? If so what's the error?

And this should most certainly be upstreamed.

@oharboe
Copy link
Collaborator Author

oharboe commented Mar 13, 2026

Is this actually breaking something? If so what's the error?

And this should most certainly be upstreamed.

I was trying to get numbers on #9738 when Claude said that this had to be fixed.

Claude was doing a lot of bazel clean --expunge, so an untypical use case with A/B fresh builds.

That's all I know.

@hzeller
Copy link
Collaborator

hzeller commented Mar 13, 2026

I think first establishing if there is a problem is a good step.

@oharboe
Copy link
Collaborator Author

oharboe commented Mar 13, 2026

I think first establishing if there is a problem is a good step.

We have this pull request.

Close it as an "observe and report" PR that we can pull out if needed?

@oharboe oharboe changed the title bazel: add Qt corelib bootstrap headers for hermetic builds [RFQ] bazel: add Qt corelib bootstrap headers for hermetic builds Mar 13, 2026
@oharboe oharboe changed the title [RFQ] bazel: add Qt corelib bootstrap headers for hermetic builds bazel: add Qt corelib bootstrap headers for hermetic builds Mar 13, 2026
@oharboe
Copy link
Collaborator Author

oharboe commented Mar 13, 2026

@maliberty I'm closing this, you know where to find it if you hear about the problem from someone else. If I am able to reproduce it, I will let you know.

@oharboe oharboe closed this Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants