aspect-build / aspect-cli

correct, fast, usable: choose three
https://aspect.build/cli
Apache License 2.0
97 stars 24 forks source link

[FR]: Add windows support for CLI versions > 5.5.0 #598

Open RobertDiebels opened 11 months ago

RobertDiebels commented 11 months ago

What is the current behavior?

According to the docs: "Windows releases are no longer published as of v5.5.0. This is due to a new dependency on go-tree-sitter which has a CGO dependency that makes cross compiling to Windows difficult."

Describe the feature

I would like to have Windows support for Aspect CLI. I'm trying to build the most recent version of rules_ts and it fails due to a dependency on Aspect CLI.

I've looked in the treesitter-go repository, but there is no open issue that mentions cross-compilation failure. I realize that this an upstream issue, but if you could at least file an issue with them detailing the issue then they can have a look at it.

alexeagle commented 8 months ago

Yeah, this is a problem, we haven't had time to dig into it. A bug bounty would be helpful here, since we don't have many Bazel users on Windows asking for it.

RobertDiebels commented 7 months ago

@alexeagle Is there anything I can do to move this along? I'm willing and able to create a PR, I just need a nudge into the right direction, which might undercut the need for funding.

alexeagle commented 7 months ago

Sure, the hard part is cross-compiling the Go binary including cgo dependencies. Without that we could try some GHA release automation changes to build the exe on a Windows runner, though process changes are harder to contribute

RobertDiebels commented 7 months ago

@alexeagle Does Aspect cross-compile the Go binary? Or is this done elsewhere? Could you point me to where this occurs so I can take a look at it?

alexeagle commented 7 months ago

You can build the //release package, see https://github.com/aspect-build/aspect-cli/blob/main/release/release.bzl#L38

RobertDiebels commented 7 months ago

@alexeagle Awesome thank you, do you think it would be worth trying to swap out the llvm toolchain for the zig-based hermetic_cc_toolchain from Uber?

Zig isn't as battle-tested as LLVM, but their compiler has CC as a first-class use case and they released version 0.12.0 2 days ago.

I'd like to check with you before I attempt to swap out LLVM to make sure you'd be willing to adopt zig (either partially just for windows, or fully for all binaries) as not to waste time/effort in an attempt.

alexeagle commented 7 months ago

This repo is synced with our internal monorepo so changing the toolchain is likely breaking for something else, and so this is an area where it's hard for us to accept external contribution. All things equal I think I'm more comfortable relying on GHA windows machines for releases rather than more complexity in our Bazel toolchain. @gregmagolan WDYT?

albertocavalcante commented 5 months ago

Hey, just wondering if there's been further discussion on this. I'd like to test Aspect CLI in an environment where my Windows machine does not have WSL2 enabled. I will give it a try on RHEL Linux but anyway Windows would still be desired hence my ask. Thanks.

RobertDiebels commented 5 months ago

Hey, just wondering if there's been further discussion on this. I'd like to test Aspect CLI in an environment where my Windows machine does not have WSL2 enabled. I will give it a try on RHEL Linux but anyway Windows would still be desired hence my ask. Thanks.

@albertocavalcante

I don't know if there has been any internal discussion, but you could try to swap out the cross-compilation tool chain currently used. I've recently found out that the zig-based toolchain I mention above is already being used when I ran into another issue .

I'd attempt to do it myself. Unfortunately I will be on holiday soon and don't have time to spare leading up to it.

mattem commented 5 months ago

We have an internal diff to transition to Zig, which will if it lands, will be exported here. + @mrmeku for visibility.

mrmeku commented 5 months ago

I've been playing with swapping in the zig toolchain and I've run into compatibility issues with compiling tree sitter. I'm unfortunately out of my depth and need a C++ build oriented developer to proceed further

alexeagle commented 5 months ago

Nope, no discussion or work on this since we don't have any paying customers asking for it. PRs welcome! Maybe this is easy to do by adding a windows CD runner on GHA.