bazelbuild / rules_jvm_external

Bazel rules to resolve, fetch and export Maven artifacts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lock file differs between `bzlmod` and workspace-based runs

shs96c opened this issue · comments

For most projects, this isn't a problem, but for library projects (such as rules_jvm_external) which may be used by root projects that might use either approach, not having stable keys causes problems. The __INPUTS_ARTIFACTS_HASH and __RESOLVED_ARTIFACTS_HASH need to remain constant.

To see the problem, clone master then:

REPIN=1 bazel run --noenable_bzlmod @unpinned_rules_jvm_external_deps//:pin 
git commit -am 'Without bzlmod'
REPIN=1 bazel run @unpinned_rules_jvm_external_deps//:pin
git status

You should see no changes.

This may be a false alarm. The problem is that the regression_testing repo has a dependency which resolves differently depending on the platform the resolution is run on.

Still, I want to investigate a little further before closing this issue.

This is a false alarm. We just need to be extremely careful with how we declare the inputs to the lock files. As long as they are exactly the same, everything seems to be fine.