ocaml-installer icon indicating copy to clipboard operation
ocaml-installer copied to clipboard

opam install depext fails; poss due to tar given a Windows path

Open sishtiaq opened this issue 8 years ago • 11 comments

  1. Start on a clean Windows 10 machine.
  2. Run the installer as per instructions: I get OCaml in C:\OCaml; I put cygwin64 in C:\cygwin64.
  3. Run 'opam init', OK.
  4. Run 'opam install depext'. The command fails while trying to bunzip2 cmdliner. An 'opam install depext --debug' output attached.

opam-install-depext

Notice that the tar command that unpacks the cmdliner package has a Windows style path. If I type this command (tar xfj c:\cygwin64... ) in a Cygwin shell, it doesn't work (fails with a very similar message of buzip2 complaining that Compressed file ends unexpectedly).

/usr/bin/tar version 1.28; /usr/bin/bunzip2 version 1.0.6.

This is not a reproducible bug. On my Windows 10 laptop, this all runs fine (tar is given a Unix-type path of /home/sishtiaq/.opam/packages.dev/cmdliner.0.9.8/cmdliner-0.9.8.tbz). I would think this is unlikely to be a bug in the ocaml-installer, more likely in opam or Cygwin. But recording here because of the combination of circumstances to get to this bug, Possibly related to Issue #40.

opam-install-depext.txt

sishtiaq avatar Mar 24 '16 11:03 sishtiaq

For the record, the newer readme at https://github.com/protz/ocaml-installer/wiki covers try to catch this case (most likely due to another tar in the path).

msprotz avatar Jun 03 '16 21:06 msprotz

Out of curiousity: which tar should opam be using, then?

sishtiaq avatar Jun 04 '16 08:06 sishtiaq

It seems that the tar that comes with cygwin, not other tar. Thanks @msprotz, I forgot to delete msys2 from path. Now I have another error, I'll trying to figure out myself.

Lambda-term installation fails with:

# install: cannot create regular file ~/.opam/system/bin/lambda-term-actions: File exists

ignacio-gc avatar Jun 04 '16 16:06 ignacio-gc

@sishtiaq: opam should be using the tar from cygwin. @ignaciocaamanio: https://github.com/ocaml/opam/issues/2313

Try manually fixing ~/.opam/system/repositories/default/packages/lambda-term.../files/....install to not install lambda-term-actions twice. I suspect the file is installed once by the Makefile, then a second time by the ....install file, which then fails because of the OPAM issue mentioned above.

msprotz avatar Jun 04 '16 17:06 msprotz

Thanks. After a long time can make it work. In lambda-term.install I delete the two lines where 'lambda-term-actions' occur. Also for utop I have to add .exe to 'utop-full' and 'utop' in utop.install... and had problems with the libs path and utop... I don't know exactly how but eval opam config env was involved... thanks for the help!

ignacio-gc avatar Jun 05 '16 03:06 ignacio-gc

@msprotz That means I can't have a Windows machine with "Git for Windows" on it? (VS recommends installing it!)

sishtiaq avatar Jun 05 '16 09:06 sishtiaq

I think you can,, just don't install cygwin git, use where git to see the path of the git you are using.

Now I try to install merlin and the install script fails with syntax error near unexpected token... ¿Merlin can be installed?

ignacio-gc avatar Jun 05 '16 13:06 ignacio-gc

I realized that the 64-bit version can not be installed merlin... I'll try with 32 bits.

ignacio-gc avatar Jun 06 '16 01:06 ignacio-gc

@sishtiaq good question; I don't use "git for windows", because it basically re-packages an entire linux set of utilities (bash, perl, and a million other files). I'd be interested in knowing if it's feasible to have the two co-exist (maybe with careful precedence of things in PATH?)

@ignaciocaamanio Merlin doesn't work because the patched version of OPAM that I'm using currently has a bug when forking out external shell commands; I have a newer version of OPAM that I can try to send you by email... contact me privately?

msprotz avatar Jun 06 '16 14:06 msprotz

@msprotz Ok, all this was to use merlin and utop in emacs, so if you have a solution great ! How do I contact you ? There is a way in github or I should post my mail ?

ignacio-gc avatar Jun 07 '16 00:06 ignacio-gc

my email address is on my personal website at jonathan.protzenko.fr

msprotz avatar Jun 07 '16 00:06 msprotz