Skip to content

miso is a dependency, locked like the others: not on every project's path - #22

Merged
dmjio merged 1 commit into
mainfrom
miso-locked-dep
Oct 21, 2026
Merged

dmjio merged 1 commit into
mainfrom
miso-locked-dep

Conversation

@dmjio

@dmjio dmjio commented Oct 21, 2026

Copy link
Copy Markdown
Member

Stacked on #21; the base is project-local-deps. Merge #21 first, then retarget this PR to main.

Why

miso shipped among the tool's packages, so every project used whatever miso the tool came with, and miso.lock didn't record it. A new release of the tool silently changed the miso of every existing project.

What changes

  • miso is a dependency. miso new (and miso init) write dependencies: [miso], and miso.lock locks it as a git dependency at a commit of dmjio/miso.
  • - miso means "the miso of this release". That's the flake.lock commit the release was built from; mhs-VERSION/miso-default records the repository, commit, version and flags. It's locked at that commit with no network access. miso install copies the prebuilt package from mhs-VERSION/miso-prebuilt/ when the locked commit and flags match and nothing it was built against has been replaced. Otherwise it builds miso from the source the release ships, without downloading.
  • Upgrading the tool doesn't change a locked project's miso. The lock keeps its commit. miso update moves it to the new release's commit. A project can also use another miso with git:, path: (with the release's flags) or a Hackage version:.
  • Release: scripts/prebuilt-miso.sh takes miso out of the tool's package database, so it's no longer on mhs's path. build-release.sh and flake.nix both run it.
  • Compatibility:
    • A project whose code imports Miso without depending on it gets the release's miso, with a warning that says how to add the dependency.
    • With an older release (no miso-default), miso is among the tool's packages as before.
    • miso doctor checks for the prebuilt miso.

Testing

Run against a local release of this branch (MicroHs 0.16.10.0, x86_64 macOS):

scenario result
new project (browser target, emcc) Installing miso at a3e6937 (1.14.0.0) (built already, as it came with this miso); builds
second new project miso from the store
miso lock miso locked as a git dependency at a3e6937, version 1.14.0.0
project with dependencies: [] that imports Miso builds, with a warning
the tool's default miso changed the locked project keeps a3e6937 (one-time clone of dmjio/miso, since the new tool doesn't ship that source)
scripts/smoke-test.sh passes; it now also checks that a new project depends on miso, installs the prebuilt one, and locks it

Not tested:

  • A miso project that replaces transformers. By design, miso is rebuilt from the shipped source against the replacement, because its store key includes the replacement's ID.
  • The flake.nix change (CI builds it).

@dmjio
dmjio changed the base branch from project-local-deps to main October 21, 2026 02:50
…path

The release took miso among the tool's packages, so every project used
the miso of the tool it was built with, which miso.lock did not record:
a new release of the tool changed the miso of every project.  miso is now
a dependency (miso new writes dependencies: [miso]), locked as a git
dependency at a commit of dmjio/miso.

- miso, with no source of its own, is the miso of the release: the
commit of flake.lock it was built from (mhs-VERSION/miso-default, with
its version and flags), locked at that commit.  miso install copies the
package the release built (mhs-VERSION/miso-prebuilt) when that is the
one locked and built against the tool's packages, and builds it from the
source the release ships otherwise (without a download).  A project keeps
the commit of its miso.lock with a new release; miso update moves it to
the new release's.

scripts/prebuilt-miso.sh takes miso out of the tool's package database
(build-release.sh and flake.nix run it).  A project whose code imports
Miso without depending on miso gets the release's, with a warning; with a
release from before, miso is among the tool's packages as it was.
@dmjio
dmjio merged commit ec94636 into main Oct 21, 2026
6 checks passed
@dmjio
dmjio deleted the miso-locked-dep branch October 21, 2026 04:25
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