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

bazel mod tidy adds/removes the wrong use_repo() names for rules_oci #24950

Closed
mering opened this issue Jan 17, 2025 · 2 comments
Closed

bazel mod tidy adds/removes the wrong use_repo() names for rules_oci #24950

mering opened this issue Jan 17, 2025 · 2 comments
Labels
team-CLI Console UI team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug untriaged

Comments

@mering
Copy link
Contributor

mering commented Jan 17, 2025

Description of the bug:

See bazel-contrib/rules_oci#727.

Which category does this issue belong to?

CLI, External Dependency

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

Use the following MODULE.bazel file:

bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(name = "rules_oci", version = "2.0.1")
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
    name = "distroless_base",
    tag = "latest",
    image = "gcr.io/distroless/base",
    platforms = ["linux/amd64"],
)
use_repo(oci, "distroless_base")

Add the following BUILD.bazel file:

load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_oci//oci:defs.bzl", "oci_image")

pkg_tar(
    name = "layer",
    srcs = [":my_file.txt"],
)

oci_image(
    name = "image",
    base = "@distroless_base",
    tars = [
        ":layer",
    ],
)

Running bazel mod tidy should not do any changes.

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

8.0

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 ?


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 response

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

No response

@mering mering changed the title "bazel mod tidy" adds/removes the wrong use_repo() names for rules_oci bazel mod tidy adds/removes the wrong use_repo() names for rules_oci Jan 17, 2025
@github-actions github-actions bot added team-CLI Console UI team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. labels Jan 17, 2025
@fmeum
Copy link
Collaborator

fmeum commented Jan 17, 2025

rules_oci has full control over the repos it wants bazel mod tidy to suggest and chooses to include the platform-specific ones here: https://github.com/bazel-contrib/rules_oci/blob/a911e9eea205568939b67c8d90f6014476dc00c4/oci/extensions.bzl#L50

There doesn't seem to be anything Bazel itself would need to do here, but feel free to reopen if that should turn out not to be true.

@fmeum fmeum closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2025
@thesayyn
Copy link
Contributor

I filed #25046 describing the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-CLI Console UI team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug untriaged
Projects
None yet
Development

No branches or pull requests

6 participants