Skip to content

Conversation

@fourlexboehm
Copy link

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

This adds a check to ~/.config/anyzig/config.zig.zon, or correct platform path
to set a default version when none is specified
@marler8997
Copy link
Owner

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 zig15 symlink that points to a particular one, or create/add a new directory to PATH with a new zig symlink to a particular version.

Or another idea, I have been wanting to add a subcommand that returns the "executable path", something like zig any exepath, maybe with an optional version argument? If this existed you could use that to add it to your PATH so that running zig will then always resolve to that version in that environment, i.e.

PATH=$(dirname($(zig any exepath 0.15.2)):$PATH zig ...

I'm not familiar with the cargo zigbuild issue, can you expand on that?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants