Skip to content

Conversation

@mrdomino
Copy link

I asked Claude to fix #27 and Claude produced this. It seems reasonable to me, and does appear to fix the issue. Rather than only watching the cli on the platform that we are currently using, this watches the cli on all possible platform settings.

Closes #27

Fixes issue mrmeku#27 where MODULE.bazel.lock would differ between Linux and
macOS due to platform-specific CLI binary watching.

Root cause: The code was only watching the current platform's CLI binary
(e.g., cli-x86_64-unknown-linux-musl on Linux or cli-arm64-apple-darwin
on macOS), causing the lockfile to record different file inputs depending
on which platform ran 'bazel mod deps'.

Solution: Watch all platform-specific CLI binaries instead of just the
current platform's binary. This ensures MODULE.bazel.lock records all
four binaries consistently across platforms.

This approach is necessary because:
- The CLI binaries are checked into source control
- They need to be watched to detect when they're updated
- All platforms must watch the same set of files for lockfile consistency
- A platform-independent marker file doesn't exist yet

Changes:
- Added get_all_cli_paths() to util.bzl to return all CLI binary paths
- Updated extensions.bzl to watch all CLI paths in module extension
- Updated repositories.bzl to watch all CLI paths in repository rules
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

Successfully merging this pull request may close these issues.

MODULE.bazel.lock disagrees between linux and macos

2 participants