Bug 255652

Summary: lang/rust: fails to build with libressl 3.3.x
Product: Ports & Packages Reporter: Felix Palmen <zirias>
Component: Individual Port(s)Assignee: FreeBSD Rust Team <rust>
Status: Closed FIXED    
Severity: Affects Only Me CC: maciej, vishwin
Priority: --- Flags: bugzilla: maintainer-feedback? (rust)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
allow to build with LibreSSL 3.3.x versions none

Description Felix Palmen freebsd_committer freebsd_triage 2021-05-06 09:19:08 UTC
Created attachment 224723 [details]
allow to build with LibreSSL 3.3.x versions

It's solved for me by "whitelisting" 3.3.x in the same way 3.2.x was whitelisted before, see attached patch.

I assume the upcoming 1.52.0 would need the same patch, but didn't check yet.
Comment 1 Tobias Kortkamp freebsd_committer freebsd_triage 2021-05-06 09:42:03 UTC
rust-openssl master has more changes to support LibreSSL 3.3.x, so
this change is maybe not quite correct?

But anyway I've added this to the Rust 1.52.0 update because whatever
it's LibreSSL...
Comment 2 Felix Palmen freebsd_committer freebsd_triage 2021-05-06 09:47:23 UTC
All I can say so far is it "convinces" rust 1.51.0 to build with libressl 3.3.3 and I could also successfully build firefox and thunderbird. I'll do a few runtime "smoke tests" with https sites soon ;)

Maybe the upgrades in master are for using actual new features of libressl 3.3.3?
Comment 3 Charlie Li freebsd_committer freebsd_triage 2021-05-06 15:34:16 UTC
I just had my 3.3.3 whitelist commit merged upstream.

3.3.2 opened up DTLS support, including the disabler opcodes (that are different than OpenSSL), which I accounted for when whitelisting 3.3.2.
Comment 4 Felix Palmen freebsd_committer freebsd_triage 2021-05-06 15:57:33 UTC
(In reply to Charlie Li from comment #3)
Does it mean that "just" whitelisting without any actual code changes breaks things (like, dangerously)? Or does it just mean features aren't available?
Comment 5 Charlie Li freebsd_committer freebsd_triage 2021-05-06 16:16:29 UTC
Their DTLS tests failed without code changes to accommodate LibreSSL's newfound availability, so yes things broke.

Some tests during the 3.2.1 cycle had to be ignored due to LibreSSL adding more TLSv1.3 support yet the API, including the disabler symbols, continuing to not be fully available. The vendor crate even in the soon-rust 1.52.0 still has an old version that only supports up to 3.2.0.
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-05-11 17:34:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d8837418ea743776bc43b9c91d83080d8eff5029

commit d8837418ea743776bc43b9c91d83080d8eff5029
Author:     Tobias Kortkamp <tobik@FreeBSD.org>
AuthorDate: 2021-05-04 06:05:04 +0000
Commit:     Tobias Kortkamp <tobik@FreeBSD.org>
CommitDate: 2021-05-11 17:29:27 +0000

    lang/rust: Update to 1.52.1

    - Add 32-bit powerpc support from bdragon@
    - Unbreak build with LibreSSL 3.3.x [1]
    - Add an update script

    Changes:        https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html
    Changes:        https://blog.rust-lang.org/2021/05/10/Rust-1.52.1.html
    PR:             255608, 255652 [1]
    Reviewed by:    mikael, pkubaj
    Exp-run by:     antoine
    Differential Revision:  https://reviews.freebsd.org/D30099

 Mk/Uses/cargo.mk                                   |   3 +-
 Mk/bsd.gecko.mk                                    |   2 +-
 lang/rust-bootstrap/Makefile                       |  12 ++-
 lang/rust-bootstrap/distinfo                       |   8 +-
 lang/rust/Makefile                                 |  39 +++++++-
 lang/rust/distinfo                                 | 108 +++++++++++----------
 lang/rust/files/patch-vendor_cc_src_lib.rs         |  10 +-
 .../files/patch-vendor_openssl-sys_build_main.rs   |   7 +-
 ...ch-compiler_rustc__target_src_spec_mod.rs (new) |  10 ++
 ...get_src_spec_powerpc__unknown__freebsd.rs (new) |  27 ++++++
 .../powerpc/patch-src_bootstrap_native.rs (new)    |  25 +++++
 ...t_llvm_lib_Driver_ToolChains_Arch_PPC.cpp (new) |  12 +++
 ..._llvm_lib_Target_PowerPC_PPCSubtarget.cpp (new) |  13 +++
 ...c_src_unix_bsd_freebsdlike_freebsd_mod.rs (new) |  12 +++
 ...c_unix_bsd_freebsdlike_freebsd_powerpc.rs (new) |  50 ++++++++++
 .../patch-vendor_openssl__src_src_lib.rs (new)     |  10 ++
 ..._rustc__ap__rustc__target_src_spec_mod.rs (new) |  10 ++
 ...get_src_spec_powerpc__unknown__freebsd.rs (new) |  27 ++++++
 ...llvm-project_clang_lib_Basic_Targets.cpp (gone) |  11 ---
 lang/rust/update.sh (new)                          |  43 ++++++++
 20 files changed, 355 insertions(+), 84 deletions(-)