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

Cannot compile gnutls (ftp problem) #32147

Closed
tobiasBora opened this issue Nov 28, 2017 · 6 comments
Closed

Cannot compile gnutls (ftp problem) #32147

tobiasBora opened this issue Nov 28, 2017 · 6 comments

Comments

@tobiasBora
Copy link
Contributor

tobiasBora commented Nov 28, 2017

Issue description

Hello,

Nix downloads the gnutls sources using ftp (I guess that it's the only way to bootstrap TLS). However, curl cannot download this ftp files, while wget has no problem at all. Because of that gnutls cannot be installed, and my raspberry installation is quite useless.

Steps to reproduce

Try to install gnutls, or a program that need gnutls on a system that do not have binary for it (like my raspberry). It will fail with a timeout during the downloading of the file ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-3.5.15.tar.xz. The problem seems to be that curl cannot download this ftp file (while wget success... why ?).

$ curl ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-3.5.15.tar.xz -O out.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:20 --:--:--     0^C


$ wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-3.5.15.tar.xz
--2017-11-28 19:31:21--  ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-3.5.15.tar.xz
           => « gnutls-3.5.15.tar.xz.4 »
Résolution de ftp.gnutls.org (ftp.gnutls.org)… 217.69.76.55
Connexion à ftp.gnutls.org (ftp.gnutls.org)|217.69.76.55|:21… connecté.
Ouverture de session en tant que anonymous… Session établie.
==> SYST ... terminé.    ==> PWD ... terminé.
==> TYPE I ... terminé.  ==> CWD (1) /gcrypt/gnutls/v3.5 ... terminé.
==> SIZE gnutls-3.5.15.tar.xz ... 7238928
==> PASV ... terminé.    ==> RETR gnutls-3.5.15.tar.xz ... terminé.
Taille : 7238928 (6,9M) (non certifiée)

gnutls-3.5.15.tar.xz.4                100%[======================================================================>]   6,90M  2,26MB/s    ds 3,1s    

2017-11-28 19:31:24 (2,26 MB/s) - « gnutls-3.5.15.tar.xz.4 » sauvegardé [7238928]

Technical details

 - system: `"armv6l-linux"`
 - host os: `Linux 4.9.41, NixOS, 18.03.git.66b63d2f5a (Impala)`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 1.11.15`
 - channels(root): `"nixos-18.03.git.66b63d2f5a"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`

@vcunat
Copy link
Member

vcunat commented Nov 28, 2017

Ah, right, I had already contacted the site administrator. As a fallback, I suppose we can switch to http(s) URLs.

@vcunat
Copy link
Member

vcunat commented Nov 28, 2017

As a quick workaround, run

nix-prefetch-url http://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.15.tar.xz

and then resume whatever nix operations you wanted.

@tobiasBora
Copy link
Contributor Author

Thank you very much for the workaround !

And I don't know if it can help, but I tried to debug it, and I found where is the "problem". Here are the commands that curl send (you can try them using telnet ftp.gnutls.org ftp):

USER anonymous
PASS ftp@example.com
PWD
CWD gcrypt
CWD gnutls
CWD v3.5
PASV

And nothing happened after PASV. BUT, if you add a single command PWD before the PASV, it works great:

USER anonymous
PASS ftp@example.com
PWD
CWD gcrypt
CWD gnutls
CWD v3.5
PWD
PASV

vcunat added a commit that referenced this issue Nov 28, 2017
ftp.gnutls.org stopped working with curl; it's not clear yet why.

(cherry picked from commit e0368f5)
@vcunat vcunat closed this as completed in e0368f5 Nov 28, 2017
@tobiasBora
Copy link
Contributor Author

Just a question, let us imagine that a website just have ftp, then nix-prefetch-urlwon't work. Can I manually download the file, and add it somehow in the archive files ?

@vcunat
Copy link
Member

vcunat commented Nov 28, 2017

(1) it does work with ftp:// normally for me; (2) you can use file://.

@tobiasBora
Copy link
Contributor Author

Ok thanks. I tried to speak with people from curl in IRC:

interesting. I just tried, and it works with --ftp-method nocwd and --ftp-method singlecwd, but not withmulticwd, which IIRC is there because not having that breaks some servers...

Maybe it can help somehow to get a working version, but it may be possible that it break other servers... No idea if it's possible to choose this option only for this specific package.

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

No branches or pull requests

2 participants