Repository navigation
A miso project with a library can be a dependency of another - #30
Merged
Merged
Conversation
A dependency from git: or a path: had to be a Cabal package: one with a miso.yml and a library: section failed with "has no .cabal file". So a library made with miso could be used only in its own project. miso cabal now prints the .cabal file of the library of the miso.yml here: name, version, synopsis, author; the exposed modules (or every module under source-dirs), its dependencies by name (the top-level list and the library's), mhs-options, and the C and JavaScript files, include dirs and headers, cpp/cc/ld options and extra-libraries. MicroCabal builds and installs a library from those fields. A dependency with a miso.yml and no .cabal file is copied to $MISO_HOME/src/cabalized/NAME-KEY (without .git/, .miso/, dist/, public/, vendor/), with that .cabal file next to it, and the copy is what is read for its dependencies and built; the checkout itself is not changed. The copy is made again each time, so a change to a path: dependency is built (its key in the store still comes from its own files). The dependency's name in miso.yml has to be the project's. Its own git: or path: dependencies are an error that says to list them in the project that uses it. Checked: - miso cabal on a library with two modules, cbits/, include/, cpp-options and extra-libraries; MicroCabal parses the result; a project with no library: section, and one whose library needs a git dependency, give errors that say why - with a test program: the copy has the library's files and the .cabal file, not .git/ or dist/, and the original folder is unchanged; a dependency named otherwise than its project is an error; a Cabal package is used as it is; a change to the source is in the next copy - the smoke test now builds and runs a project that depends on a miso library (which needs split) by path:, then changes the library and checks the change is picked up, and that no .cabal file was written into the library's folder
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.
The gap: a dependency from
git:orpath:had to be a Cabal package. A miso project with alibrary:section failed with "has no .cabal file", so a library made with miso could only be used inside its own project.What this adds:
miso cabal(new command) prints the.cabalfile for the library in the current folder'smiso.yml:exposed-modules, or every module undersource-dirs);mhs-options, C and JavaScript files, include dirs and headers,cpp/cc/ldoptions andextra-libraries. MicroCabal builds and installs a library from these fields.miso.ymland no.cabalfile is copied to$MISO_HOME/src/cabalized/NAME-KEY, without.git/,.miso/,dist/,public/orvendor/. The.cabalfile goes next to the copy, and the copy is what's read and built.path:dependency is picked up.library:, a dependency whosename:differs from its project's, and a library that itself needs agit:orpath:dependency (not supported yet: list it in the project that uses it).Checked:
miso cabalon a library with two modules,cbits/,include/,cpp-optionsandextra-libraries; MicroCabal parses the result. Both error cases say why..cabalfile, but not.git/ordist/;path:on a miso library that itself needssplit, and runs. Then the library is changed and the change is picked up, and no.cabalfile is written into the library's folder. This runs on every platform in CI.Note: this and #31 (
extra-libraries) both add a case at the end ofscripts/smoke-test.sh. Whichever merges second will need a one-line conflict resolved.Generated by Claude Code