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

Can't use module_override to override a repo fetched inside module extension #23580

Closed
peakschris opened this issue Sep 10, 2024 · 5 comments
Closed
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request

Comments

@peakschris
Copy link

peakschris commented Sep 10, 2024

Description of the bug:

We have a module extension that uses a repo rule with rctx.download to download an artifact. We use it from the top level MODULE.bazel as:

fetcher = use_extension("//src/repo/bazel/rules:fetcher_extension.bzl", "fetcher")
fetcher.artifact_with_plat(
     name = "artifact1",
     url = y
     hash = z
)
use_repo("artifact1")

This works fine. The artifact ends up in my extensions folder as +fetcher+artifact1

How do I then override this artifact using override_module? --override_module=artifact1=... does not work, and --override_module=+fetcher+artifact1=... does not work.

Which category does this issue belong to?

External Dependency

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

No response

Which operating system are you running Bazel on?

windows

What is the output of bazel info release?

release 7.3.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 HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

no

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

No response

@github-actions github-actions bot added the team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. label Sep 10, 2024
@fmeum
Copy link
Collaborator

fmeum commented Sep 10, 2024

This will be solved by #23534.

@peakschris
Copy link
Author

@fmeum excellent! Can #23534 be released in bazel 7.3.x or 7.4?

@fmeum
Copy link
Collaborator

fmeum commented Sep 10, 2024

It will be in 7.4.0.

@meteorcloudy meteorcloudy added P1 I'll work on this now. (Assignee required) and removed untriaged labels Sep 10, 2024
@Wyverald
Copy link
Member

Also, the flag you're looking for is actually --override_repository=+fetcher+artifact1=....

@Wyverald Wyverald closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
copybara-service bot pushed a commit that referenced this issue Sep 24, 2024
Work towards #19301
Fixes #23580

RELNOTES: `override_repo` and `inject_repo` can be used to override and inject repos in module extensions.

Closes #23534.

PiperOrigin-RevId: 678139661
Change-Id: Iea7caca949c00e701f056c1037e273fee9740e93
fmeum added a commit to fmeum/bazel that referenced this issue Oct 10, 2024
Work towards bazelbuild#19301
Fixes bazelbuild#23580

RELNOTES: `override_repo` and `inject_repo` can be used to override and inject repos in module extensions.

Closes bazelbuild#23534.

PiperOrigin-RevId: 678139661
Change-Id: Iea7caca949c00e701f056c1037e273fee9740e93

(cherry picked from commit 46341b1)
fmeum added a commit to fmeum/bazel that referenced this issue Oct 10, 2024
Work towards bazelbuild#19301
Fixes bazelbuild#23580

RELNOTES: `override_repo` and `inject_repo` can be used to override and inject repos in module extensions.

Closes bazelbuild#23534.

PiperOrigin-RevId: 678139661
Change-Id: Iea7caca949c00e701f056c1037e273fee9740e93

(cherry picked from commit 46341b1)
fmeum added a commit to fmeum/bazel that referenced this issue Oct 10, 2024
Work towards bazelbuild#19301
Fixes bazelbuild#23580

RELNOTES: `override_repo` and `inject_repo` can be used to override and inject repos in module extensions.

Closes bazelbuild#23534.

PiperOrigin-RevId: 678139661
Change-Id: Iea7caca949c00e701f056c1037e273fee9740e93

(cherry picked from commit 46341b1)
fmeum added a commit to fmeum/bazel that referenced this issue Oct 10, 2024
Work towards bazelbuild#19301
Fixes bazelbuild#23580

RELNOTES: `override_repo` and `inject_repo` can be used to override and inject repos in module extensions.

Closes bazelbuild#23534.

PiperOrigin-RevId: 678139661
Change-Id: Iea7caca949c00e701f056c1037e273fee9740e93

(cherry picked from commit 46341b1)
fmeum added a commit to fmeum/bazel that referenced this issue Oct 10, 2024
Work towards bazelbuild#19301
Fixes bazelbuild#23580

RELNOTES: `override_repo` and `inject_repo` can be used to override and inject repos in module extensions.

Closes bazelbuild#23534.

PiperOrigin-RevId: 678139661
Change-Id: Iea7caca949c00e701f056c1037e273fee9740e93

(cherry picked from commit 46341b1)
github-merge-queue bot pushed a commit that referenced this issue Oct 10, 2024
Work towards #19301
Fixes #23580

RELNOTES: `override_repo` and `inject_repo` can be used to override and
inject repos in module extensions.

Closes #23534.

PiperOrigin-RevId: 678139661
Change-Id: Iea7caca949c00e701f056c1037e273fee9740e93

(cherry picked from commit
46341b1)

Fixes #23724
Fixes #23799

Also includes:
* Disallow importing injected repos
(8472c9d)

---------

Co-authored-by: Xùdōng Yáng <wyverald@gmail.com>
@iancha1992
Copy link
Member

A fix for this issue has been included in Bazel 7.4.0 RC1. Please test out the release candidate and report any issues as soon as possible.
If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=7.4.0rc1. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants