bazel-lib icon indicating copy to clipboard operation
bazel-lib copied to clipboard

No zstd toolchain provided for Windows - blocks usage of downstream rulesets (e.g. rules_oci) on Windows

Open jasonbdly opened this issue 1 year ago • 5 comments

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.

jasonbdly avatar Oct 14 '24 03:10 jasonbdly

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

thesayyn avatar Oct 15 '24 18:10 thesayyn

Okay now that i got a decent windows machine, i can look into this.

thesayyn avatar Nov 20 '24 18:11 thesayyn

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

thesayyn avatar Nov 21 '24 20:11 thesayyn

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

thesayyn avatar Nov 21 '24 21:11 thesayyn

We are also impacted by this on windows

peakschris avatar Dec 19 '24 01:12 peakschris

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?

peakschris avatar Jul 09 '25 21:07 peakschris

Fixed by https://github.com/bazel-contrib/bazel-lib/pull/1137

peakschris avatar Aug 15 '25 12:08 peakschris

https://github.com/bazel-contrib/bazel-lib/pull/1137

thesayyn avatar Aug 15 '25 18:08 thesayyn