Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MUSL compile fix for "unable to initialize decompress status for section .debug_info" #231

Merged
merged 9 commits into from
Aug 11, 2020
Merged

MUSL compile fix for "unable to initialize decompress status for section .debug_info" #231

merged 9 commits into from
Aug 11, 2020

Conversation

brainstorm
Copy link
Member

@brainstorm brainstorm commented Aug 6, 2020

Seems like recent changes on the underlying musl/gcc toolchains affecting DWARF trigger build failures for debug (non --release builds).

For more context, the current rust-musl-make binutils version is 2.33.1, which apparently has compression for the debug symbols. see, i.e: TA-Lib/ta-lib-python#268 (comment)

I don't like to downgrade toolchain versions either, so I'll make the assumption that debug builds for MUSL are not very used ATM... my workflow is (re-)building and deploying AWS lambdas in --release mode for now.

@brainstorm
Copy link
Member Author

Working (local) vs breaking (CI) compiler flags:

   Compiling hts-sys v1.10.3 (/project/hts-sys)
     Running `rustc 	--crate-name build_script_build
			--edition=2018 hts-sys/build.rs 
			--error-format=json 
			--json=diagnostic-rendered-ansi 
			--crate-type bin 
			--emit=dep-info,link -C opt-level=3 
			-Cembed-bitcode=no
 
			--cfg 'feature="bindgen"' 
			--cfg 'feature="bzip2"' 
			--cfg 'feature="bzip2-sys"' 
			--cfg 'feature="curl"' 
			--cfg 'feature="curl-sys"' 
			--cfg 'feature="gcs"' 
			--cfg 'feature="libdeflate"' 
			--cfg 'feature="libdeflate-sys"' 
			--cfg 'feature="lzma"' 
			--cfg 'feature="lzma-sys"' 
			--cfg 'feature="openssl-sys"' 
			--cfg 'feature="s3"' 
			--cfg 'feature="static"' 

			-C metadata=4d7d1f1c1148d63a 
			-C extra-filename=-4d7d1f1c1148d63a 

			--out-dir /target/release/build/hts-sys-4d7d1f1c1148d63a 
			
			-L dependency=/target/release/deps 
			--extern bindgen=/target/release/deps/libbindgen-dc93578612926c83.rlib 
			--extern cc=/target/release/deps/libcc-3c174a2e98767068.rlib 
			--extern fs_utils=/target/release/deps/libfs_utils-00311afaf56c6971.rlib 
			--extern glob=/target/release/deps/libglob-5340b1c47da11be1.rlib 
			
			-L native=/target/release/build/libloading-18bf0097e9c1a49e/out`




   Compiling hts-sys v1.10.3 (/project/hts-sys)
     Running `rustc	--crate-name build_script_build 
			--edition=2018 hts-sys/build.rs 
			--error-format=json 
			--json=diagnostic-rendered-ansi 
			--crate-type bin 
			--emit=dep-info,link
			-Cembed-bitcode=no 

			-C debuginfo=2                                     <--------------- CULPRIT?

			--cfg 'feature="bindgen"' 
			--cfg 'feature="bzip2"' 
			--cfg 'feature="bzip2-sys"' 
			--cfg 'feature="curl"' 
			--cfg 'feature="curl-sys"' 
			--cfg 'feature="gcs"' 
			--cfg 'feature="libdeflate"' 
			--cfg 'feature="libdeflate-sys"' 
			--cfg 'feature="lzma"' 
			--cfg 'feature="lzma-sys"' 
			--cfg 'feature="openssl-sys"' 
			--cfg 'feature="s3"' 
			--cfg 'feature="static"' 

			-C metadata=245f1f7e9ca62bb9 
			-C extra-filename=-245f1f7e9ca62bb9 
			
			--out-dir /target/debug/build/hts-sys-245f1f7e9ca62bb9 

			-C incremental=/target/debug/incremental 
			-L dependency=/target/debug/deps 

			--extern bindgen=/target/debug/deps/libbindgen-05d3837d6e6c7651.rlib 
			--extern cc=/target/debug/deps/libcc-97348af50fbbad9d.rlib 
			--extern fs_utils=/target/debug/deps/libfs_utils-534a41f21dc0c7a3.rlib 
			--extern glob=/target/debug/deps/libglob-268e6a55a2027c26.rlib 

			-L native=/target/debug/build/libloading-76090e1587b44adb/out`

@brainstorm brainstorm requested a review from pmarks August 11, 2020 04:36
Copy link
Contributor

@pmarks pmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me.

@brainstorm brainstorm merged commit 8d0a761 into rust-bio:master Aug 11, 2020
@brainstorm brainstorm changed the title Musl compile fix MUSL compile fix for "unable to initialize decompress status for section .debug_info" Aug 12, 2020
brainstorm added a commit that referenced this pull request Aug 12, 2020
* Cleanup and bump rust-embedded cross base image from upstream in cross-rs/cross#452 to fix the debug symbols issue observed in #231

* Add test for non-release builds against all features (previously failing because of old toolchain)

* Clean all the libs that are already handled via -sys crates. zlib cloudflare must be fixed upstream, not here. Only LLVM is needed at this point via docker, the (broken) htslib Makefile to build.rs transition that @pmarks did, simplified all this significantly, kudos
bors bot added a commit to cross-rs/cross that referenced this pull request Sep 3, 2020
452: Bump Ubuntu container version and MUSL-related libs r=therealprof a=brainstorm

Several reasons, including but not limited to:

1) MUSL-compiled OpenSSL benefits from MUSL versions 1.2.0 and up, otherwise it needs to be badly patched, see fornwall/rust-static-builder#3 (comment).
2) DWARFv2 compressed debugging symbols mess up with old toolchains and linkers, see rust-bio/rust-htslib#231.

Co-authored-by: Roman Valls Guimera <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants