Skip to content

Different bzlmod lock digest on different host platforms #110

@jwnrt

Description

@jwnrt

When using bzlmod on two slightly different host platforms (Ubuntu with glibc 2.39 and Debian with glibc 2.40), the usageDigest hash of @platforms//host:extension.bzl%host_platform changes:

--- a/MODULE.bazel.lock
+++ b/MODULE.bazel.lock
@@ -92,7 +95,7 @@
     "@@platforms//host:extension.bzl%host_platform": {
       "general": {
         "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=",
-        "usagesDigest": "meSzxn3DUCcYEhq4HQwExWkWtU4EjriRBQLsZN+Q0SU=",
+        "usagesDigest": "pCYpDQmqMbmiiPI1p2Kd3VLm5T48rRAht5WdW0X2GlA=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},
         "envVariables": {},

This is an issue when the lockfile is checked into the repo.

From some investigation, it seems that module extensions must set the use_os and use_arch parameters if they are dependent on the OS or architecture:

bazelbuild/bazel@2f032d4

I believe this applies to host_platform too since its behaviour changes based on the OS. Should these parameters be set, or am I misunderstanding?

Apologies for the lack of minimal reproduction, this is quite difficult to test.

EDIT: I see these params were renamed to os_dependent and arch_dependent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions