buildRustCrate: fix #78412

`build.rs` files might create files. Those files are supposed to go into
`OUT_DIR` (envirionment variable) and not be overlayed onto the source
tree.
This commit is contained in:
Andreas Rammhold 2020-01-28 14:03:21 +01:00
parent 19698d15ce
commit a57d0fe0bb
No known key found for this signature in database
GPG Key ID: E432E410B5E48C86

View File

@ -137,16 +137,7 @@ in ''
CRATENAME=$(echo ${crateName} | sed -e "s/\(.*\)-sys$/\U\1/")
grep -P "^cargo:(?!(rustc-|warning=|rerun-if-changed=|rerun-if-env-changed))" target/build/${crateName}.opt \
| sed -e "s/cargo:\([^=]*\)=\(.*\)/export DEP_$(echo $CRATENAME)_\U\1\E=\2/" > target/env
set -e
if [[ -n "$(ls target/build/${crateName}.out)" ]]; then
if [[ -e "${libPath}" ]]; then
cp -r target/build/${crateName}.out/* $(dirname ${libPath}) #*/
else
cp -r target/build/${crateName}.out/* src #*/
fi
fi
fi
runHook postConfigure
''