buildRustCrate: Make CARGO_MANIFEST_DIR absolute

While it is not obvious from the source, cargo sets CARGO_MANIFEST_DIR to an absolute directory. This let to a build problem with the popular "tera" crate using the "pest" crate.

## Cargo details

The variable is set here:

f7c91ba622/src/cargo/core/compiler/compilation.rs (L229)

and computed from the `manifest_path`:

f7c91ba622/src/cargo/core/package.rs (L163)

The manifest path is also exported via `cargo metadata` where you can see that it is absolute.
This commit is contained in:
Peter Kolloch 2019-03-03 12:02:26 +01:00 committed by GitHub
parent 93ce3df6b5
commit baa3d6f43b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ in ''
export CARGO_CFG_TARGET_POINTER_WIDTH=${toString stdenv.hostPlatform.parsed.cpu.bits}
export CARGO_CFG_TARGET_VENDOR=${stdenv.hostPlatform.parsed.vendor.name}
export CARGO_MANIFEST_DIR="."
export CARGO_MANIFEST_DIR=$(pwd)
export DEBUG="${toString (!release)}"
export OPT_LEVEL="${toString optLevel}"
export TARGET="${stdenv.hostPlatform.config}"