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

0.0.5 release breaks downstream users due to register_toolchain call #33

Closed
rickeylev opened this issue Apr 27, 2023 · 0 comments · Fixed by #34
Closed

0.0.5 release breaks downstream users due to register_toolchain call #33

rickeylev opened this issue Apr 27, 2023 · 0 comments · Fixed by #34
Assignees
Labels
bug Something isn't working

Comments

@rickeylev
Copy link
Contributor

The 0.0.5 release is essentially broken. The reason is because 1505275 added a register_toolchains() call to the MODULE.bazel file, however, the repo it names is only used as a dev dependency. This basically requires downstream users to have to define and use that repo, otherwise that repo name isn't visible to rules_testing:MODULE.

Because these toolchains are only used for development, they shouldn't be registered for downstream users. Unfortunately, Bazel doesn't allow marking a register_toolchains() call as dev-only; I filed bazelbuild/bazel#18248 for that feature.

To fix, we can probably use the idea Fabian suggested: have an extension generate a "middleman" repo. That repo is empty when the extension is not the root module (non-dev case), otherwise, it points to the actual toolchains.

rickeylev added a commit to rickeylev/rules_testing that referenced this issue Apr 27, 2023
The Python toolchains are only needed for dev purposes (doc generation).

Unfortunately, Bazel doesn't provide an easy way to mark a
register_toolchains() call as dev-only. To work around this, we use an
extension to create a repository whose contents depend on if its the
root module or not. If its the root module, it means we're the
rules_testing module and its the dev-dependency case, so write a
build file with the real toolchains. If its not the root module, then
its not the dev-dependency case, so write an empty build file.

Fixes bazelbuild#33
rickeylev added a commit to rickeylev/rules_testing that referenced this issue Apr 27, 2023
The Python toolchains are only needed for dev purposes (doc generation).

Unfortunately, Bazel doesn't provide an easy way to mark a
register_toolchains() call as dev-only. To work around this, we use an
extension to create a repository whose contents depend on if its the
root module or not. If its the root module, it means we're the
rules_testing module and its the dev-dependency case, so write a
build file with the real toolchains. If its not the root module, then
its not the dev-dependency case, so write an empty build file.

Fixes bazelbuild#33
@rickeylev rickeylev self-assigned this Apr 27, 2023
@rickeylev rickeylev added the bug Something isn't working label Apr 27, 2023
rickeylev added a commit to rickeylev/rules_testing that referenced this issue Apr 27, 2023
The Python toolchains are only needed for dev purposes (doc generation).

Unfortunately, Bazel doesn't provide an easy way to mark a
register_toolchains() call as dev-only. To work around this, we use an
extension to create a repository whose contents depend on if its the
root module or not. If its the root module, it means we're the
rules_testing module and its the dev-dependency case, so write a
build file with the real toolchains. If its not the root module, then
its not the dev-dependency case, so write an empty build file.

Fixes bazelbuild#33
rickeylev added a commit to rickeylev/rules_testing that referenced this issue Apr 27, 2023
The Python toolchains are only needed for dev purposes (doc generation).

Unfortunately, Bazel doesn't provide an easy way to mark a
register_toolchains() call as dev-only. To work around this, we use an
extension to create a repository whose contents depend on if its the
root module or not. If its the root module, it means we're the
rules_testing module and its the dev-dependency case, so write a
build file with the real toolchains. If its not the root module, then
its not the dev-dependency case, so write an empty build file.

Fixes bazelbuild#33
rickeylev added a commit to rickeylev/rules_testing that referenced this issue Apr 27, 2023
The Python toolchains are only needed for dev purposes (doc generation).

Unfortunately, Bazel doesn't provide an easy way to mark a
register_toolchains() call as dev-only. To work around this, we use an
extension to create a repository whose contents depend on if its the
root module or not. If its the root module, it means we're the
rules_testing module and its the dev-dependency case, so write a
build file with the real toolchains. If its not the root module, then
its not the dev-dependency case, so write an empty build file.

Fixes bazelbuild#33
rickeylev added a commit to rickeylev/rules_testing that referenced this issue Apr 27, 2023
The Python toolchains are only needed for dev purposes (doc generation).

Unfortunately, Bazel doesn't provide an easy way to mark a
register_toolchains() call as dev-only. To work around this, we use an
extension to create a repository whose contents depend on if its the
root module or not. If its the root module, it means we're the
rules_testing module and its the dev-dependency case, so write a
build file with the real toolchains. If its not the root module, then
its not the dev-dependency case, so write an empty build file.

Fixes bazelbuild#33
rickeylev added a commit to rickeylev/rules_testing that referenced this issue May 1, 2023
This prevents downstream users from having to have a Python toolchain
with the given name setup.

Fixes bazelbuild#33
rickeylev added a commit to rickeylev/rules_testing that referenced this issue May 1, 2023
This prevents downstream users from having to have a Python toolchain
with the given name setup.

Fixes bazelbuild#33
rickeylev added a commit to rickeylev/rules_testing that referenced this issue May 1, 2023
This prevents downstream users from having to have a Python toolchain
with the given name setup.

Fixes bazelbuild#33
@rickeylev rickeylev reopened this May 1, 2023
rickeylev added a commit to rickeylev/bazel-central-registry that referenced this issue May 2, 2023
The rules_testing 0.0.5 release is mostly broken because it requires
users to register a specific repo name. A new release is being made
that doesn't have this problem.

See bazelbuild/rules_testing#33 for
details.
rickeylev added a commit to rickeylev/bazel-central-registry that referenced this issue May 2, 2023
The rules_testing 0.0.5 release is mostly broken because it requires
users to register a specific repo name. A new release is being made
that doesn't have this problem.

See bazelbuild/rules_testing#33 for
details.
fmeum pushed a commit to bazelbuild/bazel-central-registry that referenced this issue May 2, 2023
The rules_testing 0.0.5 release is mostly broken because it requires
users to register a specific repo name. A new release is being made
that doesn't have this problem.

See bazelbuild/rules_testing#33 for
details.
alexeagle pushed a commit to aspect-build/bazel-central-registry that referenced this issue Jun 26, 2023
The rules_testing 0.0.5 release is mostly broken because it requires
users to register a specific repo name. A new release is being made
that doesn't have this problem.

See bazelbuild/rules_testing#33 for
details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant