ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.24k stars 353 forks source link

installation blues... #3506

Closed houndofsound closed 6 years ago

houndofsound commented 6 years ago

so from a fresh install: progman@farm:~$ opam init Checking for available remotes: rsync and local, git.

[ERROR] Initialisation failed OpamGlobals.Exit(66)

why does it want ocaml right now?
so I take a shot at giving it a version...

progman@farm:~$ opam init --comp=4.07 Checking for available remotes: rsync and local, git.

[WARNING] Recommended external solver aspcud not found.

=-=- Fetching repository information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [default] synchronized from https://opam.ocaml.org Cannot find /home/farmerc/.opam/compilers/4.07/4.07/4.07.comp: 4.07 is not a valid compiler name. [ERROR] Initialisation failed OpamGlobals.Exit(1) farmerc@cfarm:~$ opam init --comp=4.07 Checking for available remotes: rsync and local, git.

[WARNING] Recommended external solver aspcud not found.

=-=- Fetching repository information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [default] synchronized from https://opam.ocaml.org Cannot find /home/farmerc/.opam/compilers/4.07/4.07/4.07.comp: 4.07 is not a valid compiler name. [ERROR] Initialisation failed OpamGlobals.Exit(1)

luckily I am familiar with the EXACT versioning of ocaml rather than a complete NUBE ....

farmerc@cfarm:~$ opam init --comp=4.07.0 Checking for available remotes: rsync and local, git.

[WARNING] Recommended external solver aspcud not found.

=-=- Fetching repository information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [default] synchronized from https://opam.ocaml.org

=-=- Installing compiler 4.07.0 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [compiler.get] https://github.com/ocaml/ocaml/archive/4.07.0.tar.gz downloaded Now compiling OCaml. This may take a while, please bear with us... [ERROR] Compiler build failed at "make install":

opam-version 1.2.2

    # os           linux
    # command      make install
    # path         /home/farmerc/.opam/4.07.0/build/ocaml
    # exit-code    2
    # env-file     /home/farmerc/.opam/log/log-23032-8330f2.env
    # stdout-file  /home/farmerc/.opam/log/log-23032-8330f2.out
    # stderr-file  /home/farmerc/.opam/log/log-23032-8330f2.err
    ### stdout ###
    # do \
    # [...]
    #     install -m u=rwx,g=rwx,o=rx "$i.opt" "/home/farmerc/.opam/4.07.0/bin/$i.opt" && \
    #     (cd "/home/farmerc/.opam/4.07.0/bin/" && ln -sf "$i.opt" "$i"); \
    #   else \
    #     (cd "/home/farmerc/.opam/4.07.0/bin/" && ln -sf "$i.byte" "$i"); \
    #   fi; \
    # done
    # Makefile:234: recipe for target 'install' failed
    # make[1]: Leaving directory '/home/farmerc/.opam/4.07.0/build/ocaml/tools'
    # Makefile:600: recipe for target 'install' failed

[ERROR] Initialisation failed OpamGlobals.Exit(66)


I don't know yet why it failed - the logs it purported to supply were gone.
I re-ran the command ... and it started the download of ocaml all over again.
not a virtuous loop.
must it insist on installing ocaml  (just a switch, no?) as part of its installation?

[rjbou] edit formatting
dbuenzli commented 6 years ago

Do you have . in you PATH by any chance ? If that's the case I suggest you remove it.

houndofsound commented 6 years ago

does the edit button work on this site? have tried 3 different browsers now!

dra27 commented 6 years ago

This would be somewhat better asked on Discuss. OPAM 1.x has always needed ocaml at init to set up the system switch and compilers are always referred to by full version number. You could try out opam 2. You could also try 4.06.1 instead of 4.07.0 - by the look of it, the new installation mechanism is failing.

houndofsound commented 6 years ago

. NIMBY .

dra27 commented 6 years ago

(crossed posts - I agree Daniel’s diagnosis of the install problem is most likely)

houndofsound commented 6 years ago

I thought I was installing v2 ...

dra27 commented 6 years ago

NIMBY?

houndofsound commented 6 years ago

no, no dot in my path

dbuenzli commented 6 years ago

Could you please give the result of executing

 opam config report && env

in your shell.

houndofsound commented 6 years ago

so the reason it requires ocaml on install is because .... it was always like that. great! I post here because this is an issue that new users can be stonewalled by.

dbuenzli commented 6 years ago

It's a little bit difficult to follow you. How did you install opam in the first place ?

houndofsound commented 6 years ago

I went to the install page on opam.ocaml.org and it didn't mention being version 1.2.2 I will go find 2.0.0 ....

dbuenzli commented 6 years ago

Also note that you don't have an external solver installer, if you are using 1.2.2 this won't work on the current state of the opam-repository. Either install opam v2 or install an external solver like apscud.

dra27 commented 6 years ago

@houndofsound wrote:

. NIMBY .

No, Discuss is my backyard too. At the moment, you have problems with OPAM, not OPAM necessarily having problems itself - Discuss gives a wider audience for solving that. Issue trackers are then better when actual issues have been identified. It's also just possible that you've hit an issue with OCaml 4.07.0, which obviously won't ultimately want to be reported here.

so the reason it requires ocaml on install is because .... it was always like that. great!

That's not what I wrote though, is it. I noted that it has always been like that because I happen to know you're not a new user, so assumed that you just hadn't run opam init in a while (which is reasonable) and had forgotten - i.e. that you weren't reporting something new.

I post here because this is an issue that new users can be stonewalled by.

That's noble, and obviously helpful, but you hadn't actually said that prior to that comment...

An OPAM 1.2.2 installation without the external solver is going to pretty useless (and is noted on the installation page, FWIW), as @dbuenzli notes - so more information on exactly how you installed really is necessary to move forwards.

houndofsound commented 6 years ago

yes, you qualified the 'always' with relating to 1.2.2. my mistake - I assumed I was dealing with v2.

as mentioned I subsequently went looking for v2 when dbuenzli prompted running opam config....

as 1.2.2 is what's offered through the front door of opam.ocaml.org, my observations on the install are valid.

the lack of solver is a red herring - I'm having problems with the initial install.

the v2 init still insists on doing an ocaml install but while failing left behind something I could run a 'switch create' on - see below.

the latest:

# bwrap: Can't mkdir /home/progman/.opam/4.07.0: No such file or directory

I moved .opam elsewhere for lack of space and linked to it and am able to create/delete in there. but looks like bwrap doesn't like soft links.

houndofsound commented 6 years ago

my NIMBY was in relation to the dot in path question!

AltGr commented 6 years ago

I moved .opam elsewhere for lack of space and linked to it and am able to create/delete in there. but looks like bwrap doesn't like soft links.

can you try defining OPAMROOT to point to the target of the link? That would help debug if this is really a symlink issue or something else. Thanks!

houndofsound commented 6 years ago

after going to v2 I got errors on both 4.06.1 and 4.07.0 switch creation mentioning a missing file within the ocaml source - didn't look right so I went to the source under .opam and compiled it directly no problem. so I gave up and with original 'out of space' error garnered, installed v1.2.2 instead as this was meant to be a 5min jobby to run a script on a new machine.

I will go back in a while and redo the installs to both versions and document them. I will answer your question here and put the v2 error (if it happens again) over on Discuss.

rjbou commented 6 years ago

@houndofsound Closing this issue ftm, feel free to reopen if new information.