E52E Flip incompatible_no_implicit_file_export by hofbi · Pull Request #27674 · bazelbuild/bazel · GitHub
[go: up one dir, main page]

Skip to content

Flip incompatible_no_implicit_file_export#27674

Closed
hofbi wants to merge 3 commits intobazelbuild:masterfrom
hofbi:incompatible_no_implicit_file_export
Closed

Flip incompatible_no_implicit_file_export#27674
hofbi wants to merge 3 commits intobazelbuild:masterfrom
hofbi:incompatible_no_implicit_file_export

Conversation

@hofbi
Copy link
Contributor
@hofbi hofbi commented Nov 14, 2025

@hofbi hofbi force-pushed the incompatible_no_implicit_file_export branch 3 times, most recently from e5d190a to 0c7ff55 Compare December 18, 2025 14:40
@hofbi hofbi force-pushed the incompatible_no_implicit_file_export branch 3 times, most recently from f560a43 to 257e440 Compare December 23, 2025 11:19
@hofbi
Copy link
Contributor Author
hofbi commented Dec 23, 2025

@meteorcloudy Now that this is green, could you trigger https://buildkite.com/bazel/bazel-at-head-plus-downstream for me on this PR so that I can see if something downstream breaks.

@fmeum
Copy link
Collaborator
fmeum commented Dec 23, 2025

@hofbi
Copy link
Contributor Author
hofbi commented Dec 23, 2025

Hope that I did this right: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/5161#_

I think you triggered this job from master. You might want to cancel this job, not sure if it includes my changes.

I checked #26587 (comment) how we did it last time, and it looks like there is also https://buildkite.com/bazel/bcr-bazel-compatibility-test. Now I am not sure which one we need. And what to do exactly to trigger from this branch as both https://buildkite.com/bazel/bcr-bazel-compatibility-test/builds/492/steps/canvas and https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4824/steps/canvas were executed from master and main last time 🤷

Maybe we have to wait for @meteorcloudy.

@fmeum
Copy link
Collaborator
fmeum commented Dec 23, 2025

master is the base branch, but based on the errors this does include your commit. The BCR test is a separate check which runs on BCR modules rather than bazelbuild repos.

@meteorcloudy
Copy link
Member

Added migration-ready to #10225 so that it will be tested in the nightly run of https://buildkite.com/bazel/bcr-bazel-compatibility-test/builds/722

Also manually triggered https://buildkite.com/bazel/bcr-bazel-compatibility-test/builds/723 with env vars

CI_RESOURCE_PERCENTAGE="10"
SELECT_TOP_BCR_MODULES="100"
SKIP_WAIT_FOR_APPROVAL="1"
USE_BAZELISK_MIGRATE="1"
USE_BAZEL_VERSION="latest"
INCOMPATIBLE_FLAGS="--incompatible_no_implicit_file_export"

We have some docs at https://github.com/bazelbuild/continuous-integration/tree/master/buildkite/bazel-central-registry#bcr-bazel-compatibility-test, @fmeum feel free to trigger a build when needed.

@hofbi
Copy link
Contributor Author
hofbi commented Feb 3, 2026

@meteorcloudy Could you trigger another run for https://buildkite.com/bazel/bcr-bazel-compatibility-test to verify that cgrindel/bazel-starlib#566 and bazel-contrib/rules_bazel_integration_test#552 are fixed.

bazel-contrib/rules_kotlin#1440 and bazelbuild/rules_android#440 are still open (maintainers wanted to fix this or I am waiting on a PR review). Are these blockers for getting this flag flipped?

Speaking about blockers, is there anything we would have to change in this PR? E.g. waiting for the next rules_python release to clear out the TODOs added here?

@meteorcloudy
Copy link
Member

You can already see the result in the nightly run: https://buildkite.com/bazel/bcr-bazel-compatibility-test/builds/785

Indeed bazel-starlib and rules_bazel_integration_test have been fixed, but rules_android and rules_multitool are broken by this flag.

@meteorcloudy
Copy link
Member

I would say none of the broken modules should block the merge of this PR.

@hofbi hofbi marked this pull request as ready for review February 3, 2026 15:51
@hofbi hofbi requested review from a team and pzembrod as code owners February 3, 2026 15:51
@hofbi hofbi requested a review from meteorcloudy as a code owner February 3, 2026 15:51
@hofbi hofbi requested review from dabanki and removed request for a team February 3, 2026 15:51
@github-actions github-actions bot added team-Configurability platforms, toolchains, cquery, select(), config transitions team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-Rules-CPP Issues for C++ rules awaiting-review PR is awaiting review from an assigned reviewer labels Feb 3, 2026
Copy link
@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 flips the default value of the incompatible_no_implicit_file_export flag to true. This change makes source files package-private by default, requiring explicit exports_files declarations for cross-package visibility. The modifications correctly update the flag's definition and adjust various tests to align with the new default behavior. Some tests now include exports_files directives, while others temporarily disable the flag to accommodate dependencies that are not yet updated. The changes are consistent and look good.

@meteorcloudy meteorcloudy 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 Feb 4, 2026
@meteorcloudy
Copy link
Member

@hofbi Looks like we cannot flip this flag inside the google monorepo. Can you use https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/packages/semantics/FlagConstants.java to refactor the change so that we only flip it for Bazel?

@hofbi hofbi force-pushed the incompatible_no_implicit_file_export branch from 73da3c3 to 6e7a76c Compare February 9, 2026 20:41
@hofbi
Copy link
Contributor Author
hofbi commented Feb 9, 2026

@meteorcloudy I added the flags constants as requested. Let me know if this works.

@hofbi
Copy link
Contributor Author
hofbi commented Feb 23, 2026

@meteorcloudy kind reminder

@meteorcloudy
Copy link
Member

Sorry for the delay, this is in progress. FYI @deepalak56

@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 Feb 24, 2026
copybara-service bot pushed a commit to bazelbuild/rules_java that referenced this pull request Feb 24, 2026
Broken by bazelbuild/bazel#27674

(ignore-relnotes)

PiperOrigin-RevId: 874542646
Change-Id: I4f1e8c9baae8330d703d6f7eb145e5a3ee2923fc
mbland added a commit to mbland/rules_scala that referenced this pull request Feb 26, 2026
Emits an `exports_files` directive for the `.jar` files included in
repositories generated by `scala_maven_import_external`.

---

Follow-up from bazel-contrib#1812 that fixes `last_green` builds, which now
incorporate the `--incompatible_no_implicit_file_export` flag flip from:

- bazelbuild/bazel@0b8a518
- bazelbuild/bazel#27674
mbland added a commit to bazel-contrib/rules_scala that referenced this pull request Feb 26, 2026
Emits an `exports_files` directive for the `.jar` files included in
repositories generated by `scala_maven_import_external`.

---

Follow-up from #1812 that fixes `last_green` builds, which now
incorporate the `--incompatible_no_implicit_file_export` flag flip from:

- bazelbuild/bazel@0b8a518
- bazelbuild/bazel#27674
Ahajha added a commit to Ahajha/rules_pycross that referenced this pull request Mar 12, 2026
I believe this happens when two things happen:
1. Bump Bazel past bazelbuild/bazel#27674 or add `--incompatible_no_implicit_file_export`
2. Use the deps declared in your main module in another module (for example a manually built wheel)

Note that I couldn't even get close to getting `--incompatible_no_implicit_file_export` working on this repo overall, but this patch works for my repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Configurability platforms, toolchains, cquery, select(), config transitions team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team- 5182 Rules-CPP Issues for C++ rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

incompatible_no_implicit_file_export: implicitly exported files have private visibility

3 participants

0