Skip to content

Build fails on FreeBSD 14.3 #8318

@mmayer

Description

@mmayer

Under certain conditions, building coreutils on FreeBSD 14.3 fails. This is with

$ rustc --version
rustc 1.88.0 (6b00bc388 2025-06-23) (built from a source tarball)

If I run

make PROFILE=release MULTICALL=y

on my FreeBSD 14.3 box, the build eventually fails with:

[...]
   Compiling ctor v0.4.2
   Compiling uu_ls v0.1.0 (/home/markus/Developer/coreutils/src/uu/ls)
   Compiling bitvec v1.0.1
error: failed to run custom build command for `fts-sys v0.2.16`

Caused by:
  process didn't exit successfully: `/home/markus/Developer/coreutils/target/release/build/fts-sys-144c9c8bab512dd3/build-script-build` (exit status: 101)
  --- stdout
  cargo:root=/home/markus/Developer/coreutils/target/release/build/fts-sys-983a115c226f6993/out
  cargo:rerun-if-env-changed=SYSROOT_x86_64-unknown-freebsd
  cargo:rerun-if-env-changed=SYSROOT_x86_64_unknown_freebsd
  cargo:rerun-if-env-changed=TARGET_SYSROOT
  cargo:rerun-if-env-changed=SYSROOT
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-freebsd
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_freebsd
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
  cargo:rerun-if-changed=src/fts-sys.h

  --- stderr

  thread 'main' panicked at /home/markus/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bindgen-0.71.1/lib.rs:604:27:
  Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

At the same time, running

$ cargo build --release --features unix

works just fine.

It is worth noting that there is no libclang.so under FreeBSD. I am not sure why it is trying to use it during the build with "make" and why it is different to the build with "cargo".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions