Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistyped fields should trigger an error during opam update instead of being ignored at install time #6350

Open
kit-ty-kate opened this issue Jan 6, 2025 · 0 comments

Comments

@kit-ty-kate
Copy link
Member

$ cat packages/test/test.1/opam
opam-version: "2.0"
extra-files: "does-not-exist"
pin-depends: "does-not-exist"
substs: [["does-not-exist"]]
$ opam update tmp

<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
[tmp] synchronised from file:///tmp/tmp
$ opam reinstall test
[ERROR] In the opam file for test.1:
          - At /home/kit_ty_kate/.opam/repo/tmp/packages/test/test.1/opam:4:9-4:27::
            expected file
          - At /home/kit_ty_kate/.opam/repo/tmp/packages/test/test.1/opam:3:0-3:29::
            expected [versioned package URL]
          - At /home/kit_ty_kate/.opam/repo/tmp/packages/test/test.1/opam:2:0-2:29::
            expected [file checksum]
        'substs', 'pin-depends', 'extra-files' have been ignored.
The following actions will be performed:
=== recompile 1 package
  ↻ test 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⊘ removed   test.1
∗ installed test.1
Done.

In this example extra-files, pin-depends and substs are mistyped but this is not shown in any way during opam update which does parse that package, and is only shown as an "error" (but ignored) on install.
In my opinion this should be at least the very least shown during opam update, if not a fatal error entirely, as well as being an fatal error on install. I'm not sure to understand the reasoning behind this behaviour, since if opam were to change the way some fields are typed, then this should be part of a opam-version bump which would then be incompatible with the version being parsed (and unavailable since 2.3.0 / #5665)

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

No branches or pull requests

1 participant