Gazelle is a Bazel build file generator for Bazel projects. It natively supports Go and protobuf, and it may be extended to support new languages and custom rule sets.
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
macOs, x86_64
What did you do?
I am trying to build a Bazel Golang target in Nix, so I use nixpkgs#buildBazelPackage for that propose.
This Nix builder is separated into two steps:
fetch everything external the project depends on, as a fixed output Nix derivation,
build the artifacts without accessing the network.
What did you expect to see?
I expect the content of /external/bazel_gazelle_go_repository_cache/gocache/* be deterministic.
What did you see instead?
The issue I faced is that the first step always has a different SHA sum, i.e. the fetch step is not deterministic. I dived into a diff of two different artifacts of the same (first) step and found that the content of /external/bazel_gazelle_go_repository_cache/gocache/* is always different. Find the report files attached as diff-report.zip.
For example, the bazel_gazelle_go_repository_cache/gocache/00/003a22947d1e36c02d3d9cade996607c9cbcd222764a20a3699a0b8aef5fff51-a file has different content:
@olebedev I also have this problem with Bazel 6.2.0, the go_sdk 1.19.3 and io_bazel_rules_go 0.39.0 on Windows 10. Do you still have the issue, and did you figure out where the problem is/was?
What version of gazelle are you using?
v0.25.0
What version of rules_go are you using?
v0.29.0
What version of Bazel are you using?
bazel 4.2.2- (@non-git)
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
macOs, x86_64
What did you do?
I am trying to build a Bazel Golang target in Nix, so I use
nixpkgs#buildBazelPackage
for that propose.This Nix builder is separated into two steps:
What did you expect to see?
I expect the content of
/external/bazel_gazelle_go_repository_cache/gocache/*
be deterministic.What did you see instead?
The issue I faced is that the first step always has a different SHA sum, i.e. the fetch step is not deterministic. I dived into a diff of two different artifacts of the same (first) step and found that the content of
/external/bazel_gazelle_go_repository_cache/gocache/*
is always different. Find the report files attached as diff-report.zip.For example, the
bazel_gazelle_go_repository_cache/gocache/00/003a22947d1e36c02d3d9cade996607c9cbcd222764a20a3699a0b8aef5fff51-a
file has different content:and