Skip to content

Fail loudly when existing manifest entries cannot be read - #807

Open
thomashoneyman wants to merge 1 commit into
masterfrom
fix/manifest-index-read-errors
Open

thomashoneyman wants to merge 1 commit into
masterfrom
fix/manifest-index-read-errors

Conversation

@thomashoneyman

@thomashoneyman thomashoneyman commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Noticed that inserting a manifest treats a failure to parse the existing entry as if the file were empty. This can discard previously published versions when adding a new one. I noticed this specifically in the harmonia package, where it had (somehow) at some point had a description that was too long, which got deleted in an update due to this bug, but since we've since then upped the description limit it was possible for me to restore 0.1.0 as-is to the registry index. (It was fully published everywhere, it was just missing in the metadata).

At the root, readEntryFile didn't distinguish a missing entry from an invalid one, but now it does:

  • Right Nothing: no entry exists.
  • Right (Just manifests): the entry was read and parsed.
  • Left error: reading or parsing failed, with the entry path included.

This does break readEntryFile which is consumed by Spago in src/Spago/Registry.purs in the getManifestFromIndexImpl function, so when that pin updates it would have to be updated. The current pin is OK.

@thomashoneyman
thomashoneyman force-pushed the fix/manifest-index-read-errors branch from 07a3b70 to 2893d8b Compare October 14, 2026 19:32
Comment thread lib/src/ManifestIndex.purs Outdated
@thomashoneyman
thomashoneyman force-pushed the fix/manifest-index-read-errors branch from 2893d8b to ae16d87 Compare October 14, 2026 20:10
@f-f
f-f force-pushed the fix/manifest-index-read-errors branch from ae16d87 to af39b17 Compare October 18, 2026 23:05

This branch has not been deployed

No deployments
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