Repository navigation
Conversation
mhsNameVers asks the compiler for its version by running
mhs --numeric-version. That command was built with mhsOut, the helper
used for compiler invocations, which prepends -a'PATH' when mcabal was
started with -a (a package database other than ~/.mcabal). The probe
then became
mhs -a'PATH' --numeric-version
and mhs only accepts --numeric-version as its sole argument, so it fails
with
mhs: uncaught exception: error: Unknown flag: --numeric-version
mhsNameVers is reached through getMhsDir, which is used when installing
a library, so 'mcabal -aPATH install' failed for every package with a
library. Using -a is needed e.g. when mhs is installed read-only by a
package manager (nix) and packages have to go into a writable database.
The package path has no bearing on the compiler version, so run the
probe as a plain mhs --numeric-version (through cmdOut with the compiler
executable), the same way mhsBackend already does at startup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tldr;
mcabal -a<dir> installfails for any package with a library because the version probe inmhsNameVersbecomesmhs -a'<dir>' --numeric-version, whichmhsrejects; this change executes a plainmhs --numeric-version, the same formmhsBackendalready uses at startup.This change will require a follow-up PR to regen MicroCabal in MicroHs.
mhsNameVersasks the compiler for its version by runningmhs --numeric-version. That command was built withmhsOut, the helper used for compiler invocations, which prepends-a'PATH'whenmcabalwas started with-a(a package database other than~/.mcabal). The probe then becameand
mhsonly accepts--numeric-versionas its sole argument, so it fails withmhsNameVersis reached throughgetMhsDir, which is used when installing a library, so'mcabal -aPATH install'failed for every package with a library. Using-ais needed e.g. whenmhsis installed read-only by a package manager (nix) and packages have to go into a writable database.The package path has no bearing on the compiler version, so run the probe as a plain
mhs --numeric-version(throughcmdOutwith the compiler executable), the same waymhsBackendalready does at startup.