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

incompatible_stop_exporting_language_modules exception logic is broken #22606

Open
martis42 opened this issue Jun 1, 2024 · 0 comments
Open
Labels
team-Core Skyframe, bazel query, BEP, options parsing, bazelrc type: bug untriaged

Comments

@martis42
Copy link

martis42 commented Jun 1, 2024

Description of the bug:

Flag incompatible_stop_exporting_language_modules implements a logic allowing to load language specific modules in some places like rules_cc or rules_python to enable a migration phase in which such places re-export the native symbols (what rules_cc and rules_python still do)

This logic is however broken.

Imho this is a problem for performing the refactoring demanded by this incompatibility flag. Users have been used to simply using those globally available symbols for years. Making progress on this will most likely not work without enforcing compliance to this flag in the CI for the core Bazel rules and tools. But, CI enforcement requires the exception logic to work.

Which category does this issue belong to?

Core

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  • clone rules_python, I tested with HEAD
  • Execute bazel build --incompatible_stop_exporting_language_modules //python/private:all
  • Tested with Bazel versions [6.4.0, 7.0.0, 7.1.2, rolling]

This error appears: ERROR: .../rules_python/python/private/reexports.bzl:37:17: PyInfo may only be used from one of the following repositories or prefixes: @_builtins//, @bazel_tools//, @rules_python//, tools/build_defs/python. It may be temporarily re-enabled for general use by setting --incompatible_stop_exporting_language_modules=false
Which makes no sense, as we are within rules_python

Which operating system are you running Bazel on?

Linux Mint 21.1

What is the output of bazel info release?

See reproducing steps

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

Issue for this flag does not mention this problem: #19455

Any other information, logs, or outputs that you want to share?

Please note, although rules_python was used to reproduce this issue, it is not limited to this rule set. One can see the same problem with rules_cc.

@github-actions github-actions bot added the team-Core Skyframe, bazel query, BEP, options parsing, bazelrc label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Core Skyframe, bazel query, BEP, options parsing, bazelrc type: bug untriaged
Projects
None yet
Development

No branches or pull requests

4 participants