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

Warn if num installed to a broken system compiler #11300

Merged
merged 1 commit into from Mar 24, 2018

Conversation

Projects
None yet
5 participants
@dra27
Copy link
Contributor

commented Jan 24, 2018

This follows on from #11207.

If the num library was installed in a system switch where the user had write permissions to the system compiler's lib directory before #11207 was merged, then fresh installations of the ocamlfind package will detect this "system" installation of num and create a META file for it.

This in turn will cause the num package installation to fail. Annoyingly, this failure only appears once because opam then executes ocamlfind remove num so a subsequent attempt to install the num package will appear to have worked (however, in reality the system-installed files will conflict with the ones in the opam directory).

This patch displays a comprehensive error message the first time, strongly suggesting that the user manually delete the files which were incorrectly installed previously.

If you have a system compiler where num has been manually installed to ocamlc -where (e.g. by running sudo make install from the GitHub sources) and a fresh installation of the ocamlfind package, then you will now see the following if you attempt to install the num package:

dra@zesty64:~/num/src$ opam install num
The following actions will be performed:
  ∗  install num 1.1 

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[num.1.1] found in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The installation of num failed at "make findlib-install".
Processing  2/2: [num: make findlib-uninstall]
#=== ERROR while installing num.1.1 ===========================================#
# context      2.0.0~beta6 | linux/x86_64 | ocaml-system.4.06.0 | file:///home/dra/opam-repository
# path         ~/.opam/temp/.opam-switch/build/num.1.1
# command      /usr/bin/make findlib-install
# exit-code    2
# env-file     ~/.opam/log/num-21717-a00279.env
# output-file  ~/.opam/log/num-21717-a00279.out
### output ###
# [ERROR] It appears that the num library was previously installed to your system
#         compiler's lib directory, probably by a faulty opam package.
#         You will need to remove arith_flags.*, arith_status.*, big_int.*,
#         int_misc.*, nat.*, num.*, ratio.*, nums.*, libnums.* and
#         stublibs/dllnums.* from /usr/local/lib/ocaml.
# Makefile:46: recipe for target 'findlib-install' failed
# make: *** [findlib-install] Error 1



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
┌─ The following actions failed
│ ∗  install num 1.1
└─ 
╶─ No changes have been performed

cc @avsm

Warn if num installed to a broken system compiler
If the num library was installed in a system switch where the user had
write permissions to the system compiler's lib directory before #11207
was merged, then *fresh* installations of the ocamlfind package will
detect this "system" installation of num and create a META file for it.
This in turn will cause the num package installation to fail.
Annoyingly, this failure only appears once because opam then executes
ocamlfind remove num so a subsequent attempt to install the num package
will appear to have worked.

This patch displays a comprehensive error message the first time,
strongly suggesting that the user manually delete the files which were
incorrectly installed previously.
@samoht

This comment has been minimized.

Copy link
Member

commented Feb 15, 2018

I haven't followed the discussion on this issue so I'll let an other maintainer merge this PR.

@dra27

This comment has been minimized.

Copy link
Contributor Author

commented Feb 15, 2018

@samoht - are you able to kick the DataKit CI and Camelus?

@samoht

This comment has been minimized.

Copy link
Member

commented Feb 15, 2018

I've restarted the Datakit CI runs, but I don't control Camelus. /cc @AltGr to see if he can do something about it :-)

@AltGr

This comment has been minimized.

Copy link
Member

commented Feb 15, 2018

Kicked it, but a "Could not complete" error is probably reproducible...
(NB: you need to go to config→webhooks→opam-ci, find the corresponding request and replay it)

@camelus

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2018

All lint checks passed eba59ad
  • These packages passed lint tests: num.1.0, num.1.1

Installability check (8230 → 8230)
@kit-ty-kate

This comment has been minimized.

Copy link
Contributor

commented Mar 24, 2018

Sorry for the long delay. Thanks !

@kit-ty-kate kit-ty-kate merged commit 26a110c into ocaml:master Mar 24, 2018

8 of 15 checks passed

ci/datakit/2 V2.0 Revdeps revdep:num.1.0, revdep:num.1.1 failed
Details
ci/datakit/2 arm64 V2.0 Revdeps revdep:num.1.0, revdep:num.1.1 failed
Details
ci/datakit/4 V1.2 Common Distros Alpine 3.6 failed
Details
ci/datakit/4 V2.0 Common Distros Alpine 3.6 failed
Details
ci/datakit/4 arm64 V2.0 Common Distros Alpine 3.6 failed
Details
ci/datakit/5 V1.2 All Distros depfail
Details
ci/datakit/5 V2.0 All Distros depfail
Details
camelus All tests passed
ci/datakit/1 V1.2 Build V1.2 Build
Details
ci/datakit/1 V2.0 Build V2.0 Build
Details
ci/datakit/1 arm64 V2.0 Build V2.0 Build
Details
ci/datakit/3 V1.2 Compilers V1.2 Compilers
Details
ci/datakit/3 V2.0 Compilers V2.0 Compilers
Details
ci/datakit/3 arm64 V2.0 Compilers V2.0 Compilers
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.