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

maybe doesn't work in a bzlmod module implementation function #15377

Closed
shs96c opened this issue Apr 30, 2022 · 1 comment
Closed

maybe doesn't work in a bzlmod module implementation function #15377

shs96c opened this issue Apr 30, 2022 · 1 comment
Assignees
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug

Comments

@shs96c
Copy link
Contributor

shs96c commented Apr 30, 2022

Description of the bug:

A common pattern to avoid needing to determine whether or not to create new workspaces in a repository rule or macro is to use maybe to check the native.existing_rules() for the presence of a particular well-known name. This used to work in a bzlmod implementation function, but now no longer does.

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

git clone https://github.com/shs96c/rules_jvm_external.git
cd rules_jvm_external
git checkout bzlmod
cd examples/java-export
bazel build //...

Which operating system are you running Bazel on?

macOS

What is the output of bazel info release?

release 5.1.1

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 master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

Not yet

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

No response

@sgowroji sgowroji added type: bug team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. untriaged labels May 2, 2022
@meteorcloudy meteorcloudy added area-Bzlmod Bzlmod-specific PRs, issues, and feature requests and removed untriaged labels May 2, 2022
@meteorcloudy meteorcloudy added the P2 We'll consider working on this in future. (Assignee optional) label May 2, 2022
@Wyverald
Copy link
Member

Wyverald commented May 2, 2022

This is actually intentional. An extension has its own "namespace" and can name its repos anything without fear of conflicting with something else. In fact, an extension cannot see repos generated by other extensions at all. What behavior are you expecting maybe to have here?

This used to work in a bzlmod implementation function, but now no longer does.

IIUC maybe never worked in bzlmod. What's the behavior you remember?

@Wyverald Wyverald closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug
Projects
None yet
Development

No branches or pull requests

4 participants