Opened 5 years ago

Closed 2 years ago

#58848 closed defect (fixed)

rust @1.36.0: error: Unknown option

Reported by: dmitriz (Dmitri Zaitsev) Owned by: g5pw (Aljaž Srebrnič)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: rust

Description

➜  ~ sudo port install rust
Password:
--->  Computing dependencies for rust
--->  Building rust
Error: Failed to build rust: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port rust failed

Attachments (3)

log3 (209.7 KB) - added by dmitriz (Dmitri Zaitsev) 5 years ago.
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log
log4 (457.6 KB) - added by dmitriz (Dmitri Zaitsev) 5 years ago.
opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log
log51 (77.6 KB) - added by dmitriz (Dmitri Zaitsev) 5 years ago.
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log

Download all attachments as: .zip

Change History (22)

Changed 5 years ago by dmitriz (Dmitri Zaitsev)

Attachment: log3 added

/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log

comment:1 Changed 5 years ago by cjones051073 (Chris Jones)

Your machine is having problems connecting to various http addresses. This is largely because of the out of date OS you are running, 10.8, and the out of date SSL support it has.

notice:fetch --->  Attempting to fetch rustc-1.36.0-src.tar.gz from https://static.rust-lang.org/dist
22	:debug:fetch Fetching distfile failed: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

You either need to patch your system to have up to date SSL support, or just update your OS to something a bit more recent.

comment:2 Changed 5 years ago by dmitriz (Dmitri Zaitsev)

Thank you, any help how to patch the SSL? Any port I need to install?

comment:3 Changed 5 years ago by dmitriz (Dmitri Zaitsev)

It seems my openssl is recent:

~ openssl version
OpenSSL 1.0.2s  28 May 2019

But maybe it is not used by the system? Is there any way to check?

comment:4 Changed 5 years ago by dmitriz (Dmitri Zaitsev)

Also recognized by ssh:

➜  ~ ssh -V     
OpenSSH_7.9p1, OpenSSL 1.0.2s  28 May 2019

comment:5 Changed 5 years ago by dmitriz (Dmitri Zaitsev)

Upon closer inspection, all files have been seemingly correctly downloaded from the macports mirrors without failures during each retry, following the failures that only occurred for https://static.rust-lang.org/dist

The actual build errors started after all the downloads from the line 214 in the log and below:

:info:build error: Unknown option
:info:build Traceback (most recent call last):
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src/src/bootstrap/bootstrap.py", line 864, in <module>
:info:build     main()
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src/src/bootstrap/bootstrap.py", line 847, in main
:info:build     bootstrap(help_triggered)
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src/src/bootstrap/bootstrap.py", line 818, in bootstrap
:info:build     build.build_bootstrap()
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src/src/bootstrap/bootstrap.py", line 648, in build_bootstrap
:info:build     run(args, env=env, verbose=self.verbose)
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src/src/bootstrap/bootstrap.py", line 141, in run
:info:build     raise RuntimeError(err)
:info:build RuntimeError: failed to run: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src/build/stage0-x86_64/bin/cargo build --manifest-path /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src/src/bootstrap/Cargo.toml --frozen
:info:build make: *** [all] Error 1§
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src" && /usr/bin/make -j8 -w all VERBOSE=1 BOOTSTRAP_ARGS="-v -j8" 
:info:build Exit code: 2
:error:build Failed to build rust: command execution failed
:debug:build Error code: CHILDSTATUS 99060 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log for details.
version:1

That seems to indicate that the errors are not due to the downloads?

Changed 5 years ago by dmitriz (Dmitri Zaitsev)

Attachment: log4 added

opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log

comment:6 Changed 5 years ago by mf2k (Frank Schima)

In the future, please add the port maintainer(s) to Cc (port info --maintainers rust), if any.

comment:7 Changed 5 years ago by mf2k (Frank Schima)

Keywords: rust removed
Owner: set to g5pw
Status: newassigned

comment:8 Changed 5 years ago by kencu (Ken)

Keywords: rust added

Your log has several build attempts. It's always best to clean between build attempts, so you have a fresh slate. In fact, it should probably be automatic to do that, unless you specifically override it, but that's for another topic. So you would do:

sudo port clean rust
sudo port -v install rust

each time.

The issue with SSL being outdated in MacPorts goes back several years now. See #51516. By default, MacPorts is built against the system's installed SSL infrastructure, which is very outdated on older systems. There has been talk, as per that ticket, of bundling openssl with MacPorts, but there is resistance about being in the security game, naturally.

What I do is install a separate current version of openssl and curl using a separate install of MacPorts in /opt/bootstrap and build my working MacPorts against that. By doing that, your MacPorts SSL is right up to date.

To do that, I build MacPorts from source. It's easy enough, and takes me only a few minutes, but admittedly it is a bit of a process to follow. Nonetheless, I do it on every machine I have running 10.9 and less. I never see any SSL errors using MacPorts this way.

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:9 Changed 5 years ago by mf2k (Frank Schima)

Keywords: rust removed

Please don't add useless keywords. The Port: field covers the port name.

comment:10 Changed 5 years ago by mf2k (Frank Schima)

Or we were posting at the same time.

comment:11 Changed 5 years ago by kencu (Ken)

Resolution: duplicate
Status: assignedclosed

There is nothing wrong with rust. This is a curl / SSL issue, essentially a duplicate of 51516.

Changed 5 years ago by dmitriz (Dmitri Zaitsev)

Attachment: log51 added

/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log

comment:12 Changed 5 years ago by kencu (Ken)

Resolution: duplicate
Status: closedreopened

I see from your new log there may be more going on here....reopening until we're sure.

comment:13 Changed 5 years ago by dmitriz (Dmitri Zaitsev)

Copy-pasting my email response as it doesn't seem to appear here.

---

First of all, I appreciate any advice and apologies for any misunderstanding, I am still very new to MacPorts (after giving up on HB).

I have now ran all of these:

sudo port clean rust
sudo port selfupdate
sudo port upgrade outdated
sudo port reclaim

The reclaim command suggested to delete unneeded files that I did.

Then ran again:

sudo port install rust

This time it has correctly downloaded all the files without any SSL related complaints. Then came the build error. I have ran this again:

sudo port clean rust
sudo port install rust

And again no more download attempts. I have uploaded the new log51 file. The build error begins on the line 936 until it gets to this:

:info:build RuntimeError: failed to run: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src/build/stage0-x86_64/bin/cargo build --manifest-path /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src/src/bootstrap/Cargo.toml --frozen
:info:build make: *** [all] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/work/rustc-1.36.0-src" && /usr/bin/make -j8 -w all VERBOSE=1 BOOTSTRAP_ARGS="-v -j8" 
:info:build Exit code: 2
:error:build Failed to build rust: command execution failed
:debug:build Error code: CHILDSTATUS 42241 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_rust/rust/main.log for details.

What I find puzzling:

  1. As I did not change anything on my system, why did all the files download correctly this time but not the last time?
  2. Why were existing files not recognized yesterday (the "does not exist error") but not this time (no such error is in the log)?
  3. What kind of build error is that and how to deal with it?

Thank you for any help, Dmitri.

comment:14 Changed 5 years ago by mouse07410 (Mouse)

Since Rust toolchain has many components, it might be easier in the long run to install the Rust toolchains via "rustup" command.

comment:16 in reply to:  13 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to dmitriz:

  1. As I did not change anything on my system, why did all the files download correctly this time but not the last time?

Your logs show the files successfully downloading from our mirror, after an unsuccessful attempt to download from the rust server (which uses newer ssl methods than /usr/lib/libcurl.dylib on your system supports).

  1. Why were existing files not recognized yesterday (the "does not exist error") but not this time (no such error is in the log)?

The logs show that MacPorts determined that the files did not exist on your disk. Therefore it downloaded them from the internet. After doing so, the files of course do exist on your disk.

  1. What kind of build error is that and how to deal with it?

You will have to ask the developers of rust. It is likely that they no longer test on a system as old as yours, and may or may not be willing to add support for it.

comment:17 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: Error: Failed to build rust: command execution failedrust @1.36.0: error: Unknown option

comment:18 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

error: Unknown option is still happening on 10.8 but not 10.9 or later. Here is the latest log from the 10.8 build worker.

The error is frustrating because it's not telling us which option is unknown nor to which program it is unknown.

comment:19 Changed 2 years ago by catap (Kirill A. Korinsky)

Resolution: fixed
Status: reopenedclosed

In ae4efe7691fb8d4db1205dd9a757516efc672dd1/macports-ports (master):

rust: fix build on macOS 10.8

CARGO_LOG=debug is required to see the real stack trace where issue is
happend instead of error: Unknown option.

This stack trace points to https://github.com/rust-lang/cargo/blob/2e2a16e983f597da62bc132eb191bc3276d4b1bb/src/cargo/core/package.rs#L423

Which makes clear that the cause of issue is too old system curl which
haven't supported HTTP/2.

Closes: #58848

Note: See TracTickets for help on using tickets.