rustup update fails and erroneously mention no https support in curl

Created on 11 Apr 2017  路  24Comments  路  Source: rust-lang/rustup

$ 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

Most helpful comment

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

All 24 comments

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

Is there a workaround for this?

@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.

@jelford You are right, the problem is how the openssl is cached. I proposed a quick and dirt fix in https://github.com/rust-lang-nursery/rustup.rs/pull/1054. I think you can propose a better fix.

@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.

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.

@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 [email protected]: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'
...

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

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

@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).

ah, thanks!

@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.

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 Looks like #1047. You should be able to use curl https://sh.rustup.rs -sSf | bash as long as you have bash installed.

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

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.)

@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

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

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.

@Diggsey This can be closed now.

@malbarbo thanks!

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.

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidawad picture davidawad  路  3Comments

netgusto picture netgusto  路  4Comments

mcandre picture mcandre  路  4Comments

lilred picture lilred  路  3Comments

KasMA1990 picture KasMA1990  路  3Comments