Bug 241411 - lang/rust 1.38 fails with libressl 3.0.2
Summary: lang/rust 1.38 fails with libressl 3.0.2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: FreeBSD Rust Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-22 10:15 UTC by jakub_lach
Modified: 2019-11-07 18:07 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (rust)


Attachments
Patch for Rust + LibreSSL 3.0.x (2.06 KB, patch)
2019-10-22 11:24 UTC, esh
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jakub_lach 2019-10-22 10:15:54 UTC
error: failed to run custom build command for `openssl-sys v0.9.43`                                                                                                                

Caused by:                                                                                                                                  
  process didn't exit successfully: `/usr/obj/usr/ports/lang/rust/work/rustc-1.38.0-src/build/x86_                                                                                 64-unknown-freebsd/stage2-tools/release/build/openssl-sys-52f1d537c2290713/build-script-main` (exi                                                                                 t code: 101)                                                                                                                                        
--- stdout                                                                                                                                  
cargo:rustc-cfg=const_fn                                                                                                                                                           
cargo:rerun-if-env-changed=X86_64_UNKNOWN_FREEBSD_OPENSSL_LIB_DIR                                                                                                                  
X86_64_UNKNOWN_FREEBSD_OPENSSL_LIB_DIR unset                                                                                                                                       
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR                                                                                                                                         
OPENSSL_LIB_DIR unset                                                                                                                                                              
cargo:rerun-if-env-changed=X86_64_UNKNOWN_FREEBSD_OPENSSL_INCLUDE_DIR                                                                                                              
X86_64_UNKNOWN_FREEBSD_OPENSSL_INCLUDE_DIR unset                                                                                                                                   
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR                                                                                                                                     
OPENSSL_INCLUDE_DIR unset                                                                                                                                                          
cargo:rerun-if-env-changed=X86_64_UNKNOWN_FREEBSD_OPENSSL_DIR                                                                                                                      
X86_64_UNKNOWN_FREEBSD_OPENSSL_DIR unset                                                                                                                                           
cargo:rerun-if-env-changed=OPENSSL_DIR                                                                                                                                             
OPENSSL_DIR = /usr/local                                                                                                                                                           
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")                                                                                                                                              
CC_x86_64-unknown-freebsd = Some("cc")                                                                                                                                             
CFLAGS_x86_64-unknown-freebsd = Some("-ffunction-sections -fdata-sections -fPIC -m64")                                                                                             
CRATE_CC_NO_DEFAULTS = None                                                                                                                                                        
DEBUG = Some("false")                                                                                                                                                              
CARGO_CFG_TARGET_FEATURE = Some("fxsr,mmx,sse,sse2")                                                                                                                               
running: "cc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-ffunction-sections" "                                                                                 -fdata-sections" "-fPIC" "-m64" "-I" "/usr/local/include" "-E" "build/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_RFC3                                                                                 779,OPENSSL_NO_SRP,OPENSSL_NO_SSL3_METHOD                                                                                                                                          
cargo:rustc-cfg=libressl                                                                                                                                                           
cargo:rustc-cfg=libressl251                                                                                                                                                        
cargo:rustc-cfg=libressl261                                                                                                                                                        
cargo:rustc-cfg=libressl270                                                                                                                                                        
cargo:rustc-cfg=libressl271                                                                                                                                                        
cargo:rustc-cfg=libressl273                                                                                                                                                        
cargo:rustc-cfg=libressl280                                                                                                                                                        
cargo:rustc-cfg=libressl281                                                                                                                                                        
cargo:rustc-cfg=libressl291                                                                                                                                                        
cargo:libressl_version_number=3000200f                                                                                                                                             

--- stderr                                                                                                                                  
thread 'main' panicked at '                                                                                                                                                        

This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5                                                                                                    
through 2.9.x, but a different version of OpenSSL was found. The build is now aborting                                                                                             
due to this version mismatch.                                                                                                                                                      

', /usr/obj/usr/ports/lang/rust/work/rustc-1.38.0-src/vendor/openssl-sys/build/main.rs:239:5                                                                                       
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.                                                                                                     

warning: build failed, waiting for other jobs to finish...
Comment 1 esh 2019-10-22 11:24:03 UTC
Created attachment 208505 [details]
Patch for Rust + LibreSSL 3.0.x
Comment 2 esh 2019-10-22 11:25:07 UTC
I fixed it using the attached patch (patch-vendor_openssl-sys_build_main.rs), however I'm not sure whether it's the correct way to do it.
Comment 3 jakub_lach 2019-10-23 00:00:04 UTC
It does compile certainly. Thanks.
Comment 4 Ivan Rozhuk 2019-10-30 11:57:53 UTC
Works for me too.
Comment 5 commit-hook freebsd_committer freebsd_triage 2019-11-07 18:07:46 UTC
A commit references this bug:

Author: tobik
Date: Thu Nov  7 18:07:29 UTC 2019
New revision: 516995
URL: https://svnweb.freebsd.org/changeset/ports/516995

Log:
  lang/rust: Update to 1.39.0

  - Force rebuild all consumers to catch regressions early
  - Partially apply D20792 in preparation for PPC_ABI support
  - Add LibreSSL 3.0.x support [1]

  Thanks to Mika?l Urankar for providing updated bootstraps for
  aarch64, armv6, armv7, powerpc64.

  Changes:	https://blog.rust-lang.org/2019/11/07/Rust-1.39.0.html
  PR:		241411 [1]
  Tested by:	mikael.urankar@gmail.com, tobik
  With hat:	rust
  Differential Revision:	https://reviews.freebsd.org/D22240

Changes:
  head/Mk/Uses/cargo.mk
  head/audio/spotifyd/Makefile
  head/benchmarks/hyperfine/Makefile
  head/devel/bingrep/Makefile
  head/devel/cargo-tree/Makefile
  head/devel/git-absorb/Makefile
  head/devel/interactive_rebase_tool/Makefile
  head/devel/pijul/Makefile
  head/devel/racer/Makefile
  head/devel/racerd/Makefile
  head/devel/rust-bindgen/Makefile
  head/devel/rust-cbindgen/Makefile
  head/devel/sccache/Makefile
  head/devel/tokei/Makefile
  head/dns/doh-proxy/Makefile
  head/editors/kak-lsp/Makefile
  head/editors/parinfer-rust/Makefile
  head/editors/xi-core/Makefile
  head/editors/xi-term/Makefile
  head/games/genact/Makefile
  head/games/jaggedalliance2/Makefile
  head/graphics/librsvg2-rust/Makefile
  head/graphics/svgbob/Makefile
  head/lang/rust/Makefile
  head/lang/rust/distinfo
  head/lang/rust/files/armv6/
  head/lang/rust/files/armv6/patch-src_llvm-project_compiler-rt_lib_builtins_atomic.c
  head/lang/rust/files/armv7/
  head/lang/rust/files/armv7/patch-src_llvm-project_compiler-rt_lib_builtins_atomic.c
  head/lang/rust/files/extra-patch-arm-compiler-rt
  head/lang/rust/files/patch-src_bootstrap_native.rs
  head/lang/rust/files/patch-src_librustc__llvm_build.rs
  head/lang/rust/files/patch-src_llvm-project_llvm_utils_llvm-build_llvmbuild_main.py
  head/lang/rust/files/patch-vendor_libgit2-sys_lib.rs
  head/lang/rust/files/patch-vendor_openssl-sys_build_main.rs
  head/lang/rust/files/patch-vendor_openssl-sys_src_ssl.rs
  head/lang/rust/files/powerpc64-elfv1/
  head/lang/rust/files/powerpc64-elfv1/patch-src_bootstrap_native.rs
  head/lang/rust/files/powerpc64-elfv1/patch-src_librustc__llvm_build.rs
  head/lang/rust/files/powerpc64-elfv2/
  head/lang/rust/files/powerpc64-elfv2/patch-src_librustc__target_abi_call_powerpc64.rs
  head/lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_clang_lib_Basic_Targets_PPC.h
  head/lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_llvm_lib_Target_PowerPC_PPCTargetMachine.cpp
  head/mail/thunderbird/Makefile
  head/mail/thunderbird/files/patch-bindgen-rust1390
  head/multimedia/rav1e/Makefile
  head/multimedia/termplay/Makefile
  head/net/rabbiteer/Makefile
  head/net/routinator/Makefile
  head/net-im/fractal/Makefile
  head/security/acmed/Makefile
  head/security/cargo-audit/Makefile
  head/security/cloak/Makefile
  head/security/suricata/Makefile
  head/security/suricata5/Makefile
  head/shells/ion/Makefile
  head/shells/starship/Makefile
  head/sysutils/exa/Makefile
  head/sysutils/fd/Makefile
  head/sysutils/flowgger/Makefile
  head/sysutils/fusefs-sandboxfs/Makefile
  head/sysutils/hexyl/Makefile
  head/sysutils/potnet/Makefile
  head/textproc/bat/Makefile
  head/textproc/ripgrep/Makefile
  head/textproc/sd/Makefile
  head/textproc/sonic/Makefile
  head/textproc/xsv-rs/Makefile
  head/www/cliqz/Makefile
  head/www/cliqz/files/patch-bindgen-rust1390
  head/www/ffsend/Makefile
  head/www/firefox/Makefile
  head/www/firefox/files/patch-bindgen-rust1390
  head/www/firefox-esr/Makefile
  head/www/firefox-esr/files/patch-bindgen-rust1390
  head/www/geckodriver/Makefile
  head/www/jwt-cli/Makefile
  head/www/miniserve/Makefile
  head/www/newsboat/Makefile
  head/www/websocat/Makefile
  head/www/zola/Makefile
  head/x11/admiral/Makefile
  head/x11/alacritty/Makefile