Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 1 | From 8bf0c566387e6a48d854d5f69c43c8bfa45092f9 Mon Sep 17 00:00:00 2001 |
| 2 | From: Alex Kiernan <alexk@zuma.ai> |
| 3 | Date: Sun, 24 Dec 2023 09:40:01 +0000 |
| 4 | Subject: [PATCH] Revert "Map source absolute paths to OUT_DIR as relative. |
| 5 | (#684)" |
| 6 | |
| 7 | This reverts commit c4f414f449bb7cffba3bc923f277704d1d08a8ec. |
| 8 | |
| 9 | Upstream-Status: Inappropriate [patches need rework] |
| 10 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> |
| 11 | --- |
| 12 | src/lib.rs | 22 ++-------------------- |
| 13 | 1 file changed, 2 insertions(+), 20 deletions(-) |
| 14 | |
| 15 | Index: rustc-1.72.0-src/vendor/cc/src/lib.rs |
| 16 | =================================================================== |
| 17 | --- rustc-1.72.0-src.orig/vendor/cc/src/lib.rs |
| 18 | +++ rustc-1.72.0-src/vendor/cc/src/lib.rs |
| 19 | @@ -56,12 +56,11 @@ |
| 20 | #![allow(deprecated)] |
| 21 | #![deny(missing_docs)] |
| 22 | |
| 23 | -use std::collections::{hash_map, HashMap}; |
| 24 | +use std::collections::HashMap; |
| 25 | use std::env; |
| 26 | use std::ffi::{OsStr, OsString}; |
| 27 | use std::fmt::{self, Display, Formatter}; |
| 28 | use std::fs; |
| 29 | -use std::hash::Hasher; |
| 30 | use std::io::{self, BufRead, BufReader, Read, Write}; |
| 31 | use std::path::{Component, Path, PathBuf}; |
| 32 | use std::process::{Child, Command, Stdio}; |
| 33 | @@ -1037,24 +1036,7 @@ impl Build { |
| 34 | |
| 35 | let mut objects = Vec::new(); |
| 36 | for file in self.files.iter() { |
| 37 | - let obj = if file.has_root() { |
| 38 | - // If `file` is an absolute path, prefix the `basename` |
| 39 | - // with the `dirname`'s hash to ensure name uniqueness. |
| 40 | - let basename = file |
| 41 | - .file_name() |
| 42 | - .ok_or_else(|| Error::new(ErrorKind::InvalidArgument, "file_name() failure"))? |
| 43 | - .to_string_lossy(); |
| 44 | - let dirname = file |
| 45 | - .parent() |
| 46 | - .ok_or_else(|| Error::new(ErrorKind::InvalidArgument, "parent() failure"))? |
| 47 | - .to_string_lossy(); |
| 48 | - let mut hasher = hash_map::DefaultHasher::new(); |
| 49 | - hasher.write(dirname.to_string().as_bytes()); |
| 50 | - dst.join(format!("{:016x}-{}", hasher.finish(), basename)) |
| 51 | - .with_extension("o") |
| 52 | - } else { |
| 53 | - dst.join(file).with_extension("o") |
| 54 | - }; |
| 55 | + let obj = dst.join(file).with_extension("o"); |
| 56 | let obj = if !obj.starts_with(&dst) { |
| 57 | dst.join(obj.file_name().ok_or_else(|| { |
| 58 | Error::new(ErrorKind::IOError, "Getting object file details failed.") |
| 59 | Index: rustc-1.72.0-src/vendor/cc/.cargo-checksum.json |
| 60 | =================================================================== |
| 61 | --- rustc-1.72.0-src.orig/vendor/cc/.cargo-checksum.json |
| 62 | +++ rustc-1.72.0-src/vendor/cc/.cargo-checksum.json |
| 63 | @@ -1 +1 @@ |
| 64 | -{"files":{"Cargo.lock":"dddb9c49058d411a098e98dc1c06e3bc89f859a2080d96c11b11aec67394bb8c","Cargo.toml":"1953a8bc4b98e351fe75917c151b1e08a46531d562aebba25a90add4aadecac2","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"58af5106352aafa62175a90f8a5f25fa114028bf909220dc0735d79745999ec1","src/bin/gcc-shim.rs":"36dc4e447428e73c548cc7106ca1e8f282c098463b014e13a729a44445de4880","src/com.rs":"29d0dee08a656ab1a4cc3e5fe24542e0fab5c1373cbc9b05059f7572cf9b8313","src/lib.rs":"17a4659710aa290c4ed9c23063c7b202c5bcf2a84de33aa1f01fc6fded69a1f8","src/registry.rs":"98ae2b71781acc49297e5544fa0cf059f735636f8f1338edef8dbf7232443945","src/setup_config.rs":"72deaf1927c0b713fd5c2b2d5b8f0ea3a303a00fda1579427895cac26a94122d","src/vs_instances.rs":"2d3f8278a803b0e7052f4eeb1979b29f963dd0143f4458e2cb5f33c4e5f0963b","src/winapi.rs":"e128e95b2d39ae7a02f54a7e25d33c488c14759b9f1a50a449e10545856950c3","src/windows_registry.rs":"1f973f804b4b451e48ff6d98ce660355772f164dfdf79a6ae514645c7c764005","tests/cc_env.rs":"e02b3b0824ad039b47e4462c5ef6dbe6c824c28e7953af94a0f28f7b5158042e","tests/cflags.rs":"57f06eb5ce1557e5b4a032d0c4673e18fbe6f8d26c1deb153126e368b96b41b3","tests/cxxflags.rs":"c2c6c6d8a0d7146616fa1caed26876ee7bc9fcfffd525eb4743593cade5f3371","tests/support/mod.rs":"a3c8d116973bb16066bf6ec4de5143183f97de7aad085d85f8118a2eaac3e1e0","tests/test.rs":"61fb35ae6dd5cf506ada000bdd82c92e9f8eac9cc053b63e83d3f897436fbf8f"},"package":"50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"} |
| 65 | \ No newline at end of file |
| 66 | +{"files":{"Cargo.lock":"dddb9c49058d411a098e98dc1c06e3bc89f859a2080d96c11b11aec67394bb8c","Cargo.toml":"1953a8bc4b98e351fe75917c151b1e08a46531d562aebba25a90add4aadecac2","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"58af5106352aafa62175a90f8a5f25fa114028bf909220dc0735d79745999ec1","src/bin/gcc-shim.rs":"36dc4e447428e73c548cc7106ca1e8f282c098463b014e13a729a44445de4880","src/com.rs":"29d0dee08a656ab1a4cc3e5fe24542e0fab5c1373cbc9b05059f7572cf9b8313","src/lib.rs":"dfb36b17362e9a5b266cb19a229d982e8c0bba784b1e99769f690692b0cd5c4e","src/registry.rs":"98ae2b71781acc49297e5544fa0cf059f735636f8f1338edef8dbf7232443945","src/setup_config.rs":"72deaf1927c0b713fd5c2b2d5b8f0ea3a303a00fda1579427895cac26a94122d","src/vs_instances.rs":"2d3f8278a803b0e7052f4eeb1979b29f963dd0143f4458e2cb5f33c4e5f0963b","src/winapi.rs":"e128e95b2d39ae7a02f54a7e25d33c488c14759b9f1a50a449e10545856950c3","src/windows_registry.rs":"1f973f804b4b451e48ff6d98ce660355772f164dfdf79a6ae514645c7c764005","tests/cc_env.rs":"e02b3b0824ad039b47e4462c5ef6dbe6c824c28e7953af94a0f28f7b5158042e","tests/cflags.rs":"57f06eb5ce1557e5b4a032d0c4673e18fbe6f8d26c1deb153126e368b96b41b3","tests/cxxflags.rs":"c2c6c6d8a0d7146616fa1caed26876ee7bc9fcfffd525eb4743593cade5f3371","tests/support/mod.rs":"a3c8d116973bb16066bf6ec4de5143183f97de7aad085d85f8118a2eaac3e1e0","tests/test.rs":"61fb35ae6dd5cf506ada000bdd82c92e9f8eac9cc053b63e83d3f897436fbf8f"},"package":"50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"} |
| 67 | \ No newline at end of file |