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

error: the crate panic_abort does not have the panic strategy abort #343

Open
jordemort opened this issue May 4, 2021 · 18 comments
Open

Comments

@jordemort
Copy link

Version(s) of meta-rust

master @ 02db606

Version(s) of poky and/or oe-core

poky - dunfell @ 320f059a9b7d7cf9b493778933469d5c604be42b

Expected result

websocat builds without errors

Actual result

websocat fails to build:

| error: the crate `panic_abort` does not have the panic strategy `abort`
| 
| error: aborting due to previous error
| 
| error: could not compile `websocat`
| 
| Caused by:
|   process didn't exit successfully: `rustc --crate-name websocat --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=s -C panic=abort -C lto -C codegen-units=1 --cfg 'feature="default"' --cfg 'feature="signal_handler"' --cfg 'feature="tokio-named-pipes"' --cfg 'feature="tokio-process"' --cfg 'feature="tokio-signal"' --cfg 'feature="unix_stdio"' --cfg 'feature="windows_named_pipes"' -C metadata=806f39075c0e81bf -C extra-filename=-806f39075c0e81bf --out-dir /mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps --target arm-bantha-linux-gnueabi -C linker=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/wrapper/target-rust-ccld -L dependency=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps -L dependency=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/release/deps --extern anymap=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libanymap-2bade36f4e6bd39f.rlib --extern atty=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libatty-287180326a573dae.rlib --extern base64=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libbase64-af4a0171192c5da3.rlib --extern derivative=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/release/deps/libderivative-e2b8581db0dfa063.so --extern env_logger=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libenv_logger-f3d9f38873e88f08.rlib --extern futures=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libfutures-30d4ba93a2a57b2c.rlib --extern hex=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libhex-b2bfa0acc8a4f35b.rlib --extern http_bytes=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libhttp_bytes-23171ec358f1b557.rlib --extern hyper=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libhyper-01df6e7fad0f5174.rlib --extern libc=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/liblibc-f22657723912b3e6.rlib --extern log=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/liblog-ec32d65f11431c2f.rlib --extern net2=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libnet2-cb89f462a6d9423f.rlib --extern slab_typesafe=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libslab_typesafe-5b432705caa07ca8.rlib --extern smart_default=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/release/deps/libsmart_default-60d0b83853947d06.so --extern structopt=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libstructopt-3e2b83a0d1f3c257.rlib --extern structopt_derive=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/release/deps/libstructopt_derive-a373d3245e8e070b.so --extern tempfile=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtempfile-cd0d3e1663da3f89.rlib --extern tk_listen=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtk_listen-031ebb022f28af6e.rlib --extern tokio=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio-eadc116b34186b40.rlib --extern tokio_codec=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_codec-1b0a77d28140b61d.rlib --extern tokio_current_thread=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_current_thread-090693d23788c9c1.rlib --extern tokio_file_unix=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_file_unix-92ecad597716a087.rlib --extern tokio_io=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_io-a209211364773a07.rlib --extern tokio_process=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_process-d6aba11808464261.rlib --extern tokio_reactor=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_reactor-3155dcbae6c833c8.rlib --extern tokio_signal=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_signal-2e13a1d04dab0e0c.rlib --extern tokio_stdin_stdout=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_stdin_stdout-fdee656e416fd5e9.rlib --extern tokio_tcp=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_tcp-41b0e74cdc748cd6.rlib --extern tokio_timer=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_timer-d71a298625b4b10b.rlib --extern tokio_udp=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_udp-f02ff8e55ca50e77.rlib --extern tokio_uds=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libtokio_uds-cbe468c790a49586.rlib --extern url=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/liburl-e814afbe6ff0e148.rlib --extern websocat=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libwebsocat-8f3615d678e16284.rlib --extern websocket=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libwebsocket-753f5a75e561a2f8.rlib --extern websocket_base=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/build/target/arm-bantha-linux-gnueabi/release/deps/libwebsocket_base-3f8673c1a25af904.rlib -L /mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/recipe-sysroot/usr/lib/rust --remap-path-prefix=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0=/usr/src/debug/websocat/1.8.0-r0` (exit code: 1)
| WARNING: /mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/temp/run.do_compile.51577:1 exit 101 from '"cargo" build -v --target arm-bantha-linux-gnueabi --release --manifest-path=/mnt/build/tmp/work/cortexa7t2hf-neon-bantha-linux-gnueabi/websocat/1.8.0-r0/git//Cargo.toml "$@"'

Steps to reproduce

  1. Generate a recipe for https://github.com/vi/websocat with cargo bitbake
  2. Attempt to build the recipe

websocat includes this in Cargo.toml:

[profile.release]
opt-level = "s"
debug = false
rpath = false
lto = true
debug-assertions = false
codegen-units = 1
panic = 'abort'

If I comment panic = 'abort' out, then the recipe builds cleanly.

Here is the recipe I generated:

# Auto-Generated by cargo-bitbake 0.3.16-alpha.0
#
inherit cargo

# If this is git based prefer versioned ones if they exist
# DEFAULT_PREFERENCE = "-1"

# how to get websocat could be as easy as but default to a git checkout:
# SRC_URI += "crate://crates.io/websocat/1.8.0"
SRC_URI += "git://github.com/vi/websocat;protocol=https;nobranch=1"
SRCREV = "3bd6d4c42a1253541b8794b233e103b76dae249c"
S = "${WORKDIR}/git"
CARGO_SRC_DIR = ""
PV_append = ".AUTOINC+3bd6d4c42a"

# please note if you have entries that do not begin with crate://
# you must change them to how that package can be fetched
SRC_URI += " \
    crate://crates.io/anymap/0.12.1 \
    crate://crates.io/arc-swap/0.4.3 \
    crate://crates.io/atty/0.2.14 \
    crate://crates.io/autocfg/0.1.7 \
    crate://crates.io/base64/0.10.1 \
    crate://crates.io/base64/0.9.3 \
    crate://crates.io/bitflags/1.2.1 \
    crate://crates.io/block-buffer/0.7.3 \
    crate://crates.io/block-padding/0.1.5 \
    crate://crates.io/byte-tools/0.3.1 \
    crate://crates.io/byteorder/1.3.2 \
    crate://crates.io/bytes/0.4.12 \
    crate://crates.io/c2-chacha/0.2.3 \
    crate://crates.io/cc/1.0.41 \
    crate://crates.io/cfg-if/0.1.9 \
    crate://crates.io/clap/2.33.0 \
    crate://crates.io/cloudabi/0.0.3 \
    crate://crates.io/core-foundation-sys/0.6.2 \
    crate://crates.io/core-foundation/0.6.4 \
    crate://crates.io/crossbeam-deque/0.7.2 \
    crate://crates.io/crossbeam-epoch/0.8.0 \
    crate://crates.io/crossbeam-queue/0.1.2 \
    crate://crates.io/crossbeam-utils/0.6.6 \
    crate://crates.io/crossbeam-utils/0.7.0 \
    crate://crates.io/derivative/1.0.3 \
    crate://crates.io/digest/0.8.1 \
    crate://crates.io/env_logger/0.6.2 \
    crate://crates.io/fake-simd/0.1.2 \
    crate://crates.io/fnv/1.0.6 \
    crate://crates.io/foreign-types-shared/0.1.1 \
    crate://crates.io/foreign-types/0.3.2 \
    crate://crates.io/fuchsia-cprng/0.1.1 \
    crate://crates.io/fuchsia-zircon-sys/0.3.3 \
    crate://crates.io/fuchsia-zircon/0.3.3 \
    crate://crates.io/futures/0.1.29 \
    crate://crates.io/generic-array/0.12.3 \
    crate://crates.io/getrandom/0.1.13 \
    crate://crates.io/heck/0.3.1 \
    crate://crates.io/hermit-abi/0.1.18 \
    crate://crates.io/hex/0.4.2 \
    crate://crates.io/http-bytes/0.1.0 \
    crate://crates.io/http/0.1.19 \
    crate://crates.io/httparse/1.3.4 \
    crate://crates.io/hyper/0.10.16 \
    crate://crates.io/idna/0.1.5 \
    crate://crates.io/iovec/0.1.4 \
    crate://crates.io/itoa/0.4.4 \
    crate://crates.io/kernel32-sys/0.2.2 \
    crate://crates.io/language-tags/0.2.2 \
    crate://crates.io/lazy_static/1.4.0 \
    crate://crates.io/libc/0.2.65 \
    crate://crates.io/lock_api/0.1.5 \
    crate://crates.io/log/0.3.9 \
    crate://crates.io/log/0.4.8 \
    crate://crates.io/matches/0.1.8 \
    crate://crates.io/maybe-uninit/2.0.0 \
    crate://crates.io/memoffset/0.5.3 \
    crate://crates.io/mime/0.2.6 \
    crate://crates.io/mio-named-pipes/0.1.6 \
    crate://crates.io/mio-uds/0.6.7 \
    crate://crates.io/mio/0.6.19 \
    crate://crates.io/miow/0.2.1 \
    crate://crates.io/miow/0.3.3 \
    crate://crates.io/native-tls/0.2.3 \
    crate://crates.io/net2/0.2.33 \
    crate://crates.io/num_cpus/1.11.0 \
    crate://crates.io/opaque-debug/0.2.3 \
    crate://crates.io/openssl-probe/0.1.2 \
    crate://crates.io/openssl-src/111.13.0+1.1.1i \
    crate://crates.io/openssl-sys/0.9.52 \
    crate://crates.io/openssl/0.10.25 \
    crate://crates.io/owning_ref/0.4.0 \
    crate://crates.io/parking_lot/0.7.1 \
    crate://crates.io/parking_lot_core/0.4.0 \
    crate://crates.io/percent-encoding/1.0.1 \
    crate://crates.io/pkg-config/0.3.17 \
    crate://crates.io/ppv-lite86/0.2.6 \
    crate://crates.io/proc-macro2/0.4.30 \
    crate://crates.io/quote/0.6.13 \
    crate://crates.io/rand/0.6.5 \
    crate://crates.io/rand/0.7.2 \
    crate://crates.io/rand_chacha/0.1.1 \
    crate://crates.io/rand_chacha/0.2.1 \
    crate://crates.io/rand_core/0.3.1 \
    crate://crates.io/rand_core/0.4.2 \
    crate://crates.io/rand_core/0.5.1 \
    crate://crates.io/rand_hc/0.1.0 \
    crate://crates.io/rand_hc/0.2.0 \
    crate://crates.io/rand_isaac/0.1.1 \
    crate://crates.io/rand_jitter/0.1.4 \
    crate://crates.io/rand_os/0.1.3 \
    crate://crates.io/rand_pcg/0.1.2 \
    crate://crates.io/rand_xorshift/0.1.1 \
    crate://crates.io/rdrand/0.4.0 \
    crate://crates.io/readwrite/0.1.1 \
    crate://crates.io/redox_syscall/0.1.56 \
    crate://crates.io/remove_dir_all/0.5.2 \
    crate://crates.io/rustc_version/0.2.3 \
    crate://crates.io/safemem/0.3.3 \
    crate://crates.io/schannel/0.1.16 \
    crate://crates.io/scopeguard/0.3.3 \
    crate://crates.io/scopeguard/1.0.0 \
    crate://crates.io/security-framework-sys/0.3.3 \
    crate://crates.io/security-framework/0.3.3 \
    crate://crates.io/semver-parser/0.7.0 \
    crate://crates.io/semver/0.9.0 \
    crate://crates.io/sha-1/0.8.2 \
    crate://crates.io/signal-hook-registry/1.1.1 \
    crate://crates.io/signal-hook/0.1.11 \
    crate://crates.io/slab/0.4.2 \
    crate://crates.io/slab_typesafe/0.1.3 \
    crate://crates.io/smallvec/0.6.13 \
    crate://crates.io/smart-default/0.3.0 \
    crate://crates.io/socket2/0.3.11 \
    crate://crates.io/stable_deref_trait/1.1.1 \
    crate://crates.io/structopt-derive/0.2.16 \
    crate://crates.io/structopt/0.2.16 \
    crate://crates.io/syn/0.15.44 \
    crate://crates.io/tempfile/3.1.0 \
    crate://crates.io/textwrap/0.11.0 \
    crate://crates.io/time/0.1.42 \
    crate://crates.io/tk-listen/0.2.1 \
    crate://crates.io/tokio-codec/0.1.1 \
    crate://crates.io/tokio-current-thread/0.1.6 \
    crate://crates.io/tokio-executor/0.1.8 \
    crate://crates.io/tokio-file-unix/0.5.1 \
    crate://crates.io/tokio-fs/0.1.6 \
    crate://crates.io/tokio-io/0.1.12 \
    crate://crates.io/tokio-named-pipes/0.1.0 \
    crate://crates.io/tokio-process/0.2.4 \
    crate://crates.io/tokio-reactor/0.1.9 \
    crate://crates.io/tokio-signal/0.2.7 \
    crate://crates.io/tokio-stdin-stdout/0.1.5 \
    crate://crates.io/tokio-sync/0.1.7 \
    crate://crates.io/tokio-tcp/0.1.3 \
    crate://crates.io/tokio-threadpool/0.1.16 \
    crate://crates.io/tokio-timer/0.2.11 \
    crate://crates.io/tokio-tls/0.2.1 \
    crate://crates.io/tokio-udp/0.1.5 \
    crate://crates.io/tokio-uds/0.2.5 \
    crate://crates.io/tokio/0.1.22 \
    crate://crates.io/traitobject/0.1.0 \
    crate://crates.io/typeable/0.1.2 \
    crate://crates.io/typenum/1.12.0 \
    crate://crates.io/unicase/1.4.2 \
    crate://crates.io/unicode-bidi/0.3.4 \
    crate://crates.io/unicode-normalization/0.1.9 \
    crate://crates.io/unicode-segmentation/1.5.0 \
    crate://crates.io/unicode-width/0.1.5 \
    crate://crates.io/unicode-xid/0.1.0 \
    crate://crates.io/url/1.7.2 \
    crate://crates.io/vcpkg/0.2.7 \
    crate://crates.io/version_check/0.1.5 \
    crate://crates.io/wasi/0.7.0 \
    crate://crates.io/websocket-base/0.26.2 \
    crate://crates.io/websocket/0.26.2 \
    crate://crates.io/winapi-build/0.1.1 \
    crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
    crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
    crate://crates.io/winapi/0.2.8 \
    crate://crates.io/winapi/0.3.8 \
    crate://crates.io/ws2_32-sys/0.2.1 \
"



# FIXME: update generateme with the real MD5 of the license file
LIC_FILES_CHKSUM = " \
    file://LICENSE;md5=b0249af598633524d7f0cb5b558c832c \
"

SUMMARY = "Command-line client for web sockets, like netcat/curl/socat for ws://."
HOMEPAGE = "https://github.com/vi/websocat"
LICENSE = "MIT"

# includes this file if it exists but does not fail
# this is useful for anything you may want to override from
# what cargo-bitbake generates.
include websocat-${PV}.inc
include websocat.inc
@jwinarske
Copy link

One method to handle this is to append RUST_PANIC_STRATEGY = "abort" to your local.conf and rebuild the recipe. It will re-trigger build of rust-native, cargo-native, and libstd-rs. The default strategy is set for unwind

@nateglims
Copy link

nateglims commented Sep 30, 2021

I'm seeing this if I set RUST_PANIC_STRATEGY to abort in local.conf on x86-64 (or if the crate sets it). But it is working on arm64. I was able to reproduce it on master with poky master and the rust-hello-world recipe.

@nateglims
Copy link

ah nevermind. I tried to set up a minimal build and it worked.

@frankplus
Copy link

adding RUST_PANIC_STRATEGY = "abort" to local.conf did not work for me

@frankplus
Copy link

even with the simplest hello world with panic abort is not working
https://github.com/frankplus/rust-hello-world

@jwinarske
Copy link

@frankplus I believe my suggestion was for 1.51. what version/branch are you having trouble with? Also honister implements rust in OE-core, so if you can replicate there Yocto list can help.

@frankplus
Copy link

The problem appears on both dunfell (with meta-rust) and honister (with rust in oe-core)

@frankplus
Copy link

@nateglims
Copy link

nateglims commented May 20, 2022

Part of this seems to stem from the cargo features set in libstd [1] enabling panic_unwind in the std crate [2]. By setting CARGO_FEATURES = "backtrace" in my local.conf I was able to get past this but I haven't verified if the panic behavior is working.

[1] https://git.yoctoproject.org/poky/tree/meta/recipes-devtools/rust/libstd-rs.inc#n22
[2] https://github.com/rust-lang/rust/blob/master/library/std/Cargo.toml#L59

@jwinarske
Copy link

I have built a number of things against Kirkstone without issue, and no need to override anything.

Example Kirkstone recipe:
https://github.com/meta-flutter/meta-flutter/blob/kirkstone/recipes-devtools/membrane/membrane-dart-example_git.bb

Requires only bbappend (proc2 workaround):
https://github.com/meta-flutter/meta-flutter/blob/kirkstone/recipes-devtools/rust/libstd-rs_%25.bbappend

@nateglims
Copy link

nateglims commented May 20, 2022

I don't see an attempt to use abort as the panic mechanism in that example, but I might be missing it.

Another observation is that this build time issue occurs for x86-64 target arch but not arm64.

@jwinarske
Copy link

Building with kirkstone I don't have to set the strategy, as the strategy defaults to unwind: https://git.openembedded.org/openembedded-core/tree/meta/classes/rust-common.bbclass?h=kirkstone#n14

Changing the strategy affects all rust recipes in the image. Using panic abort leaves no cookie crumbs in the syslog, which is why unwind is preferred. So my point is that with kirkstone tip of tree, it should just work.

For kirkstone dynamic layers aren't used for rust recipes, as it's now part of oe-core.

@nateglims
Copy link

nateglims commented May 20, 2022

That's a good point, my suggestion is definitely a hack. This issue is coming up when a crate sets its panic to abort which they may or may not have a good reason to set. Mozjs just patched out panics in the Cargo.toml file, but that might not work for every situation.

Websocat, from the OP, set's it's panic type: https://github.com/vi/websocat/blob/master/Cargo.toml#L112
Firecracker, provided in meta-aws, does too: https://github.com/firecracker-microvm/firecracker/blob/main/Cargo.toml#L9

My understanding for a normal rustup setup is they ship a pre-built std library, so I'm not really clear why this cargo feature setting matters. I'm mostly bumping into the std-aware cargo workgroup, the rustc development manual and some nightly features when I search for this.

@jwinarske
Copy link

Yes I contributed the firecracker recipe to meta-aws, so I'm pretty familiar with it.

@moto-timo
Copy link

I have built a number of things against Kirkstone without issue, and no need to override anything.

Example Kirkstone recipe: https://github.com/meta-flutter/meta-flutter/blob/kirkstone/recipes-devtools/membrane/membrane-dart-example_git.bb

Requires only bbappend (proc2 workaround): https://github.com/meta-flutter/meta-flutter/blob/kirkstone/recipes-devtools/rust/libstd-rs_%25.bbappend

These are now deadlinks.

@jwinarske
Copy link

@moto-timo Hi Tim.
I recently removed the membrane-dart-example due to upstream issue, but it can be found here:
https://github.com/meta-flutter/meta-flutter/blob/e08c45c6b8c961734e7be9745e0f1ea344fa5ea8/dynamic-layers/clang-layer/recipes-devtools/membrane/membrane-example_git.bb

The bbappend was removed as Proc2 issue goes away with Scott's Rust toolchain mix-in (1.69+). So I opted to let people manage their own pain :)
https://github.com/meta-flutter/meta-flutter/blob/e08c45c6b8c961734e7be9745e0f1ea344fa5ea8/recipes-devtools/rust/libstd-rs_%25.bbappend

@moto-timo
Copy link

moto-timo commented Mar 28, 2024

I recently removed the membrane-dart-example due to upstream issue, but it can be found here:
https://github.com/meta-flutter/meta-flutter/blob/e08c45c6b8c961734e7be9745e0f1ea344fa5ea8/dynamic-layers/clang-layer/recipes-devtools/membrane/membrane-example_git.bb

This recipe can be greatly simplified by using the cargo-update-recipe-crates.bbclass. I'm also trying to find the time to add knowledge of that bbclass into devtool/recipetool so the Auto Upgrade Helper (AUH) will be aware of it. Baby steps.

@jwinarske
Copy link

@moto-timo I'll check it out. I have a number of very complicated rust recipes. One has over 800 crates, curious how the helper bbclass will fare.

This has been my go-to pattern (generic non-multipass repos):

  • Rustup host toolchain to match Yocto version
  • Delete tool chain version file, or update to match Yocto toolchain
  • delete cargo.lock file (likely it may vary otherwise)
  • build standalone host. Forces correct cargo.lock
  • Run tool to generate/update the src list:
    https://github.com/jwinarske/root-pkg-ws

The multi-pass like this membrane recipe uses llvm and dart for native pass (code gen), then native build artifacts for target pass. It looks like the referenced bbclass may replace my root-pkg-ws tool. That would be nice. I'm all for making the Yocto rust support better!

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

No branches or pull requests

5 participants