`panic_unwind` is not compiled with this crate's panic strategy `abort`

Greetings!

I'm learning Rust programming language, so I'm not well versed in yet.

I'm having trouble compiling Lemmy 0.18.1 with it, and I'm not quite able to figure out it out by myself yet.

Following is an excerpt from the build log:

     Running `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=html2md CARGO_MANIFEST_DIR=/usr/home/org/lemmy-0.18.1/cargo-crates/html2md-0.2.14 CARGO_PKG_AUTHORS='Oleg `Kanedias` Chernovskiy <kanedias@house-of-maker.online>' CARGO_PKG_DESCRIPTION='Library and binary to convert simple html documents into markdown' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=GPL-3.0+ CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=html2md CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://gitlab.com/Kanedias/html2md' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.14 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=14 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/usr/home/org/target/release/deps:/usr/local/lib' /usr/local/bin/rustc --crate-name html2md --edition=2018 /usr/home/org/lemmy-0.18.1/cargo-crates/html2md-0.2.14/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=292 --crate-type rlib --crate-type dylib --crate-type staticlib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C panic=abort -C codegen-units=1 -C debuginfo=0 -C metadata=294cb1d7c4cf169b -C extra-filename=-294cb1d7c4cf169b --out-dir /usr/home/org/target/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -C linker=cc -L dependency=/usr/home/org/target/x86_64-unknown-freebsd/release/deps -L dependency=/usr/home/org/target/release/deps --extern html5ever=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/libhtml5ever-eb74b1ec0cde01a9.rlib --extern lazy_static=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/liblazy_static-58f7ffa6fd70b8e2.rlib --extern markup5ever_rcdom=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/libmarkup5ever_rcdom-5489e176e40959fc.rlib --extern percent_encoding=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/libpercent_encoding-3e440602b9447213.rlib --extern regex=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/libregex-662f0f7e62ebd938.rlib --cap-lints warn -C link-arg=-Wl,-rpath,/usr/local/lib -C link-arg=-fstack-protector-strong`
warning: `tracing-actix-web` (lib) generated 2 warnings
warning: `clokwerk` (lib) generated 23 warnings
       Fresh reqwest-tracing v0.4.4
error: the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort`

error: could not compile `html2md` (lib) due to previous error

Caused by:
  process didn't exit successfully: `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=html2md CARGO_MANIFEST_DIR=/usr/home/org/lemmy-0.18.1/cargo-crates/html2md-0.2.14 CARGO_PKG_AUTHORS='Oleg `Kanedias` Chernovskiy <kanedias@house-of-maker.online>' CARGO_PKG_DESCRIPTION='Library and binary to convert simple html documents into markdown' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=GPL-3.0+ CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=html2md CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://gitlab.com/Kanedias/html2md' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.14 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=14 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/usr/home/org/target/release/deps:/usr/local/lib' /usr/local/bin/rustc --crate-name html2md --edition=2018 /usr/home/org/lemmy-0.18.1/cargo-crates/html2md-0.2.14/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=292 --crate-type rlib --crate-type dylib --crate-type staticlib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C panic=abort -C codegen-units=1 -C debuginfo=0 -C metadata=294cb1d7c4cf169b -C extra-filename=-294cb1d7c4cf169b --out-dir /usr/home/org/target/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -C linker=cc -L dependency=/usr/home/org/target/x86_64-unknown-freebsd/release/deps -L dependency=/usr/home/org/target/release/deps --extern html5ever=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/libhtml5ever-eb74b1ec0cde01a9.rlib --extern lazy_static=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/liblazy_static-58f7ffa6fd70b8e2.rlib --extern markup5ever_rcdom=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/libmarkup5ever_rcdom-5489e176e40959fc.rlib --extern percent_encoding=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/libpercent_encoding-3e440602b9447213.rlib --extern regex=/usr/home/org/target/x86_64-unknown-freebsd/release/deps/libregex-662f0f7e62ebd938.rlib --cap-lints warn -C link-arg=-Wl,-rpath,/usr/local/lib -C link-arg=-fstack-protector-strong` (exit status: 1)
warning: build failed, waiting for other jobs to finish...

I'm running Rust 1.71.0 on FreeBSD 13.2-RELEASE, if it helps.

Any help is appreciated.

Thanks in advance!

I suspect that somewhere in your dependency tree is a line of extern crate panic_unwind; which forces panic=unwind. Why is your build system forcing panic=abort for the html2md binary?

1 Like

Hi @riking

Thank you for the hint. It was coming from CARGO_PROFILE_RELEASE_PANIC="abort" environment variable which FreeBSD ports system defines when LTO feature is ON.

Thanks

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.