- I had a switch called 4.04.2 which I was using to develop a project using qcheck
- The latest qcheck on opam was missing an unreleased feature so I added a pin to its --dev-repo for it
- The unreleased feature was not working properly so I tried to see if I could fix it
- Created a new switch called qcheck-dev with --alias-of 4.04.2 and pinned a checkout of qcheck in it
- Modified qcheck, did opam upgrade qcheck and my experimental fix worked
- Now I wanted to pin the same modified local checkout of qcheck to my 4.04.2 switch
- Opam tells me that qcheck needs to be installed, I press Y
- make install fails because of some file existing in the other qcheck-dev switch
- I removed the qcheck-dev switch but make install keeps failing, again because of missing files in ~/.opam/qcheck-dev. This is after having run
opam switch 4.04.2and the related eval command
Does qcheck use oasis? oasis creates a
setup.data file with links to the version of the compiler it was configured for, and fails to update it automatically. If you pin in path mode (the default), opam will copy this wrong information.
Solutions if that’s the problem:
opam pin -k gitto avoid copying untracked files, or
- stop using oasis
Thanks, after digging around I noticed that setup.data contained many references to the switch where I pinned qcheck initially. Removed setup.data and then was able to make it work.
If you ‘opam pin add qcheck .’, it will use ‘rsync’ to copy ‘.’ to its
build directory. Instead, I always pin in git mode (using ‘opam pin add
-k git qcheck
pwd#HEAD’), which then uses the HEAD of the local git
clone. This means not using any temporary files which are around – but
you have to git commit locally before reinstalling.
I see. Thanks for the suggestion. Might be useful at some point.