Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0.0 on Windows #714

Open
lexspoon opened this issue Oct 11, 2024 · 6 comments
Open

v2.0.0 on Windows #714

lexspoon opened this issue Oct 11, 2024 · 6 comments

Comments

@lexspoon
Copy link
Contributor

I'm running into two problems trying to use rules_oci 2.0.0 on Windows.

  1. It fails to download bsdtar, receiving a 404 code. This can be fixed by upgrading aspect_bazel_lib.
  2. It fails to access zstd. It's pulling zstd out of aspect_bazel_lib, but that module doesn't support Windows for zstd.

A workaround for zstd would be appreciated if anyone has one. As things stand, I can't upgrade due to this problem on Windows, and I can't use the previous version due to a problem with MacOS (#509).

As an idea for a workaround, would it be possible for me to register a zstd toolchain in my own build files? I see that Meta provides an exe for Windows. It's in a zip file, but it seems like sufficient Bazel-fu should be able to turn that into a toolchain. It's beyond me, though.

For a real fix:

  • Can zstd be optional? If you publish a 2.0.1 with optional zstd, that would allow me to upgrade on Windows.
  • Perhaps use the official zstd module from Facebook? I don't know the trade offs, but it seems odd for rules_oci to pull in zstd from aspect_bazel_lib.
@thesayyn
Copy link
Collaborator

thesayyn commented Oct 15, 2024

Perhaps use the official zstd module from Facebook? I don't know the trade offs, but it seems odd for rules_oci to pull in zstd from aspect_bazel_lib.

facebook/zstd does not publish prebuilt binaries which we need for rules_oci to work fast. Building it from source is not an option for us as building from source breaks eventually due to differences in cc toolchains.

https://github.com/facebook/zstd/releases/tag/v1.5.6

What we do instead, is to build it from source with every release and publish it to github releases ourselves, see here https://github.com/aspect-build/zstd-prebuilt/releases

@thesayyn
Copy link
Collaborator

thesayyn commented Oct 15, 2024

Can zstd be optional? If you publish a 2.0.1 with optional zstd, that would allow me to upgrade on Windows.

No, zstd is required for rules_oci to work

@lexspoon
Copy link
Contributor Author

I understand these things about how it currently works and was looking for ways to repair the Windows support. I agree about the advantages of the pre-built binaries, although there are also clearly downsides, as this ticket shows.

Using the local CC is certainly a very common option with Bazel, so most users ought to have a working CC. There are 215 modules that depend on rules_cc!

https://registry.bazel.build/modules/rules_cc/0.0.9

@thesayyn
Copy link
Collaborator

Sorry, we have seen build-from-source fail miserably countless times it's simply not an option. If it's something we add support here the. prebuilt binaries are required, and build from source is a nice to have.

If you you'd like to workaround this, you can simply add dependency on zstd from BCR and register the windows toolchain from your workspace.

@sluongng
Copy link

may be I am missing something here but isn't the windows prebuilt binaries included in https://github.com/facebook/zstd/releases/tag/v1.5.6 as zstd-v1.5.6-win32.zip and zstd-v1.5.6-win64.zip? 🤔

@peakschris
Copy link

peakschris commented Dec 19, 2024

I'm also impacted by this, cannot upgrade beyond 1.8.0 on windows due to missing zstd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants