Add support for default zig version#71
Add support for default zig version#71fourlexboehm wants to merge 1 commit intomarler8997:masterfrom
Conversation
This adds a check to ~/.config/anyzig/config.zig.zon, or correct platform path to set a default version when none is specified
|
When I first made anyzig I was planning on adding this feature, however, after using it I've since realized that not having a way to set a default encourages projects to be explicit and always keep their version up-to-date by making use of "strategic friction". There are still many ways to cause zig to point to an explicit version, but they have "more friction". For example you could add the versioned directory to your PATH, or create a Or another idea, I have been wanting to add a subcommand that returns the "executable path", something like I'm not familiar with the cargo zigbuild issue, can you expand on that? |
|
cargo zigbuild is a tool for cross compiling Rust projects, it's especially useful in cargo lambda, for deploying AWS lambda Rust functions across environments. It just needs a zig compiler for the cross compilation to work, the version isn't super important as it's not relying on the zig language features, just the C ABI cross compilation. I considered creating a PR for cargo zigbuild to support anyzig, which I think would be the best way to go about it if a default version is an explicit non goal of this project. I'd rather avoid path shenanigans so the two projects can work ok by default. One work around is to initialise a zig project inside the Rust project dir. |
This adds a check to ~/.config/anyzig/config.zig.zon, or correct platform path to set a default version when none is specified
This is necessary to use anyzig as a normal zig, for tools like cargo zigbuild.
Inspired by a suggestion in #62