fix 'ghcup install ghc ghc-8.10.2'
This seems to behave weird. It splits ghc-8.10.2
into arch triple ghc
and 8.10.2
, but then discards the triple.
It seems some users of the code already use it that way: https://github.com/cdornan/hs/blob/2fd6cb9ba4f94a715f9b6255b2af6ba1fb2ab58a/src/HS/Managers/Ghcup.hs#L31
Theoretically, we need to respect the arch triple even for ghcup install
, because the user might run something like this:
ghcup install ghc -u https://foo.downloads.org/ghc.tar.gz armv7-unknown-linux-gnueabihf-8.10.2
Where the bindist is a proper stage1 cross bindist.
So:
- for non-custom bindists, reject or ignore triple form (because we don't provide cross compiler bindists)
- for custom bindists, allow the triple to fall through
It appears there could be several bugs in the cross toolchain handling. This code hasn't been tested well.
Edited by Julian Ospald