Skip to content

Remove version-forcing and use 0.cabal whenever it exists#119

Merged
neilmayhew merged 4 commits intomainfrom
nm/remove-force-version
Feb 20, 2026
Merged

Remove version-forcing and use 0.cabal whenever it exists#119
neilmayhew merged 4 commits intomainfrom
nm/remove-force-version

Conversation

@neilmayhew
Copy link
Copy Markdown
Contributor

See #118 for the suggestion

This makes available the functionality that was previously used on the
fly when a package version is forced. Now, it should be done ahead of
time and stored along with the metadata in the git repo, to ensure
future reproducability.
@neilmayhew neilmayhew requested a review from angerman February 18, 2026 04:44
@neilmayhew
Copy link
Copy Markdown
Contributor Author

cc @andreabedini

@neilmayhew neilmayhew marked this pull request as draft February 18, 2026 05:05
@neilmayhew
Copy link
Copy Markdown
Contributor Author

neilmayhew commented Feb 18, 2026

This doesn't seem to be working quite right yet

@neilmayhew neilmayhew marked this pull request as ready for review February 18, 2026 05:19
@angerman angerman requested a review from Copilot February 19, 2026 04:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the metadata-driven “force version” mechanism and instead standardizes on using a stored revisions/0.cabal file whenever it exists, plus adds a CLI command to rewrite a Cabal file’s version.

Changes:

  • Remove force-version from meta.toml schema and downstream data flow/metadata output.
  • In source preparation, copy revisions/0.cabal into the extracted source tree when present.
  • Add foliage rewrite-version VERSION FILE command and remove the old UpdateCabalFile module.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
foliage.cabal Wire in new CmdRewriteVersion module; drop removed UpdateCabalFile.
app/Main.hs Route new RewriteVersion command to its handler.
app/Foliage/UpdateCabalFile.hs Delete old Cabal rewriting helper module.
app/Foliage/PrepareSource.hs Copy revisions/0.cabal into the source tree when available; remove force-version gating.
app/Foliage/PreparePackageVersion.hs Remove pkgVersionForce from prepared package representation.
app/Foliage/Options.hs Add rewrite-version subcommand and Command constructor.
app/Foliage/Meta.hs Remove force-version field from PackageVersionSpec and TOML codec.
app/Foliage/CmdRewriteVersion.hs New implementation for rewriting a Cabal file’s version from CLI input.
app/Foliage/CmdImportIndex.hs Stop emitting packageVersionForce in imported metadata.
app/Foliage/CmdBuild.hs Stop emitting forced-version metadata field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@neilmayhew
Copy link
Copy Markdown
Contributor Author

I didn't deprecate use of the force-revision field. If present, it will simply be ignored. However, we can remove all uses of it from cardano-haskell-packages and update the add-revision script not to insert it, so it's very unlikely that it will ever be present in future.

@neilmayhew
Copy link
Copy Markdown
Contributor Author

I took out the forced-version field from foliage/packages.json in the built repo. As far as I can see, it wasn't being used for anything. We could have inferred it by comparing the upstream cabal file and the revision-0 one, but that seems like overkill for something we aren't using anyway.

neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Feb 20, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Feb 20, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Feb 20, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
@neilmayhew neilmayhew merged commit 94644ae into main Feb 20, 2026
3 checks passed
@neilmayhew neilmayhew deleted the nm/remove-force-version branch February 20, 2026 05:02
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Feb 20, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
angerman pushed a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Mar 9, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Mar 9, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Mar 9, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Mar 9, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Mar 10, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Mar 11, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Mar 20, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
neilmayhew added a commit to IntersectMBO/cardano-haskell-packages that referenced this pull request Mar 20, 2026
This brings in input-output-hk/foliage#119 which drops the
`force-version` field and uses only the presence of a revision-0 cabal
file to determine whether the upstream cabal file needs to be
overwritten.
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.

3 participants