Skip to content

run the mhs version probe without the package path flag - #39

Open
dmjio wants to merge 1 commit into
augustss:mainfrom
haskell-miso:numeric-version-without-package-path
Open

dmjio wants to merge 1 commit into
augustss:mainfrom
haskell-miso:numeric-version-without-package-path

Conversation

@dmjio

@dmjio dmjio commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

tldr;

mcabal -a<dir> install fails for any package with a library because the version probe in mhsNameVers becomes mhs -a'<dir>' --numeric-version, which mhs rejects; this change executes a plain mhs --numeric-version, the same form mhsBackend already uses at startup.

This change will require a follow-up PR to regen MicroCabal in MicroHs.


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.

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.
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.

1 participant