Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

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

Open
nehz opened this issue Feb 24, 2016 · 15 comments
Open

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

nehz opened this issue Feb 24, 2016 · 15 comments

Comments

@nehz
Copy link

nehz commented Feb 24, 2016

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 nehz changed the title opam does not install packages due to colon opam does not install packages due to colon in path Feb 24, 2016
@nehz nehz changed the title opam does not install packages due to colon in path opam does not install packages due to colon in path (64 bit) Feb 24, 2016
@msprotz
Copy link
Collaborator

msprotz commented Feb 24, 2016

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

@nehz
Copy link
Author

nehz commented Feb 24, 2016

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

@msprotz
Copy link
Collaborator

msprotz commented Feb 24, 2016

but are you not in a cygwin shell?

@nehz
Copy link
Author

nehz commented Feb 24, 2016

yes in a cygwin shell sorry
32-bit is ok

@msprotz
Copy link
Collaborator

msprotz commented Feb 24, 2016

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

@nehz
Copy link
Author

nehz commented Feb 25, 2016

Ops... I meant opam install ocamlfind

$ which tar
/usr/bin/tar

@ignacio-gc
Copy link

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

@msprotz
Copy link
Collaborator

msprotz commented May 20, 2016

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

@ignacio-gc
Copy link

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

@ghost
Copy link

ghost commented Mar 9, 2017

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 !

@msprotz
Copy link
Collaborator

msprotz commented Mar 9, 2017

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

@ghost
Copy link

ghost commented Mar 9, 2017

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

@msprotz
Copy link
Collaborator

msprotz commented Mar 9, 2017

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

@ghost
Copy link

ghost commented Mar 10, 2017

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 :/

@TrakJohnson
Copy link

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 ?

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

No branches or pull requests

4 participants