-
Notifications
You must be signed in to change notification settings - Fork 73
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
whereis with no version tries the recommended, rather than active version #988
Comments
This is by design. You're proposing a different design. But are you aware that you can have no GHC version set at all? What does it do then? Also fail? I agree it might be slightly more intuitive for it to return the set version, but it's a breaking change. How do we migrate? It can break scripts, CIs etc. |
On Mon, Jan 22, 2024 at 07:56:50PM -0800, Julian Ospald wrote:
This is by design. You're proposing a different design. But are you aware that you can have **no GHC version set at all**? What does it do then? Also fail?
I agree it might be slightly more intuitive for it to return the **set** version, but it's a breaking change.
How do we migrate? It can break scripts, CIs etc.
Ah, was unaware this was the design.
Yes, I'd expect a *distinct* failure mode if there is no GHC version set.
After all, we're querying the current system state -- if people are using the
empty version to test whether the recommended version is installed at all, I'd
expect them to use `ghcup list -t ghc -c installed | grep recommended` or
somesuch.
Could we at least teach `whereis` a new version `default` evaluating to the set
version? That way, at least the semantics I'd intuited are expressible. And
that'd also make available the usual three-release deprecation cycle: warn that
`whereis` without a version is deprecated, then either pull the feature or
replace the semantics with `whereis $tool default`.
Or I guess we could gate `default-whereis-version` behind a config option.
|
Finding the set version is pretty easy via: ghcup whereis bindir
$(ghcup whereis bindir)/ghc --version |
On Thu, Jan 25, 2024 at 11:28:17PM -0800, Julian Ospald wrote:
> Could we at least teach `whereis` a new version `default` evaluating to the set version?
Finding the *set* version is pretty easy via:
```sh
ghcup whereis bindir
$(ghcup whereis bindir)/ghc --version
```
Fair enough. Would be worth documenting somewhere, though -- this doesn't appear
neither in the user guide or the `ghcup whereis` usage -- especially since, as
you agreed, the current behaviour is unintuitive.
|
Running
ghcup whereis ghc
behaves likeghcup whereis recommended
.In particular, if one is on a system where the recommended
ghc
version is not installed (even if the "active ghc" is set appropriately usingghcup set ghc
to an existing version), this spuriously givesGHCup-00130
errors.The text was updated successfully, but these errors were encountered: