Cargo expects libffi-sys v4.1.0 while Linux trixie tells me I have the newest version of libffi-dev installed?

What do you do in such cases provided it is not an error coming from the cargo compiler?

I am trying to install deno using cargo on, using:

$ uname -a
Linux LAPTOP-QS14DNGD 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 GNU/Linux

$ which cargo
/usr/bin/cargo

$ cargo --version
cargo 1.95.0 (f2d3ce0bd 2026-03-21) (built from a source tarball)

$ sudo apt install libffi-dev
libffi-dev is already the newest version (3.7.1-2).

$ sudo dpkg -l | grep libffi
ii  libffi-dev:amd64      3.7.1-2     amd64        Foreign Function Interface library (development files)
ii  libffi8:amd64         3.7.1-2     amd64        Foreign Function Interface library runtime
$

 time( cargo install "${_KD}" --locked > "${_LOG}" 2>&1 ) >> "${_LOG}" 2>&1
 cat "${_LOG}"
 . . .
   Compiling deno_crypto_provider v0.51.0
   Compiling imara-diff v0.2.0
   Compiling ecb v0.1.2
warning: libffi-sys@4.1.0: Configuring libffi failed with exit status: 1
error: failed to run custom build command for `libffi-sys v4.1.0`

Caused by:
  process didn't exit successfully: `/mnt/c/ . . . /cargo/deno/20260813213503.664/release/build/libffi-sys-0619ac91dcd73575/build-script-build` (exit status: 101)
  --- stdout
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... x86_64-pc-linux-gnu
  checking target system type... x86_64-pc-linux-gnu
  continue configure in default builddir "./x86_64-unknown-linux-gnu"
  ....exec /bin/bash .././configure "--srcdir=.." "--enable-builddir=x86_64-unknown-linux-gnu" "linux
  gnu"
  cargo:warning=Configuring libffi failed with exit status: 1

  --- stderr
  .././configure: line 2214: config.log: No such file or directory
  .././configure: line 2224: config.log: No such file or directory
  cat: standard output: No such file or directory

  thread 'main' (40931) panicked at /home/lbrtchx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libffi-sys-4.1.0/build/not_msvc.rs:155:5:
  Configuring libffi: exit status: 1 (cd "/mnt/c/ . . . /tmp/cargo/deno/20260813213503.664/release/build/libffi-sys-0d1a5a2574274e9a/out/libffi-build" && CC="cc" CFLAGS="-O0 -ffunction-sections -fdata-sections -fPIC -m64 -w" LC_ALL="C" "sh" "./configure" "--with-pic" "--disable-shared" "--disable-docs" "--prefix" "/mnt/c/ . . . /tmp/cargo/deno/20260813213503.664/release/build/libffi-sys-0d1a5a2574274e9a/out/libffi-root")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v2.9.5`, intermediate artifacts can be found at `/mnt/c/ . . . /tmp/cargo/deno/20260813213503.664`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_BUILD_BUILD_DIR` to that path.

real	47m0.229s
user	95m58.442s
sys	10m57.125s

~
lbrtchx

You can use triple bqckquotes to mark code blocks, like this:

```
This is code.
Which is readable when formatted like this. 
```

As it is, it is very hard to read your post.

it looks like your source tree is located at an ntfs file system? maybe the autoconf script has compatibility issues with windows paths.

try again from a linux native filesystem.

btw, I think the libffi-sys crate is building libffi from source by default, you need to enable a feature flag for it to link your system installed libffi. but I know nothing about deno, I don't know if deno enabled the feature or not.

Yes, I am running cargo on WSL2 (Windows 11/NTFS). That might explain what the problem is. Let me seek help by the deno community.

You probably want to move the target directory to the internal filesystem of WSL2 rather than use the mount of the host filesystem in /mnt/c.