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

Make MODULE.bazel.lock file have the same contents no matter the platform bazel is executed on #3815

Closed
leungster opened this issue Jan 5, 2024 · 6 comments

Comments

@leungster
Copy link

What version of rules_go are you using?

0.44.1

What version of gazelle are you using?

0.35.0

What version of Bazel are you using?

Bazel 7.0.0

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

OSX ARM and Linux x86

What did you do?

I'm running into a similar issue as bazelbuild/bazel#19154 where developers are building on a mix of osx x86 and arm64 processors, while our CI is using Linux x86.
When our project is built on each platform, the MODULE.bazel.lock extensions are only update for the host platform. e.g. We get an entry such as the following

    "@@rules_go~0.44.1//go:extensions.bzl%go_sdk": {
      "os:osx,arch:aarch64": {

Since we're trying to keep the lockfile in version control, it's not possible to keep this up to date across all the build environments.
It looks like rules_python has a similar issue..

What did you expect to see?

MODULE.bazel.lock is the same regardless of which platform we're running bazel.

What did you see instead?

The lock file is different based on the host platform.

@fmeum
Copy link
Member

fmeum commented Jan 6, 2024

This is on my radar, but I plan to solve it by excluding the go_sdk extension from the lock file altogether. It is fully deterministic and essentially static, so it doesn't gain much from being locked. This requires a Bazel design doc that I'm planning to draft soon.

For the meantime I don't have a good solution: We do have to record the "platform -> SDK" mapping for Gazelle and that may involve querying the host platform.

@stefanpenner
Copy link
Contributor

@fmeum nice, great to hear this is on your radar. When that bazel design doc is up, please do link it here I would love to give it a read.

@stefanpenner
Copy link
Contributor

@fmeum
Copy link
Member

fmeum commented May 23, 2024

This should be fixed with latest rules_go and Bazel 7.1.2. Please give it a try.

Edit: https://docs.google.com/document/d/1TjA7-M5njkI1F38IC0pm305S9EOmxcUwaCIvaSmansg/edit

@leungster
Copy link
Author

I can confirm it's fixed with the latest rules_go and Bazel 7.1.2.

It still persists with rules_python and pip but that's captured in another issue.

@stefanpenner
Copy link
Contributor

Yup this seems fixed for us as well. I’ll keep an eye out, and report if we notice anything

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

No branches or pull requests

3 participants