Skip to content

Conversation

@pulasthibandara
Copy link
Contributor

Porting from: bazel-contrib/rules_oci#841

The buildx repository rule generate a lockfile that has a platform specific configure_buildx block that breaks when used across platforms (ie: a MODULE.bazel.lock generated on OSX breaks on Linux_amd64).

ex: Module.bazel.lock

"buildx": {
    "repoRuleId": "@@//build_utils/docker:buildx.bzl%configure_buildx",
    "attributes": {
+     "buildx": "@@+buildx+buildx_darwin-arm64//file:downloaded",
      "buildx_platforms": {
        "@@+buildx+buildx_linux-amd64//file:file": "@bazel_tools//src/conditions:linux_x86_64",
        "@@+buildx+buildx_linux-arm64//file:file": "@bazel_tools//src/conditions:linux_aarch64",
        "@@+buildx+buildx_darwin-amd64//file:file": "@bazel_tools//src/conditions:darwin_x86_64",
        "@@+buildx+buildx_darwin-arm64//file:file": "@bazel_tools//src/conditions:darwin_arm64"
      }
    }
  }

This specifies arch_dependent and os_dependent on module_extension to workaround this issue.

@CLAassistant
Copy link

CLAassistant commented Sep 18, 2025

CLA assistant check
All committers have signed the CLA.

@arrdem arrdem merged commit b0447b7 into aspect-build:main Sep 24, 2025
@arrdem
Copy link
Collaborator

arrdem commented Sep 24, 2025

Thanks!

@farcop
Copy link

farcop commented Sep 24, 2025

@pulasthibandara @arrdem Did not fixed for me. I steel have at MODULE.bazel.lock generated on Macos M1

          "buildx_configuration": {
            "repoRuleId": "@@aspect_rules_buildx+//buildx:repositories.bzl%configure_buildx",
            "attributes": {
              "buildx": "@@aspect_rules_buildx++buildx+buildx_darwin-arm64//:buildx"
            }
          },

Using it that way:

archive_override(
    module_name = "aspect_rules_buildx",
    integrity = "sha256-PVRQaniGFgIAiHbjM9fOavMVdY3HJCFHDKzl1+O3g+g=",
    patch_strip = 1,
    patches = ["//hacks/patches:rules_buildx.patch"],
    strip_prefix = "rules_buildx-0.0.1",
    urls = ["https://github.com/aspect-build/rules_buildx/archive/refs/tags/v0.0.1.tar.gz"],
)

@arrdem
Copy link
Collaborator

arrdem commented Sep 24, 2025

@farcop this is your only warning. The above ping is inappropriate as it directly harasses both me and a client. You're dealing with a prerelease ruleset here, and we don't have a support relationship. Demands for maintainer and attention will get you a block. PRs and issues will be considered as time allows. Thank you for your understanding.

@aspect-build aspect-build locked as resolved and limited conversation to collaborators Sep 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants