Skip to content

Install Cabal registrations for base and the packages it bundles - #577

Merged
augustss merged 1 commit into
augustss:masterfrom
ulysses4ever:cabal-registrations
Nov 18, 2026
Merged

augustss merged 1 commit into
augustss:masterfrom
ulysses4ever:cabal-registrations

Conversation

@ulysses4ever

Copy link
Copy Markdown
Contributor

This is item 1 of #572: make minstall now writes Cabal registration files for base and for the packages whose modules base bundles, next to the installed packages in ~/.mcabal/mhs-<version>:

  • base-<version>.conf: base at 4.19.1.0 with the modules it does not bundle, and with id and key base-<version>, so tools still find packages/base-<version>.pkg;
  • one file each for bytestring, deepseq, directory, hashable, integer-logarithms, process, stm and text, with their modules, depending on base and without a package file of their own.

The table is in Tools/Install.hs. The versions are those of MicroCabal's builtinPackages, except hashable at 1.4.7.0: Data.Hashable has the API of the 1.4 series, and packages that use it ask for that. The modules come from generated/base.pkg, read with readSerialized as mhs -L does.

With these files, cabal (haskell/cabal#11392) can read what base stands for instead of keeping its own table: with that table switched off, a package that needs base >= 4.18, bytestring, text, deepseq, stm, directory and process builds and runs, and without the files it fails in the solver. MicroCabal could read them as well. mhs itself ignores them.

I have not regenerated generated/install.c.

Tested on Linux with make minstall into a scratch directory: all nine files parse with Cabal's parser, and the installed mhs builds programs as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_0176vAefrw8jPKXdh9h1wKuj

Packages from Hackage depend on base-4.x, and on bytestring, text, etc.,
whose modules are part of the base of mhs.  MicroCabal knows this from
its builtinPackages table, and cabal (haskell/cabal#11392) keeps a copy
of the same table.  Instead, the installer now writes Cabal registration
files next to the installed packages: base at 4.19.1.0, with the modules
it does not bundle, and each bundled package with its modules, depending
on base and without a package file of its own.  Tools can read these
instead of keeping a table, and the registrations change along with base.

The versions are those of MicroCabal, except for hashable: Data.Hashable
has the API of the 1.4 series, and the packages that use it ask for that.

generated/install.c is left for the next regen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0176vAefrw8jPKXdh9h1wKuj
@augustss
augustss merged commit 73d55e2 into augustss:master Nov 18, 2026
13 checks passed
ulysses4ever added a commit to haskell/cabal that referenced this pull request Nov 19, 2026
Since 0.17.1.0 (augustss/MicroHs#577), the installer of mhs writes Cabal
registration files for its base, at a GHC-era version, and for the
packages whose modules base bundles. Read them like any other
registration, and drop the table from which Cabal presented base in the
same way itself: what base stands for is now up to mhs. Also look up the
package file of a registration by its key, which is what mhs names its
base after.

An older mhs has no registrations, and its base, at the version of mhs,
satisfies no package from Hackage. Cabal warns about it.

CI installs MicroHs at a commit after augustss/MicroHs#577, as 0.17.1.0
is not released yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0176vAefrw8jPKXdh9h1wKuj
ulysses4ever added a commit to ulysses4ever/cabal-mhs-testsuite that referenced this pull request Nov 19, 2026
The commits of the PR are live on haskell/cabal#11392, so build its head
rather than the old head plus the patches, which are kept for runs
started by hand. MicroHs is checked out after augustss/MicroHs#577, which
writes the registrations of base that the PR now reads, until 0.17.1.0 is
released.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0176vAefrw8jPKXdh9h1wKuj
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.

2 participants