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

Add support for riscv64gc-unknown-linux-musl #118

Open
bwbuhse opened this issue Feb 14, 2025 · 6 comments
Open

Add support for riscv64gc-unknown-linux-musl #118

bwbuhse opened this issue Feb 14, 2025 · 6 comments

Comments

@bwbuhse
Copy link

bwbuhse commented Feb 14, 2025

I've got a BananaPi BPI-F3 RISC-V dev board but, right now, this crate does not support it.

$ cargo build
    Updating crates.io index
     Locking 5 packages to latest compatible versions
      Adding cfg-if v0.1.10 (available: v1.0.0)
  Downloaded paste v1.0.15
  Downloaded cfg-if v0.1.10
  Downloaded cc v1.2.14
  Downloaded libc v0.2.169
  Downloaded 4 crates (887.4 KB) in 0.57s
   Compiling shlex v1.3.0
   Compiling libc v0.2.169
   Compiling paste v1.0.15
   Compiling cfg-if v0.1.10
   Compiling cc v1.2.14
   Compiling tikv-jemalloc-sys v0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7 (/home/ben/projects/jemallocator/jemalloc-sys)
warning: [email protected]+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7: "`background_threads_runtime_support` not supported for `riscv64gc-unknown-linux-musl`"
error: failed to run custom build command for `tikv-jemalloc-sys v0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7 (/home/ben/projects/jemallocator/jemalloc-sys)`

Caused by:
  process didn't exit successfully: `/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-770f3ed36c956d07/build-script-build` (exit status: 101)
  --- stdout
  TARGET=riscv64gc-unknown-linux-musl
  HOST=riscv64gc-unknown-linux-musl
  NUM_JOBS=8
  OUT_DIR="/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out"
  BUILD_DIR="/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out/build"
  SRC_DIR="/home/ben/projects/jemallocator/jemalloc-sys"
  cargo:rustc-cfg=prefixed
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_OVERRIDE
  cargo:rerun-if-env-changed=JEMALLOC_OVERRIDE
  OPT_LEVEL = Some(0)
  OUT_DIR = Some(/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out)
  TARGET = Some(riscv64gc-unknown-linux-musl)
  HOST = Some(riscv64gc-unknown-linux-musl)
  cargo:rerun-if-env-changed=CC_riscv64gc-unknown-linux-musl
  CC_riscv64gc-unknown-linux-musl = None
  cargo:rerun-if-env-changed=CC_riscv64gc_unknown_linux_musl
  CC_riscv64gc_unknown_linux_musl = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  CARGO_CFG_TARGET_FEATURE = Some(a,c,m)
  cargo:rerun-if-env-changed=CFLAGS_riscv64gc-unknown-linux-musl
  CFLAGS_riscv64gc-unknown-linux-musl = None
  cargo:rerun-if-env-changed=CFLAGS_riscv64gc_unknown_linux_musl
  CFLAGS_riscv64gc_unknown_linux_musl = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  CARGO_ENCODED_RUSTFLAGS = Some(-Ctarget-feature=-crt-static)
  CC="cc"
  JEMALLOC_REPO_DIR="jemalloc"
  cargo:warning="`background_threads_runtime_support` not supported for `riscv64gc-unknown-linux-musl`"
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_MALLOC_CONF
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_MALLOC_CONF
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_LG_PAGE
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_PAGE
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_LG_HUGEPAGE
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_HUGEPAGE
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_LG_QUANTUM
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_QUANTUM
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_LG_VADDR
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_VADDR
  --with-jemalloc-prefix=_rjem_
  CARGO_FEATURE_STATS not set
  running: cd "/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out/build" && CC="cc" "sh" "/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out/build/configure" "--with-version=5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" "--disable-cxx" "--enable-doc=no" "--enable-shared=no" "--with-jemalloc-prefix=_rjem_" "--with-private-namespace=_rjem_" "--disable-stats" "--host=riscv64-linux-musl" "--build=riscv64-linux-musl" "--prefix=/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out"
  running: "tail" "-n" "100" "/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out/build/config.log"

  --- stderr
  configure: error: cannot find sources (Makefile.in) in /home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out/build or ..
  tail: cannot open '/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out/build/config.log' for reading: No such file or directory
  thread 'main' panicked at jemalloc-sys/build.rs:377:9:
  command did not execute successfully: "tail" "-n" "100" "/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-142fcb918ea6a600/out/build/config.log"
  expected success, got: exit status: 1

upstream jemalloc/jemalloc does support this target.

@bwbuhse
Copy link
Author

bwbuhse commented Feb 15, 2025

I don't know too much Rust, so I don't know what exactly is wrong here. I did try just building the jemalloc-sys crate with --no-default-features, and the message about background_threads_runtime_support went away but it's still failing and I don't know why.

$ cargo build --no-default-features
   Compiling tikv-jemalloc-sys v0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7 (/home/ben/projects/jemallocator/jemalloc-sys)
error: failed to run custom build command for `tikv-jemalloc-sys v0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7 (/home/ben/projects/jemallocator/jemalloc-sys)`

Caused by:
  process didn't exit successfully: `/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-283d855eef9fdc59/build-script-build` (exit status: 101)
  --- stdout
  TARGET=riscv64gc-unknown-linux-musl
  HOST=riscv64gc-unknown-linux-musl
  NUM_JOBS=8
  OUT_DIR="/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out"
  BUILD_DIR="/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out/build"
  SRC_DIR="/home/ben/projects/jemallocator/jemalloc-sys"
  cargo:rustc-cfg=prefixed
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_OVERRIDE
  cargo:rerun-if-env-changed=JEMALLOC_OVERRIDE
  OPT_LEVEL = Some(0)
  OUT_DIR = Some(/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out)
  TARGET = Some(riscv64gc-unknown-linux-musl)
  HOST = Some(riscv64gc-unknown-linux-musl)
  cargo:rerun-if-env-changed=CC_riscv64gc-unknown-linux-musl
  CC_riscv64gc-unknown-linux-musl = None
  cargo:rerun-if-env-changed=CC_riscv64gc_unknown_linux_musl
  CC_riscv64gc_unknown_linux_musl = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  CARGO_CFG_TARGET_FEATURE = Some(a,c,m)
  cargo:rerun-if-env-changed=CFLAGS_riscv64gc-unknown-linux-musl
  CFLAGS_riscv64gc-unknown-linux-musl = None
  cargo:rerun-if-env-changed=CFLAGS_riscv64gc_unknown_linux_musl
  CFLAGS_riscv64gc_unknown_linux_musl = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  CARGO_ENCODED_RUSTFLAGS = Some(-Ctarget-feature=-crt-static)
  CC="cc"
  JEMALLOC_REPO_DIR="jemalloc"
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_MALLOC_CONF
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_MALLOC_CONF
  --with-malloc-conf=background_thread:false
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_LG_PAGE
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_PAGE
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_LG_HUGEPAGE
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_HUGEPAGE
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_LG_QUANTUM
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_QUANTUM
  cargo:rerun-if-env-changed=RISCV64GC_UNKNOWN_LINUX_MUSL_JEMALLOC_SYS_WITH_LG_VADDR
  cargo:rerun-if-env-changed=JEMALLOC_SYS_WITH_LG_VADDR
  --with-jemalloc-prefix=_rjem_
  CARGO_FEATURE_STATS not set
  running: cd "/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out/build" && CC="cc" "sh" "/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out/build/configure" "--with-version=5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" "--disable-cxx" "--enable-doc=no" "--enable-shared=no" "--with-malloc-conf=background_thread:false" "--with-jemalloc-prefix=_rjem_" "--with-private-namespace=_rjem_" "--disable-stats" "--host=riscv64-linux-musl" "--build=riscv64-linux-musl" "--prefix=/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out"
  running: "tail" "-n" "100" "/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out/build/config.log"

  --- stderr
  configure: error: cannot find sources (Makefile.in) in /home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out/build or ..
  tail: cannot open '/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out/build/config.log' for reading: No such file or directory
  thread 'main' panicked at jemalloc-sys/build.rs:377:9:
  command did not execute successfully: "tail" "-n" "100" "/home/ben/projects/jemallocator/target/debug/build/tikv-jemalloc-sys-2b288238b635bf61/out/build/config.log"
  expected success, got: exit status: 1
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@BusyJay
Copy link
Member

BusyJay commented Feb 16, 2025

Did you run git submodule update --init?

@bwbuhse
Copy link
Author

bwbuhse commented Feb 16, 2025

🤦 I did not... sorry. cargo build/test run fine after getting the submodule(s)

I guess it's a ripgrep thing, then? Thanks.

@bwbuhse bwbuhse closed this as completed Feb 16, 2025
@bwbuhse
Copy link
Author

bwbuhse commented Feb 16, 2025

I guess it got added with commit b913c24, but there hasn't been a release since then. Will that be coming at some point?

@bwbuhse bwbuhse reopened this Feb 16, 2025
@BusyJay
Copy link
Member

BusyJay commented Feb 17, 2025

tikv-jemallocator 0.6.0 was released, which should contain the commit. However, due to lack of force merge permission, jemallocator 0.6.0 is not released. Track on #96.

@bwbuhse
Copy link
Author

bwbuhse commented Feb 17, 2025 via email

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

2 participants