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

Fails to solve deps when there's an unreleased local dependency of a released local package #7

Closed
gridbugs opened this issue Aug 1, 2023 · 1 comment

Comments

@gridbugs
Copy link

gridbugs commented Aug 1, 2023

When you add a new package to a project which is a dependency of an existing package in the project that has been released at least once, and set the version of the dependency to version, and you haven't yet released the new package,opam build fails to solve packages as it tries to find a version of the unreleased package matching the latest released version of the released package.

I've created a branch of my fork of opam-build to demonstrate:

git clone https://github.com/gridbugs/opam-build --branch=repro1
cd opam-build
opam build
...
<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: []
[ERROR] Could not determine which packages to install for this switch:
  * Missing dependency:
    - foo >= 0.1.0
    no matching version


Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] y
opam-build: internal error, uncaught exception:
            OpamStd.OpamSys.Exit(20)

My preference would be that for locally-defined packages opam build should not act differently depending on whether the package is released to the opam repo. When installing without opam build I can work around this problem by running opam pin . --with-version=foo (though I do wish that opam pin also didn't look up local packages in opam repo that that's beside the point).

Also it's unrelated, but the internal error, uncaught exception printed before exiting seems to happen whenever opam build runs an external program that fails to exit successfully.

My OS is NixOS and my opam is version 2.1.5.

@kit-ty-kate
Copy link
Owner

This is now fixed in 6a504e1
The code is quite ugly and it makes everything a bit slower but it should be better whenever ocaml/opam#5855 is fixed.

Also it's unrelated, but the internal error, uncaught exception printed before exiting seems to happen whenever opam build runs an external program that fails to exit successfully.

Fixed in f352085

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

2 participants