bazel-lib
bazel-lib copied to clipboard
No zstd toolchain provided for Windows - blocks usage of downstream rulesets (e.g. rules_oci) on Windows
I discovered this issue while attempting to adopt the rules_oci package for building container images.
In short, it looks like a Windows toolchain for zstd is not provided by this package, so any downstream rulesets that use zstd compression (such as for image layers) aren't functional on Windows: https://github.com/bazel-contrib/bazel-lib/blob/main/lib/private/zstd_toolchain.bzl#L31-L46
I noticed that the zstd-prebuilt repo doesn't attempt to build zstd for Windows at all: https://github.com/aspect-build/zstd-prebuilt/blob/main/BUILD.bazel#L3-L7
Is this something that could be supported, but there's some sort of blocker to providing that support? I'm just hoping to gain some context around this, enough that I could start poking around and hopefully submit a PR that adds that support.
zstd windows builds are non existent, last time i tried i could not get it to cross compile. We probably need to do something similar to https://github.com/aspect-build/bsdtar-prebuilt/pull/6 in https://github.com/aspect-build/zstd-prebuilt/tree/main
Okay now that i got a decent windows machine, i can look into this.
Okay i was able to build zstd on windows; https://github.com/bazelbuild/bazel-central-registry/pull/3237
PS C:\Users\Sahin\Documents\zstd-prebuilt> bazel-bin/external/zstd~/programs/zstd.exe
stdin is a console, aborting
Cool: i was able to successfully build this on CI: https://github.com/aspect-build/zstd-prebuilt/actions/runs/11961976398/job/33349361591?pr=1#step:3:70
We are also impacted by this on windows
Added a defect in the zstd_prebuilt repo before I spotted this defect (I had forgotten commenting on this 7 months ago!)
https://github.com/aspect-build/zstd-prebuilt/issues/2
Is there any update? @thesayyn?
Fixed by https://github.com/bazel-contrib/bazel-lib/pull/1137
https://github.com/bazel-contrib/bazel-lib/pull/1137