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

rustup update fails and erroneously mention no https support in curl #1051

Closed
chevdor opened this issue Apr 11, 2017 · 24 comments
Closed

rustup update fails and erroneously mention no https support in curl #1051

chevdor opened this issue Apr 11, 2017 · 24 comments

Comments

@chevdor
Copy link

chevdor commented Apr 11, 2017

$ rustup update
info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/pi/.rustup/tmp/kpgqmw7yym237tou_file'
info: syncing channel updates for 'nightly-armv7-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/home/pi/.rustup/tmp/1g8p1l43ph77ahvz_file'
info: checking for self-updates
error: could not download file from 'https://static.rust-lang.org/rustup/release-stable.toml' to '/tmp/rustup-update.c5REq4ZVU3fY/release-stable.toml'
info: caused by: error during download
info: caused by: [1] Unsupported protocol (Protocol "https" not supported or disabled in libcurl)
=> NOT OK

pi@kilabspi02:~ $ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
6a73d4aa8eccdfe03fdd7ddd84685c8ccba3ca6516db0475197ef40a21686a52  channel-rust-stable.toml
=> OK

pi@kilabspi02:~ $ curl https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256
2762bdca077d5a227a7950d69676956c2ed92f553d6bbe578138c607a4495f2a  channel-rust-nightly.toml
=> OK

pi@kilabspi02:~ $ curl https://static.rust-lang.org/rustup/release-stable.toml
schema-version = '1'
version = '1.2.0'
=> OK

pi@kilabspi02:~ $ curl --version
curl 7.38.0 (arm-unknown-linux-gnueabihf) libcurl/7.38.0 OpenSSL/1.0.1t zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP 
=> curl *does* have https
@malbarbo
Copy link
Contributor

Running this script indicates that rustup-init is broken for more archs:

aarch64-linux-android: Broken
aarch64-unknown-linux-gnu: Broken
arm-linux-androideabi: Broken
arm-unknown-linux-gnueabi: Broken
arm-unknown-linux-gnueabihf: Broken
armv7-linux-androideabi: Broken
armv7-unknown-linux-gnueabihf: Broken
i686-linux-android: Broken
i686-unknown-linux-gnu: Ok
x86_64-unknown-freebsd: Broken
x86_64-unknown-linux-gnu: Ok
x86_64-unknown-netbsd: Broken

@wagenet
Copy link

wagenet commented Apr 12, 2017

Is there a workaround for this?

@jelford
Copy link
Contributor

jelford commented Apr 13, 2017

@wagenet I'm afraid I'm mobile at the moment so cant check this easily, but if you can spare a couple of minutes, would you mind trying with the hyper backend?

To activate Hyper, set the RUSTUP_USE_HYPER environment variable.

I'll try to look into this issue tomorrow if i can get myself up and running on one of the affected platforms. I wonder whether this could have anything to do with the way the build now caches the artefacts for OpenSSL. OpenSSL gets statically linked - at least on Linux platform - so if i understand correctly, the capabilities of local libcurl don't make a difference.

@malbarbo
Copy link
Contributor

malbarbo commented Apr 13, 2017

@jelford You are right, the problem is how the openssl is cached. I proposed a quick and dirt fix in #1054. I think you can propose a better fix.

@jelford
Copy link
Contributor

jelford commented Apr 13, 2017

@malbarbo Ah, perfect, thanks. I think @Diggsey's suggestion on the PR should be okay, so I'll give that a go. I wonder why this doesn't affect the Linux builds.

@malbarbo
Copy link
Contributor

so I'll give that a go

@jelford Great! Please, consider adding a regression test (take a look at my PR).

I wonder why this doesn't affect the Linux builds

This is good question.

@tatsuya6502
Copy link

tatsuya6502 commented Apr 14, 2017

@wagenet

Is there a workaround for this?

I believe this problem is due to a caching problem in Travis builds, not rustup's source codes. I tried to build rustup-init locally and I got a working rustup. I did this for FreeBSD amd64, but this can do the trick for other platforms too.

The original errors

/home/tatsuya% rustup update
info: syncing channel updates for 'stable-x86_64-unknown-freebsd'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/tatsuya/.rustup/tmp/7xy_k91h29lurf1x_file'
...

info: caused by: error during download
info: caused by: [1] Unsupported protocol (Protocol "https" not supported or disabled in libcurl)

Built rustup-init by myself

/home/tatsuya/% git clone git@github.com:rust-lang-nursery/rustup.rs.git
/home/tatsuya/% cd rustup.rs
/home/tatsuya/rustup.rs% cargo build --release

and I got a working rustup

/home/tatsuya/rustup.rs% ./target/release/rustup-init

Welcome to Rust!
...

Current installation options:

   default host triple: x86_64-unknown-freebsd
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation


info: updating existing rustup installation

Rust is installed now. Great!
...

/home/tatsuya/rustup.rs% cd
/home/tatsuya% rustup update
info: syncing channel updates for 'stable-x86_64-unknown-freebsd'
info: syncing channel updates for 'beta-x86_64-unknown-freebsd'
info: syncing channel updates for 'nightly-x86_64-unknown-freebsd'
info: downloading component 'rustc'
...

jelford added a commit to jelford/rustup.rs that referenced this issue Apr 14, 2017
This causes linking failures on most platforms because the
pkg-configs are still pointing to the location specified in
prefix (as they should).

This should address rust-lang#1051 but I'll add a regression test in
the next commit
@korhadris
Copy link

@wagenet @jelford The workaround of setting RUSTUP_USE_HYPER worked for me! I was able to compile my first rust executable!

@ghost
Copy link

ghost commented Apr 15, 2017

hey @korhadris How'd ya do it? Rust newb here :P

@jelford
Copy link
Contributor

jelford commented Apr 15, 2017

@Lorenzoi you should be able to just set RUSTUP_USE_HYPER as an environment variable:

export RUSTUP_USE_HYPER=1
...

...but I haven't been able to verify, so @korhadris might have gone through an extra step.

@tatsuya6502's workaround of downloading the sources and building yourself should work too if you already have a working rust setup, just note that if you want to run it as an "update" rather than init, it will help to give the executable a different name:

cargo build 
mv target/debug/rustup-init target/debug/rustup # or ln if you prefer
target/debug/rustup

The difference in paths to rustup-init between here and @tatsuya6502's answer is because of the --release flag he passed to cargo. You can do that, but your build time will probably be a little quicker without it (and i reckon rustup is a sufficiently un-demanding application that you won't miss the optimisations a debug build skips out).

@ghost
Copy link

ghost commented Apr 15, 2017

ah, thanks!

bors added a commit that referenced this issue Apr 15, 2017
Fix OpenSSL linkage by using the final install-directory in the build

This PR addresses #1051 by avoiding moving OpenSSL's install-target directory after it's been configured. It also encorporates the regression test suggested by @malbarbo on #1054.

It still makes sense to move directories about to avoid getting a partially-built copy of openssl, and I think it makes sense to cache the finished product rather than the src/build directory.

I haven't been able to test the output on one of the affected platforms (although the check on symbols passes) as I don't know a good way to get artefacts out of the travis build.
@aleksmelnikov
Copy link

@tatsuya6502 , thank you.
Today I have compiled rustup from github successful on freebsd11x64.
Now my version rustup is: rustup 1.2.0 (270aaa5 2017-04-08). And 'rustup update' works fine.
So, I have to add openssl package to my system.

@chevdor
Copy link
Author

chevdor commented Apr 20, 2017

Hi,

I tried again today and the whole install fails:

$ curl https://sh.rustup.rs -sSf | sh
sh: 249: [: unknown-linux-gnu: unexpected operator
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust programming 
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin 
directory, located at:

  /home/pi/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile file located at:

  /home/pi/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: armv7-unknown-linux-gnueabihf
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation


info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/pi/.rustup/tmp/ee7vxj071__9nnoj_file'
info: caused by: error during download
info: caused by: [1] Unsupported protocol (Protocol "https" not supported or disabled in libcurl)
$ curl --version
curl 7.38.0 (arm-unknown-linux-gnueabihf) libcurl/7.38.0 OpenSSL/1.0.1t zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP 

@chevdor
Copy link
Author

chevdor commented Apr 20, 2017

@pgerber
Copy link

pgerber commented Apr 20, 2017

@chevdor Looks like #1047. You should be able to use curl https://sh.rustup.rs -sSf | bash as long as you have bash installed.

@chevdor
Copy link
Author

chevdor commented Apr 20, 2017

so far I did:

wget https://static.rust-lang.org/rustup/dist/armv7-unknown-linux-gnueabihf/rustup-init
chmod a+x rustup-init
export RUSTUP_USE_HYPER=1
./rustup-init

and it seems to be working.

Currently compiling but I will try your option later @pgerber

@hsivonen
Copy link
Member

script indicates that rustup-init is broken for more archs

Also broken on big-endian 64-bit PowerPC on Linux. (Not checked by the script.)

nodakai pushed a commit to nodakai/rustup.rs that referenced this issue Apr 23, 2017
This causes linking failures on most platforms because the
pkg-configs are still pointing to the location specified in
prefix (as they should).

This should address rust-lang#1051 but I'll add a regression test in
the next commit
@dpruessner
Copy link

@pgerber Yeah-- piping to bash fixes the comparison error. But the install still fails on armv7 linux (Raspberry Pi 3 / Raspbian).

I added set -x to the command script to dig in; new to Rust and didn't realize the installer was a separate binary at first.

[...]
This path will then be added to your PATH environment variable by modifying the
profile file located at:

  /home/pi/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: armv7-unknown-linux-gnueabihf
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
1

info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/pi/.rustup/tmp/y7mkjirxghdrlbtr_file'
info: caused by: error during download
info: caused by: [1] Unsupported protocol (Protocol "https" not supported or disabled in libcurl)
+ local _retval=1
+ ignore rm /tmp/tmp.WDEUaAQFBC/rustup-init
+ rm /tmp/tmp.WDEUaAQFBC/rustup-init
+ ignore rmdir /tmp/tmp.WDEUaAQFBC
+ rmdir /tmp/tmp.WDEUaAQFBC
+ return 1
+ exit 1
curl -Os https://static.rust-lang.org/rustup/dist/armv7-unknown-linux-gnueabihf/rustup-init
# => ok
pi@raspberrypi ~> curl --version
curl 7.38.0 (arm-unknown-linux-gnueabihf) libcurl/7.38.0 OpenSSL/1.0.1k zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP
pi@raspberrypi ~/rust> ldd rustup-init
        linux-vdso.so.1 (0x7ebe5000)
        /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76b06000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76adf000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x76ac8000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76aa0000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76a73000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76932000)
        /lib/ld-linux-armhf.so.3 (0x54b04000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x768b6000)

Checking for symbols per @malbarbo commeng/gist above:

pi@raspberrypi ~/rust> nm rustup-init |grep -i curl_ssl
001fb3d8 t Curl_ssl_backend
001fb1dc t Curl_ssl_config_matches

@korhadris
Copy link

@dpruessner You also need to export RUSTUP_USE_HYPER=1 There are unfortunately two separate issues going on here.

@onionjake
Copy link

After setting RUSTUP_USE_HYPER=1 I get certificate errors:

[~]$ bash rustup-init -vy
info: downloading installer
warning: $HOME differs from euid-obtained home directory: you may be using sudo
verbose: installing toolchain 'stable-armv7-linux-androideabi'
verbose: toolchain directory: '/data/data/com.termux/files/home/.rustup/toolchains/stable-armv7-linux-androideabi'
info: syncing channel updates for 'stable-armv7-linux-androideabi'
verbose: creating temp file: /data/data/com.termux/files/home/.rustup/tmp/k_p8brri8a5r1wgb_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with hyper + native_tls
verbose: deleted temp file: /data/data/com.termux/files/home/.rustup/tmp/k_p8brri8a5r1wgb_file
verbose: removing toolchain directory: '/data/data/com.termux/files/home/.rustup/toolchains/stable-armv7-linux-androidea
bi'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/data/data/com.termux/files/home/.rustup/tmp/k_p8brri8a5r1wgb_file'
info: caused by: failed to make network request
info: caused by: The OpenSSL library reported an error: The OpenSSL library reported an error: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
info: caused by: The OpenSSL library reported an error: The OpenSSL library reported an error: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
info: caused by: The OpenSSL library reported an error: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
info: caused by: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
[~]$

I imagine I need to point hyper somehow at my system certificates? I have a ca-certificates package already installed.

@malbarbo
Copy link
Contributor

@Diggsey This can be closed now.

@Diggsey
Copy link
Contributor

Diggsey commented May 10, 2017

@malbarbo thanks!

@Diggsey Diggsey closed this as completed May 10, 2017
@JonasVautherin
Copy link

I know this is an old issue, but running the script from macOS Catalina, I get:

% ./find-broken-rustup-init.sh 
aarch64-linux-android: Broken
aarch64-unknown-linux-gnu: Broken
arm-linux-androideabi: Broken
arm-unknown-linux-gnueabi: Broken
arm-unknown-linux-gnueabihf: Broken
armv7-linux-androideabi: Broken
armv7-unknown-linux-gnueabihf: Broken
i686-linux-android: Broken
i686-unknown-linux-gnu: Broken
x86_64-unknown-freebsd: Broken
x86_64-unknown-linux-gnu: Broken
x86_64-unknown-netbsd: Broken

Same if I export RUSTUP_USE_HYPER=1 before calling it. Is it expected? My use-case is that I am trying to compile VLCKit for iOS, and it fails on aarch64 (but apparently not with armv7, for some reason): https://code.videolan.org/videolan/VLCKit/-/issues/437.

@kinnison
Copy link
Contributor

@JonasVautherin If you have an issue like that, please open a fresh report, include the content of that script and any debugging you have, because I do not have access to macos systems.

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

Successfully merging a pull request may close this issue.