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

opam does not install packages due to colon in path (64 bit)

Open nehz opened this issue 9 years ago • 15 comments

With 64-bit package: Error when tar during opam install:

# tar (child): Cannot connect to C: resolve failed
#
# gzip: stdin: unexpected end of file
# tar: Child returned status 128
# tar: Error is not recoverable: exiting now

nehz avatar Feb 24 '16 08:02 nehz

hmm I'm confused can you give more information, i.e. the command you were running

msprotz avatar Feb 24 '16 14:02 msprotz

any opam install *

so for example opam install opamfind

Basically tar is treating C:\... as a web address in the unpacking step of opam install

nehz avatar Feb 24 '16 14:02 nehz

but are you not in a cygwin shell?

msprotz avatar Feb 24 '16 15:02 msprotz

yes in a cygwin shell sorry 32-bit is ok

nehz avatar Feb 24 '16 22:02 nehz

which tar command is that?

can you do which tar?

also:

protz@Joprotze-Z420:~/Code/mitls-fstar (master) $ opam install opamfind
[ERROR] No package named opamfind foun

msprotz avatar Feb 24 '16 22:02 msprotz

Ops... I meant opam install ocamlfind

$ which tar
/usr/bin/tar

nehz avatar Feb 25 '16 01:02 nehz

I'm trying to use opam in msys2, opam init works, opam install not:

### stderr ###
# tar (child): Cannot connect to C: resolve failed
#
# gzip: stdin: unexpected end of file
# tar: Child returned status 128
# tar: Error is not recoverable: exiting now

ignacio-gc avatar May 20 '16 03:05 ignacio-gc

I don't think the combination of opam + msys2 is supported...

msprotz avatar May 20 '16 12:05 msprotz

Yes, I read that. Now I try with cygwin following all the instructions and the same problem with "ocamlfind" occurs.

ignacio-gc avatar May 22 '16 06:05 ignacio-gc

Hi !

I got the same problem. With "opam install ocp-indent"

#=== ERROR while compiling ocamlfind.1.5.6 ====================================#
# opam-version 1.3.0~dev2 (d4f7e01216dbb44af4e7cc6539a1b0afa9be9d2c)
# os           win32
# command      tar xfz C:\Users\Me\.opam\packages.dev\ocamlfind.1.5.6\findlib-1.5.6.tar.gz -C C:\Users\Me\AppData\Local\Temp\opam-8476-4bcc67
# path         C:\Users\Me\.opam\packages.dev\ocamlfind.1.5.6
# exit-code    2
# env-file     C:\Users\Me\.opam\log\log-8476-ccabea.env
# stdout-file  C:\Users\Me\.opam\log\log-8476-ccabea.out
# stderr-file  C:\Users\Me\.opam\log\log-8476-ccabea.err
### stderr ###
# tar (child): Cannot connect to C: resolve failed
#
# gzip: stdin: unexpected end of file
# tar: Child returned status 128
# tar: Error is not recoverable: exiting now

I'm on Windows 10, 64 bits and I work with Cmder on cmd.exe

Here's my tar :

λ which tar
/usr/bin/tar

and my version of Opam :

λ opam --version
1.3.0~dev2

Do someone have any idea of what to do ?

Thanks in advance !

ghost avatar Mar 09 '17 19:03 ghost

I'm not sure what cmder is but you're expected to kick-start opam via a cygwin prompt, right?

msprotz avatar Mar 09 '17 19:03 msprotz

Kick-start ? You mean "opam init" ? And I don't have Cygwin, because I use Cmder. And Cmder is a prompt which is more ergonomic and more aesthetic than the windows prompt. Plus I can open multiple prompts and have bash or powershell on it. It can also allow me the Linux basics commands like "ls" or so. Here's the website if you want : http://cmder.net/ Maybe my error come from this software

ghost avatar Mar 09 '17 19:03 ghost

Cygwin is a hard requirement, and the opam as distributed is known to work only when launched from a cygwin terminal.

msprotz avatar Mar 09 '17 21:03 msprotz

Are you sure ? Opam seems to work okay on Cmder. When I try to install my package, Opam work great until he reaches this command. So it seems that it's more the command that it has a problem :/

ghost avatar Mar 10 '17 09:03 ghost

I'm experiencing the same issue as @TheHaricover, and after some research got to the following conclusion.

What seems to happen is that while installing the package, opam uses the tar command on an absolute path (i.e. tar -xfz C:\Emacs\.opam\packages.dev\result.1.2\1.2.tar.gz), and the presence of a colon : makes tar think that the file is online (because it thinks the absolute path is a hostname), and of course fails to get it.

# tar (child): Cannot connect to C: resolve failed
#
# gzip: stdin: unexpected end of file
# tar: Child returned status 128
# tar: Error is not recoverable: exiting now

As specified here, using the --force-local argument on the tar command fixes it; however I have yet to find a way how to make opam use this flag each time its unzipping.

So the final question is: How can I pass arguments to the tar command that opam executes upon download ?

TrakJohnson avatar Apr 20 '17 18:04 TrakJohnson