Bug 222359 - lang/rust: Update to 1.20.0
Summary: lang/rust: Update to 1.20.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Jean-Sébastien Pédron
URL:
Keywords: needs-qa, patch
Depends on:
Blocks:
 
Reported: 2017-09-15 22:08 UTC by Charlie Li
Modified: 2017-10-23 10:07 UTC (History)
10 users (show)

See Also:
jbeich: maintainer-feedback? (dumbbell)
jbeich: maintainer-feedback? (riggs)


Attachments
Possible_patch_lang_rust (2.76 KB, patch)
2017-09-17 09:02 UTC, Walter Schwarzenfeld
no flags Details | Diff
possible-patch-lang_rust (2.58 KB, patch)
2017-09-17 10:43 UTC, Walter Schwarzenfeld
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Li freebsd_committer freebsd_triage 2017-09-15 22:08:18 UTC
Rust 1.20.0 has been released 15 days ago as of this writing.

Additionally, after bug 221088 was committed as ports r449914, the port fails to build when libressl is used as the default ssl, as the latest upstream and port version 2.5.5 is not supported in rust-1.19:

     Running `/wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/build/x86_64-unknown-freebsd/stage2-tools/release/build/openssl-sys-7383df0b2b2e0b57/build-script-build`
error: failed to run custom build command for `openssl-sys v0.9.12`
process didn't exit successfully: `/wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/build/x86_64-unknown-freebsd/stage2-tools/release/build/openssl-sys-7383df0b2b2e0b57/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-search=native=/usr/local/lib
cargo:include=/usr/local/include
OPT_LEVEL = Some("2")
TARGET = Some("x86_64-unknown-freebsd")
HOST = Some("x86_64-unknown-freebsd")
TARGET = Some("x86_64-unknown-freebsd")
TARGET = Some("x86_64-unknown-freebsd")
HOST = Some("x86_64-unknown-freebsd")
CC_x86_64-unknown-freebsd = Some("cc")
TARGET = Some("x86_64-unknown-freebsd")
HOST = Some("x86_64-unknown-freebsd")
CFLAGS_x86_64-unknown-freebsd = Some("-ffunction-sections -fdata-sections -fPIC -m64")
PROFILE = Some("release")
running: "cc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-I" "/usr/local/include" "-E" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/build/x86_64-unknown-freebsd/stage2-tools/x86_64-unknown-freebsd/release/build/openssl-sys-5927edc57e54ea05/out/expando.c"
exit code: 0
cargo:rustc-cfg=osslconf="OPENSSL_NO_BUF_FREELISTS"
cargo:rustc-cfg=osslconf="OPENSSL_NO_COMP"
cargo:rustc-cfg=osslconf="OPENSSL_NO_KRB5"
cargo:rustc-cfg=osslconf="OPENSSL_NO_PSK"
cargo:rustc-cfg=osslconf="OPENSSL_NO_RFC3779"
cargo:rustc-cfg=osslconf="OPENSSL_NO_SRP"
cargo:rustc-cfg=osslconf="OPENSSL_NO_SSL3_METHOD"
cargo:conf=OPENSSL_NO_BUF_FREELISTS,OPENSSL_NO_COMP,OPENSSL_NO_KRB5,OPENSSL_NO_PSK,OPENSSL_NO_RFC3779,OPENSSL_NO_SRP,OPENSSL_NO_SSL3_METHOD

--- stderr
thread 'main' panicked at '

This crate is only compatible with OpenSSL 1.0.1, 1.0.2, and 1.1.0, or LibreSSL
2.5.0, 2.5.1, 2.5.2, 2.5.3, and 2.5.4, but a different version of OpenSSL was
found. The build is now aborting due to this version mismatch.

', src/vendor/openssl-sys/build.rs:363
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Build failed, waiting for other jobs to finish...
error: build failed


command did not execute successfully: "/wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/build/x86_64-unknown-freebsd/stage0/bin/cargo" "build" "-j" "4" "--target" "x86_64-unknown-freebsd" "-v" "--release" "--frozen" "--manifest-path" "/wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/src/tools/cargo/Cargo.toml"
expected success, got: exit code: 101


Traceback (most recent call last):
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/x.py", line 20, in <module>
    bootstrap.main()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/src/bootstrap/bootstrap.py", line 678, in main
    bootstrap()
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/src/bootstrap/bootstrap.py", line 670, in bootstrap
    run(args, env=env, verbose=rb.verbose)
  File "/wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/src/bootstrap/bootstrap.py", line 142, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /wrkdirs/usr/ports/lang/rust/work/rustc-1.19.0-src/build/bootstrap/debug/bootstrap build --verbose --config ./config.toml --jobs 4
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust
=>> Cleaning up wrkdir
===>  Cleaning for rust-1.19.0_2
build of lang/rust | rust-1.19.0_2 ended at Fri Sep 15 17:40:42 EDT 2017
build time: 01:50:35
!!! build failure encountered !!!

Apparently this part was not built in previous port versions, but this is a moot point now.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2017-09-15 22:08:18 UTC
Maintainer informed via mail
Comment 2 Walter Schwarzenfeld freebsd_triage 2017-09-16 18:27:50 UTC
It does not know libressl 2.5.5. I solved it with
Index: files/patch-vendor_openssl-sys_build_rs
===================================================================
--- files/patch-vendor_openssl-sys_build_rs     (nonexistent)
+++ files/patch-vendor_openssl-sys_build_rs     (working copy)
@@ -0,0 +1,24 @@
+--- src/vendor/openssl-sys/build.rs.prig       2017-09-16 13:08:12 UTC
++++ src/vendor/openssl-sys/build.rs
+@@ -241,7 +241,7 @@ fn validate_headers(include_dirs: &[Path
+ #include <openssl/opensslconf.h>
+ 
+ #if LIBRESSL_VERSION_NUMBER >= 0x20505000
+-RUST_LIBRESSL_NEW
++RUST_LIBRESSL_255
+ #elif LIBRESSL_VERSION_NUMBER >= 0x20504000
+ RUST_LIBRESSL_254
+ #elif LIBRESSL_VERSION_NUMBER >= 0x20503000
+@@ -347,6 +347,12 @@ See rust-openssl README for more informa
:

but I have problems with the REINPLACE_CMD to replace the checksum for
build.rs in src/vendor/openssl-sys/.cargo-checksum.json.
Comment 3 Walter Schwarzenfeld freebsd_triage 2017-09-17 09:02:52 UTC
Created attachment 186451 [details]
Possible_patch_lang_rust
Comment 4 Walter Schwarzenfeld freebsd_triage 2017-09-17 09:03:52 UTC
Maintainer, please could you make Tests optional?
Comment 5 Walter Schwarzenfeld freebsd_triage 2017-09-17 10:43:57 UTC
Created attachment 186453 [details]
possible-patch-lang_rust

Forgot something to delete.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2017-09-27 10:40:07 UTC
Auto-assigner chokes on rust@ not being a valid bugzilla user.
Comment 7 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2017-09-27 21:42:55 UTC
Hi!

Before working on the LibreSSL patch, I'll update the port to 1.20.0. I prepared the patch and Poudriere is running. In parallel, I'm recreating a bootstrap for aarch64.

I'll keep you posted!
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-10-04 08:14:27 UTC
A commit references this bug:

Author: dumbbell
Date: Wed Oct  4 08:13:38 UTC 2017
New revision: 451188
URL: https://svnweb.freebsd.org/changeset/ports/451188

Log:
  lang/rust: Update to 1.20.0

  This patch only upgrades the port to Rust 1.20.0. The PR also covers a
  build failure with the latest LibreSSL, which is not addressed here.

  PR:		222359
  Reported by:	Charlie Li <ml+freebsd-bugs@vishwin.info>

Changes:
  head/lang/rust/Makefile
  head/lang/rust/distinfo
Comment 9 Walter Schwarzenfeld freebsd_triage 2017-10-04 11:54:41 UTC
Compiles now fine with libreSSL.
Comment 10 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2017-10-04 13:38:19 UTC
Great! Thank you for testing! I didn't have a chance to do it. But for future updates, I'll add that to the list of tests before committing.
Comment 11 Nathanael Hoyle 2017-10-04 16:53:45 UTC
Just wanted to second the confirmation of success with LibreSSL, including specifically version 2.5.5. Thanks!
Comment 12 Walter Schwarzenfeld freebsd_triage 2017-10-04 17:21:14 UTC
It was no problem of testing. The versions of rust have the right libreSSL 
version. But this time a update of libressl comes between the versons.
Comment 13 Piotr Kubaj freebsd_committer freebsd_triage 2017-10-09 11:52:04 UTC
There's still problem with libressl-devel, which will become stable probably this month. This commit covers this issue:
https://github.com/sfackler/rust-openssl/commit/e0efd1d438fbf426a7e1006e4983b0f352c630f6
Comment 14 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2017-10-09 22:18:26 UTC
Thanks for the pointer!

I'm build-testing patches to add support for LibreSSL 2.6.1 and 2.6.2 to Rust 1.20.0.
Comment 15 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2017-10-10 07:50:56 UTC
So I let Poudriere run during the night with:

  DEFAULT_VERSIONS+= ssl=libressl-devel

However, it failed early with:

  Starting build of ftp/curl
  Finished build of ftp/curl: Ignored: unsupported TLS-SRP in LibreSSL
  Skipping build of devel/cmake: Dependent port ftp/curl ignored
  Skipping build of lang/rust: Dependent port ftp/curl ignored

How do you test the build with LibreSSL?
Comment 16 Charlie Li freebsd_committer freebsd_triage 2017-10-10 07:55:20 UTC
(In reply to Jean-Sébastien Pédron from comment #15)
Disable the TLS_SRP and GSSAPI_BASE options in ftp/curl. Those are not supported with libressl at all.

https://wiki.freebsd.org/LibreSSL#Problems_you.27ll_run_into
Comment 17 commit-hook freebsd_committer freebsd_triage 2017-10-11 12:28:52 UTC
A commit references this bug:

Author: dumbbell
Date: Wed Oct 11 12:28:01 UTC 2017
New revision: 451743
URL: https://svnweb.freebsd.org/changeset/ports/451743

Log:
  lang/rust: Add support for LibreSSL 2.6.1 and 2.6.2

  Patches come from upstream:
      https://github.com/sfackler/rust-openssl

  PR:		222359
  Reported by:	Charlie Li <ml+freebsd-bugs@vishwin.info>,
  		Piotr Kubaj <pkubaj@anongoth.pl>,
  		w.schwarzenfeld@utanet.at,
  		nhoyle@hoyletech.com

Changes:
  head/lang/rust/Makefile
  head/lang/rust/files/patch-src_vendor_openssl-sys_build.rs
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_lib.rs
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_libressl_mod.rs
  head/lang/rust/files/patch-src_vendor_openssl_build.rs
  head/lang/rust/files/patch-src_vendor_openssl_src_ssl_mod.rs
  head/lang/rust/files/patch-src_vendor_openssl_src_ssl_tests_mod.rs
Comment 18 Piotr Kubaj freebsd_committer freebsd_triage 2017-10-11 12:58:58 UTC
(In reply to commit-hook from comment #17)
Thanks for the quick reaction!