ripgrep: fails to build
Open
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 4.6k
- Forks
- 4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 134
Description
ripgrep fails to build:
Compiling tikv-jemallocator v0.6.0
Running `rustc --crate-name tikv_jemallocator --edition=2018 /tmp/builddir/openwrt/dl/cargo/registry/src/index.crates.io-6f17d22bba15001f/tikv-jemallocator-0.6.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 --cfg 'feature="background_threads_runtime_support"' --cfg 'feature="default"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("alloc_trait", "background_threads", "background_threads_runtime_support", "debug", "default", "disable_initial_exec_tls", "profiling", "stats", "unprefixed_malloc_on_supported_platforms"))' -C metadata=70a9254770d5947a -C extra-filename=-70a9254770d5947a --out-dir /tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps --target aarch64-unknown-linux-musl -C linker=aarch64-openwrt-linux-musl-gcc -C strip=symbols -L dependency=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps -L dependency=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/release-lto/deps --extern libc=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/liblibc-a72de163a483f5eb.rmeta --extern tikv_jemalloc_sys=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libtikv_jemalloc_sys-744b0917a9204522.rmeta --cap-lints allow -Ctarget-feature=-crt-static -lssp_nonshared -Clink-arg=-fuse-ld=bfd -L native=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/build/tikv-jemalloc-sys-ccb7248d3f85e334/out/build/lib`
Running `rustc --crate-name rg --edition=2021 crates/core/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=3 -C panic=abort -C lto=fat -C codegen-units=1 --cfg 'feature="pcre2"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("pcre2"))' -C metadata=6a3e46a7e8611d0f -C extra-filename=-6a3e46a7e8611d0f --out-dir /tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps --target aarch64-unknown-linux-musl -C linker=aarch64-openwrt-linux-musl-gcc -C strip=symbols -L dependency=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps -L dependency=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/release-lto/deps --extern anyhow=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libanyhow-d37cd6bc94c3653c.rlib --extern bstr=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libbstr-09c32a2bd2f0a05a.rlib --extern grep=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libgrep-b83e2ee55565ae73.rlib --extern ignore=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libignore-95fcc15e489429b3.rlib --extern lexopt=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/liblexopt-285fcac2baef7f05.rlib --extern log=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/liblog-7fe10c4a2839d5f6.rlib --extern serde_json=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libserde_json-020869d0d7bbd55b.rlib --extern termcolor=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libtermcolor-7d4c773a64ea3abe.rlib --extern textwrap=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libtextwrap-17d103572bec7d95.rlib --extern tikv_jemallocator=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libtikv_jemallocator-70a9254770d5947a.rlib -Ctarget-feature=-crt-static -lssp_nonshared -Clink-arg=-fuse-ld=bfd -L native=/tmp/builddir/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/lib -L native=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/build/tikv-jemalloc-sys-ccb7248d3f85e334/out/build/lib`
error: linking with `aarch64-openwrt-linux-musl-gcc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/tmp/builddir/openwrt/staging_dir/target-aarch64_cortex-a53_musl/host/lib/rustlib/x86_64-unknown-linux-gnu/bin:/tmp/builddir/openwrt/staging_dir/target-aarch64_cortex-a53_musl/host/bin:/tmp/builddir/openwrt/staging_dir/hostpkg/bin:/tmp/builddir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/bin:/tmp/builddir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/bin:/tmp/builddir/openwrt/staging_dir/host/bin:/tmp/builddir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/bin:/tmp/builddir/openwrt/staging_dir/host/bin:/tmp/builddir/openwrt/staging_dir/host/bin:/home/christian/.local/bin:/home/christian/.local/bin:/home/christian/.local/bin:/home/christian/.cargo/bin:/home/christian/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/sbin:/sbin" VSLANG="1033" "aarch64-openwrt-linux-musl-gcc" "/tmp/builddir/openwrt/tmp/rustcz0nBAC/symbols.o" "/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/rg-6a3e46a7e8611d0f.rg.912c941f88844578-cgu.0.rcgu.o" "-Wl,--as-needed" "-Wl,-Bdynamic" "-lssp_nonshared" "-Wl,-Bstatic" "/tmp/builddir/openwrt/tmp/rustcz0nBAC/libtikv_jemalloc_sys-744b0917a9204522.rlib" "/tmp/builddir/openwrt/staging_dir/target-aarch64_cortex-a53_musl/host/lib/rustlib/aarch64-unknown-linux-musl/lib/libcompiler_builtins-d4f294a42331e887.rlib" "-Wl,-Bdynamic" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lpcre2-8" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lssp_nonshared" "-lgcc_s" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/tmp/builddir/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/lib" "-L" "/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/build/tikv-jemalloc-sys-ccb7248d3f85e334/out/build/lib" "-L" "/tmp/builddir/openwrt/staging_dir/target-aarch64_cortex-a53_musl/host/lib/rustlib/aarch64-unknown-linux-musl/lib" "-o" "/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/rg-6a3e46a7e8611d0f" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-all" "-nodefaultlibs" "-fuse-ld=bfd"
= note: /tmp/builddir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld.bfd: /tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/rg-6a3e46a7e8611d0f.rg.912c941f88844578-cgu.0.rcgu.o: in function `<core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next':
rg.912c941f88844578-cgu.0:(.text._ZN102_$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h288cba339b30d3ccE+0xe4): undefined reference to `_rjem_sdallocx'
/tmp/builddir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld.bfd: rg.912c941f88844578-cgu.0:(.text._ZN102_$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h288cba339b30d3ccE+0xf4): undefined reference to `_rjem_sdallocx'
[...]
/tmp/builddir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld.bfd: rg.912c941f88844578-cgu.0:(.text._ZN4core5slice4sort6stable14driftsort_main17h93f8a8c7a278c6c1E+0x118): undefined reference to `_rjem_sdallocx'
/tmp/builddir/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/lib/gcc/aarch64-openwrt-linux-musl/13.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld.bfd: /tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/rg-6a3e46a7e8611d0f.rg.912c941f88844578-cgu.0.rcgu.o: in function `OUTLINED_FUNCTION_4':
rg.912c941f88844578-cgu.0:(.text.OUTLINED_FUNCTION_4+0xc): undefined reference to `_rjem_sdallocx'
collect2: error: ld returned 1 exit status
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
error: could not compile `ripgrep` (bin "rg") due to 1 previous error
Caused by:
process didn't exit successfully: `rustc --crate-name rg --edition=2021 crates/core/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=3 -C panic=abort -C lto=fat -C codegen-units=1 --cfg 'feature="pcre2"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("pcre2"))' -C metadata=6a3e46a7e8611d0f -C extra-filename=-6a3e46a7e8611d0f --out-dir /tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps --target aarch64-unknown-linux-musl -C linker=aarch64-openwrt-linux-musl-gcc -C strip=symbols -L dependency=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps -L dependency=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/release-lto/deps --extern anyhow=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libanyhow-d37cd6bc94c3653c.rlib --extern bstr=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libbstr-09c32a2bd2f0a05a.rlib --extern grep=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libgrep-b83e2ee55565ae73.rlib --extern ignore=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libignore-95fcc15e489429b3.rlib --extern lexopt=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/liblexopt-285fcac2baef7f05.rlib --extern log=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/liblog-7fe10c4a2839d5f6.rlib --extern serde_json=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libserde_json-020869d0d7bbd55b.rlib --extern termcolor=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libtermcolor-7d4c773a64ea3abe.rlib --extern textwrap=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libtextwrap-17d103572bec7d95.rlib --extern tikv_jemallocator=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/deps/libtikv_jemallocator-70a9254770d5947a.rlib -Ctarget-feature=-crt-static -lssp_nonshared -Clink-arg=-fuse-ld=bfd -L native=/tmp/builddir/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/lib -L native=/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target/aarch64-unknown-linux-musl/release-lto/build/tikv-jemalloc-sys-ccb7248d3f85e334/out/build/lib` (exit status: 1)
error: failed to compile `ripgrep v14.1.1 (/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1)`, intermediate artifacts can be found at `/tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
make[3]: *** [Makefile:50: /tmp/builddir/openwrt/build_dir/target-aarch64_cortex-a53_musl/ripgrep-14.1.1/.built] Error 101
ERROR: package/feeds/packages/ripgrep failed to build.
make[2]: *** [package/Makefile:185: package/feeds/packages/ripgrep/compile] Error 1
[error.log](https://github.com/user-attachments/files/18456223/error.log)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OpenWrt package definition and the ripgrep 14.1.1 Rust build invocation shown in the report. Reproduce the aarch64-unknown-linux-musl build and investigate why tikv-jemallocator does not provide _rjem_sdallocx at link time. Done means ripgrep links successfully for this target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100