aspect-cli icon indicating copy to clipboard operation
aspect-cli copied to clipboard

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

Open RobertDiebels opened this issue 1 year ago • 12 comments

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.

RobertDiebels avatar Jan 05 '24 12:01 RobertDiebels

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.

alexeagle avatar Mar 27 '24 20:03 alexeagle

@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.

RobertDiebels avatar Apr 17 '24 15:04 RobertDiebels

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

alexeagle avatar Apr 17 '24 15:04 alexeagle

@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?

RobertDiebels avatar Apr 22 '24 10:04 RobertDiebels

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

alexeagle avatar Apr 22 '24 14:04 alexeagle

@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.

RobertDiebels avatar Apr 22 '24 17:04 RobertDiebels

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?

alexeagle avatar Apr 22 '24 18:04 alexeagle

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 avatar Jun 19 '24 20:06 albertocavalcante

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.

RobertDiebels avatar Jun 20 '24 10:06 RobertDiebels

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

mattem avatar Jun 21 '24 15:06 mattem

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

mrmeku avatar Jun 21 '24 16:06 mrmeku

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.

alexeagle avatar Jun 22 '24 19:06 alexeagle