Closed hauserx closed 3 months ago
0.46.0
0.35.0
6.4
Linux & Windows
Build anything with rules_go.
Each GoToolchainBinaryBuild execution leaves 2 entries like /tmp/tmp.CGmiYEaaeP/ under linux. Those correspond to throwaway cache created by mktemp -d that is never cleaned up: https://github.com/bazelbuild/rules_go/blob/d45e218910fbecb00867e3a4dde3fe14d4a1e00a/go/private/rules/binary.bzl#L462
GoToolchainBinaryBuild
/tmp/tmp.CGmiYEaaeP/
mktemp -d
Under Windows the same rule uses declare_directory to create space for cache and returns the declared directory from the rule, what causes uploading temporary gocache entries to remote cache and subsequent downloads. https://github.com/bazelbuild/rules_go/blob/d45e218910fbecb00867e3a4dde3fe14d4a1e00a/go/private/rules/binary.bzl#L440
declare_directory
Cache contains ~500 files / 50MB, which are not really problematic numbers as those action usually do not execute often (maybe other than in CI), but still those temporary files should be cleaned up.
That assessment looks entirely correct.
Would you be interested in submitting a PR to fix one or both issues? Happy to review it!
What version of rules_go are you using?
0.46.0
What version of gazelle are you using?
0.35.0
What version of Bazel are you using?
6.4
What operating system and processor architecture are you using?
Linux & Windows
What did you do?
Build anything with rules_go.
What did you see instead?
Each
GoToolchainBinaryBuild
execution leaves 2 entries like/tmp/tmp.CGmiYEaaeP/
under linux. Those correspond to throwaway cache created bymktemp -d
that is never cleaned up: https://github.com/bazelbuild/rules_go/blob/d45e218910fbecb00867e3a4dde3fe14d4a1e00a/go/private/rules/binary.bzl#L462Under Windows the same rule uses
declare_directory
to create space for cache and returns the declared directory from the rule, what causes uploading temporary gocache entries to remote cache and subsequent downloads. https://github.com/bazelbuild/rules_go/blob/d45e218910fbecb00867e3a4dde3fe14d4a1e00a/go/private/rules/binary.bzl#L440Cache contains ~500 files / 50MB, which are not really problematic numbers as those action usually do not execute often (maybe other than in CI), but still those temporary files should be cleaned up.