Skip to content

Use CARGO_MANIFEST_DIR from buildscript run time#2258

Open
dtolnay wants to merge 1 commit into
tursodatabase:mainfrom
dtolnay-contrib:buildscript
Open

Use CARGO_MANIFEST_DIR from buildscript run time#2258
dtolnay wants to merge 1 commit into
tursodatabase:mainfrom
dtolnay-contrib:buildscript

Conversation

@dtolnay

@dtolnay dtolnay commented Jul 17, 2026

Copy link
Copy Markdown

The libsql-ffi build script is assuming things about Cargo's implementation of build scripts which are not guaranteed by Cargo. In particular, the build script API does not make a guarantee that the following 3 directory paths would necessarily be identical:

  1. the crate's manifest directory during build script compilation
  2. the crate's manifest directory during build script execution
  3. the crate's manifest directory during library compilation

It only guarantees that $CARGO_MANIFEST_DIR will be suitably set during each of the 3 steps. But it could be 3 different values.

The build script in libsql-ffi is taking a path from step 1 and trying to resolve its contents during step 2. That is not going to work in general, for example in an sccache-like remote execution scenario.

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

Successfully merging this pull request may close these issues.

1 participant