Skip to content

fix: Fix bzlmod repo resolution in oci_pull#891

Merged
thesayyn merged 1 commit into
bazel-contrib:mainfrom
UebelAndre:main
Apr 1, 2026
Merged

fix: Fix bzlmod repo resolution in oci_pull#891
thesayyn merged 1 commit into
bazel-contrib:mainfrom
UebelAndre:main

Conversation

@UebelAndre
Copy link
Copy Markdown
Contributor

aspect_bazel_lib and package_metadata are not visible from the generated oci_pull repositories. To resolve this the desired symbols are reexported so oci_pull repositories only need to resolve rules_oci which is always guaranteed to work.

closes #575

@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented Mar 25, 2026

Test

⚠️ Buildkite build #224 failed.

//examples/env:assert_version_is_correct_gen failed to build

bash failed: error executing Genrule command (from target //examples/env:assert_version_is_correct_gen) /bin/bash -c ... (remaining 1 argument skipped)
 
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
 
docker: Error response from daemon: client version 1.42 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version.
See 'docker run --help'.

💡 To reproduce the build failures, run

bazel build //examples/env:assert_version_is_correct_gen

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0cfd139fe

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread oci/private/pull.bzl

load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@package_metadata//rules:package_metadata.bzl", "package_metadata")
load("@rules_oci//oci/private:pull.bzl", "copy_to_directory", "package_metadata")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve repo-name remapping in generated oci_pull BUILD

The generated BUILD.bazel now hard-codes load("@rules_oci//oci/private:pull.bzl", ...), which breaks consumers that import this module under a different apparent repo name (for example via bazel_dep(..., repo_name = "...") or non-rules_oci WORKSPACE names). Before this change, the generated file only loaded @aspect_bazel_lib/@package_metadata and did not require a @rules_oci alias, so this introduces a new name-coupling regression for those setups.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other generated repositories which use this pattern so this concern is already not relevant.

@UebelAndre
Copy link
Copy Markdown
Contributor Author

Test

⚠️ Buildkite build #224 failed.

//examples/env:assert_version_is_correct_gen failed to build

bash failed: error executing Genrule command (from target //examples/env:assert_version_is_correct_gen) /bin/bash -c ... (remaining 1 argument skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging

docker: Error response from daemon: client version 1.42 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version.
See 'docker run --help'.

💡 To reproduce the build failures, run

bazel build //examples/env:assert_version_is_correct_gen

this seems unrelated to my change.

@UebelAndre UebelAndre changed the title Fix bzlmod repo resolution in oci_pull fix: Fix bzlmod repo resolution in oci_pull Mar 28, 2026
@UebelAndre UebelAndre requested a review from thesayyn March 28, 2026 17:32
@UebelAndre
Copy link
Copy Markdown
Contributor Author

ping @thesayyn

@thesayyn thesayyn merged commit f214185 into bazel-contrib:main Apr 1, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: aspect_bazel_lib dependency is leaking into users module

2 participants