Commit 101549d
authored
Never include use extra-filename in build scripts (#16855)
### What does this PR try to resolve?
See: #16854
This is that in #16812 we stopped adding the metadata hash to build
script names and just call them `build_script_build[EXE]` since they are
already contained within a directory with the hash.
However, I didn't take into consideration
`__CARGO_DEFAULT_LIB_METADATA`, so if it is passed with a build script
in the build graph it will get the wrong path
(`build_script_build-[HASH][EXE]`) when it tries to execute and fail.
Looking at [the
comments](https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/build_runner/compilation_files.rs#L922)
about `__CARGO_DEFAULT_LIB_METADATA` I get the impression there is no
usecase for using it with a build script.
So I modified the logic to never include the meta in the build script
file names even when `__CARGO_DEFAULT_LIB_METADATA`.
Let me know if this is a bad assumption.
### How to test and review this PR?
See the included test.
Also double checked on https://github.com/RalfJung/rustc-build-sysroot/
and this change fixes the issue for me
cc: @RalfJung
r? @epage2 files changed
Lines changed: 62 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
917 | 922 | | |
918 | 923 | | |
919 | | - | |
| 924 | + | |
920 | 925 | | |
921 | 926 | | |
922 | 927 | | |
| |||
926 | 931 | | |
927 | 932 | | |
928 | 933 | | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
| 934 | + | |
933 | 935 | | |
934 | 936 | | |
935 | 937 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1219 | 1219 | | |
1220 | 1220 | | |
1221 | 1221 | | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1222 | 1277 | | |
1223 | 1278 | | |
1224 | 1279 | | |
| |||
0 commit comments