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

"Providing" GHC, cabal-install etc. #1

Open
amesgen opened this issue Jul 14, 2021 · 6 comments
Open

"Providing" GHC, cabal-install etc. #1

amesgen opened this issue Jul 14, 2021 · 6 comments

Comments

@amesgen
Copy link
Owner

amesgen commented Jul 14, 2021

@samhh wrote:

Is there any interest in saying that this package "provides" Cabal, GHC, etc? Though they're not installed by default, I'd like to say that my Haskell packages require Cabal without forcing users to install cabal-install (given how Arch traditionally handles Haskell dependencies).

@amesgen
Copy link
Owner Author

amesgen commented Jul 14, 2021

That would be very similar to how rustup does it. We would have to add symlinks to /usr/bin for this to work (compare this), but right now, I think you would have to reimplement the logic ghcup uses to look for its binaries (respect GHCUP_INSTALL_BASE_PREFIX/GHCUP_USE_XDG_DIRS/XDG_BIN_HOME).

I am definitely open to do this, but it would probably a good idea to expose this logic upstream. Maybe related to https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/173

@hasufell
Copy link

I'm not really sure what the full use case is. Do you want a system-wide ghcup installation? I think creating wrapper scripts in /usr/bin that interact with user files is rather odd.

But you can indeed do a system-wide installation by pointing GHCUP_INSTALL_BASE_PREFIX to something like /var/lib/ and then symlink there. But how you manage permissions and installations etc, I'm not sure.

@amesgen
Copy link
Owner Author

amesgen commented Jul 14, 2021

I think creating wrapper scripts in /usr/bin that interact with user files is rather odd.

For reference, this is exactly what the ArchLinux-packaged rustup does: rustup provides rust, cargo, rustfmt etc. (which also exist as there own packages, where the files are system-owned), and has symlinks in /usr/bin to the default toolchain variants of the local rustup installation in ~/.rustup.

So I don't think it would be too contrived to do sth similiar for ghcup, but I don't have a strong opinion here.

@hasufell
Copy link

Yeah, the upcoming ghcup whereis is probably going to be useful for this case. I'm also trying to make this subcommand as performant as possible, so that it has very low overhead, which would be important if someone uses it in a ghc wrapper script: https://gitlab.haskell.org/haskell/ghcup-hs/-/merge_requests/119

@georgefst
Copy link

Is this a good idea? Given the rate of breaking changes in the Haskell ecosystem, it seems quite important that packages get to depend on the versions of GHC and Cabal that they're expecting.

I personally like to keep a separation between using GHCUP for development, and using Pacman for installing executables which just happen to be built in Haskell (Pandoc, HLint...). The two toolchains never interact.

Anyway, I'm no expert in packaging and may be missing something. If Rust does it, then presumably it can't be that bad.

@hasufell
Copy link

You can now use a ghc wrapper script, such as /usr/bin/ghc-8.10.7:

#!/bin/sh

exec ghcup run --ghc 8.10.7 ghc -- "$@"

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

No branches or pull requests

3 participants