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

opam pin + opam install discrepancy: failing to fetch (or cache) build-directory (and hence failing to build) #4484

Closed
chetmurthy opened this issue Dec 23, 2020 · 1 comment · Fixed by #4542
Assignees
Milestone

Comments

@chetmurthy
Copy link

chetmurthy commented Dec 23, 2020

I have some scripts that use opam commands to install/uninstall collections of related packages. In the process of using them, I found a bug in the fetching/caching of build-directories. Here are two scripts: the first produces an error, the second does not. I append first the two scripts, and then the error, and then the output of "opam config report". Also, if I uncomment the last line of DOIT.BAD (which runs the install command a second time), then it works the second time.

I suppose there is something wrong with the way "--working-dir" is working.

DOIT.BAD:

opam remove -y not-ocamlfind
opam pin -y -n add not-ocamlfind https://github.com/chetmurthy/not-ocamlfind.git
(cd not-ocamlfind && opam install -y --working-dir .)
# (cd not-ocamlfind && opam install -y --working-dir .)

DOIT.OK:

opam remove -y not-ocamlfind
opam pin -y -n add not-ocamlfind https://github.com/chetmurthy/not-ocamlfind.git
(cd not-ocamlfind && opam install -y .)

Failed output of DOIT.BAD:

+ opam remove -y not-ocamlfind
The following actions will be performed:
  ⊘ remove not-ocamlfind 0.07.02*

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⊘ removed   not-ocamlfind.0.07.02
Done.
+ opam pin -y -n add not-ocamlfind https://github.com/chetmurthy/not-ocamlfind.git
[NOTE] Package not-ocamlfind is currently pinned to git+file:///home/chet/Hack/Camlp5/src/ALL/not-ocamlfind#master (version 0.07.02).
[not-ocamlfind.0.07.02] synchronised (git+https://github.com/chetmurthy/not-ocamlfind.git)
not-ocamlfind is now pinned to git+https://github.com/chetmurthy/not-ocamlfind.git (version 0.07.02)
+ cd not-ocamlfind
+ opam install -y --working-dir .
[NOTE] Package not-ocamlfind is currently pinned to git+https://github.com/chetmurthy/not-ocamlfind.git (version 0.07.02).
not-ocamlfind is now pinned to git+file:///home/chet/Hack/Camlp5/src/ALL/not-ocamlfind#master (version 0.07.02)
The following actions will be performed:
  ∗ install not-ocamlfind 0.07.02*

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>

#=== ERROR while compiling not-ocamlfind.0.07.02 ==============================#
/home/chet/Hack/Opam-2.1.0/bin/opam: "chdir" failed on /home/chet/Hack/Opam-2.1.0/GENERIC/4.12.0~alpha3/.opam-switch/sources/not-ocamlfind: No such file or directory


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build not-ocamlfind 0.07.02
└─ 
╶─ No changes have been performed

============================================================================

# opam config report
# opam-version         2.1.0~beta3 (0fd7ab6b9fe419177bdd74e30841cfb71584e5c1) 
# self-upgrade         no
# system               arch=x86_64 os=linux os-distribution=ubuntu os-version=20.04
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[hidden-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[hidden-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 7
# repositories         1 (http), 1 (version-controlled) (default repo at 72d9d430)
# pinned               9 (git)
# current-switch       4.12.0~alpha3
# read-state           Not_found
@rjbou rjbou added this to the 2.1.0~beta5 milestone Jan 5, 2021
@rjbou rjbou added the KIND: BUG label Jan 5, 2021
@rjbou
Copy link
Collaborator

rjbou commented Jan 5, 2021

Thanks for the detailed report! I'm able to reproduce easily, I'll take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants