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

Show symlinks to compilers in zigup list #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dweiller
Copy link
Contributor

@dweiller dweiller commented Jul 23, 2024

This PR makes zigup list include symlinks to compilers in the install directory display in the list of installed compilers. This is useful as it is possible to use these symlinks as the COMPILER_NAME in zigup default COMPILER_NAME. Currently the only symlink created by zigup is one for master, but this PR would also support a user who wants to make custom symlinks to name particular compilers.

This feature will be particularly helpful if/when mach nominated versions are supported (see #145), as all of the nominated versions should be referenced via a link.

@marler8997
Copy link
Owner

marler8997 commented Sep 23, 2024

I'm not sure exactly how to get into this state that's newly being handled here but it seems like a reasonable feature, would you mind adding a test for this in test.zig?

P.S. This might be helpful and/or a way to implement #135 ?

@dweiller
Copy link
Contributor Author

dweiller commented Sep 24, 2024

To help with an implementation of #135, the logic would want to be a bit different than what is currently implemented. At the moment I have (conservatively) chosen to not list links that resolve to paths outside the installation directory. For #135 (and maybe in general) we would want to list any symlink to a directory. This is simpler to do than the current implementation and allows for more use cases like #135 or linking to a local build of zig.

would you mind adding a test for this in test.zig?

Will do.

@dweiller
Copy link
Contributor Author

I've simplified the logic as mentioned above. It looks like windows is handling the symlinks in an odd way (or at least unexpected to me) that will need some investigation.

@marler8997
Copy link
Owner

Looks like windows is failing, I think there's a way to test if symlinks are supported you could use to disable the test in that case?

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.

2 participants