From a379a9557836dde63038f85db371545027cc94e5 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 26 Mar 2024 17:28:27 +0100 Subject: [PATCH 1/4] test-cargo-miri: add proc-macro2 instead of anyhow --- src/tools/miri/test-cargo-miri/Cargo.lock | 8 +------- src/tools/miri/test-cargo-miri/Cargo.toml | 9 +++++---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/tools/miri/test-cargo-miri/Cargo.lock b/src/tools/miri/test-cargo-miri/Cargo.lock index 8cc85c014a1..4e962f6c768 100644 --- a/src/tools/miri/test-cargo-miri/Cargo.lock +++ b/src/tools/miri/test-cargo-miri/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "anyhow" -version = "1.0.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" - [[package]] name = "autocfg" version = "1.1.0" @@ -30,7 +24,6 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" name = "cargo-miri-test" version = "0.1.0" dependencies = [ - "anyhow", "autocfg", "byteorder 0.5.3", "byteorder 1.4.3", @@ -42,6 +35,7 @@ dependencies = [ "issue_1705", "issue_1760", "issue_rust_86261", + "proc-macro2", "serde_derive", ] diff --git a/src/tools/miri/test-cargo-miri/Cargo.toml b/src/tools/miri/test-cargo-miri/Cargo.toml index c0f7362ca85..64ccb5ae006 100644 --- a/src/tools/miri/test-cargo-miri/Cargo.toml +++ b/src/tools/miri/test-cargo-miri/Cargo.toml @@ -20,12 +20,13 @@ issue_rust_86261 = { path = "issue-rust-86261" } [dev-dependencies] byteorder_2 = { package = "byteorder", version = "0.5" } # to test dev-dependencies behave as expected, with renaming -# Not actually used, but exercises some unique code path (`--extern` .so file). +## More dependencies that we don't actually use, but add just for extra test coverage. +# Exercises some unique code path (`--extern` .so file). serde_derive = "1.0.185" -# Not actually used, but uses a custom build probe so let's make sure that works. +# These use custom build probes, let's make sure they don't explode. # (Ideally we'd check if the probe was successful, but that's not easily possible.) -anyhow = "1.0" -# Same as anyhow. +# proc-macro2 is extra exciting because it is both a host-dependency and a target-dependency. +proc-macro2 = "1.0" eyre = "0.6" [build-dependencies] From 08c149b73f29f255f3b90178f9fe50838829593f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 26 Mar 2024 17:41:08 +0100 Subject: [PATCH 2/4] rename our proc-macro test crate to a more clear name and remove serde_derive, since the --extern .so file was really just a consequence of building a proc macro --- src/tools/miri/test-cargo-miri/Cargo.lock | 35 ++----------------- src/tools/miri/test-cargo-miri/Cargo.toml | 7 ++-- .../test-cargo-miri/issue-1760/Cargo.toml | 8 ----- .../proc-macro-crate/Cargo.toml | 13 +++++++ .../{issue-1760 => proc-macro-crate}/build.rs | 0 .../src/lib.rs | 0 src/tools/miri/test-cargo-miri/src/lib.rs | 2 +- 7 files changed, 20 insertions(+), 45 deletions(-) delete mode 100644 src/tools/miri/test-cargo-miri/issue-1760/Cargo.toml create mode 100644 src/tools/miri/test-cargo-miri/proc-macro-crate/Cargo.toml rename src/tools/miri/test-cargo-miri/{issue-1760 => proc-macro-crate}/build.rs (100%) rename src/tools/miri/test-cargo-miri/{issue-1760 => proc-macro-crate}/src/lib.rs (100%) diff --git a/src/tools/miri/test-cargo-miri/Cargo.lock b/src/tools/miri/test-cargo-miri/Cargo.lock index 4e962f6c768..a3cd2aa35fe 100644 --- a/src/tools/miri/test-cargo-miri/Cargo.lock +++ b/src/tools/miri/test-cargo-miri/Cargo.lock @@ -33,10 +33,9 @@ dependencies = [ "issue_1567", "issue_1691", "issue_1705", - "issue_1760", "issue_rust_86261", "proc-macro2", - "serde_derive", + "proc_macro_crate", ] [[package]] @@ -91,10 +90,6 @@ dependencies = [ "byteorder 1.4.3", ] -[[package]] -name = "issue_1760" -version = "0.1.0" - [[package]] name = "issue_rust_86261" version = "0.1.0" @@ -115,25 +110,12 @@ dependencies = [ ] [[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +name = "proc_macro_crate" +version = "0.1.0" dependencies = [ "proc-macro2", ] -[[package]] -name = "serde_derive" -version = "1.0.185" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "subcrate" version = "0.1.0" @@ -141,17 +123,6 @@ dependencies = [ "byteorder 1.4.3", ] -[[package]] -name = "syn" -version = "2.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "unicode-ident" version = "1.0.6" diff --git a/src/tools/miri/test-cargo-miri/Cargo.toml b/src/tools/miri/test-cargo-miri/Cargo.toml index 64ccb5ae006..bfef388669d 100644 --- a/src/tools/miri/test-cargo-miri/Cargo.toml +++ b/src/tools/miri/test-cargo-miri/Cargo.toml @@ -12,20 +12,19 @@ edition = "2018" byteorder = "1.0" cdylib = { path = "cdylib" } exported_symbol = { path = "exported-symbol" } +proc_macro_crate = { path = "proc-macro-crate" } issue_1567 = { path = "issue-1567" } issue_1691 = { path = "issue-1691" } issue_1705 = { path = "issue-1705" } -issue_1760 = { path = "issue-1760" } issue_rust_86261 = { path = "issue-rust-86261" } [dev-dependencies] byteorder_2 = { package = "byteorder", version = "0.5" } # to test dev-dependencies behave as expected, with renaming ## More dependencies that we don't actually use, but add just for extra test coverage. -# Exercises some unique code path (`--extern` .so file). -serde_derive = "1.0.185" # These use custom build probes, let's make sure they don't explode. # (Ideally we'd check if the probe was successful, but that's not easily possible.) -# proc-macro2 is extra exciting because it is both a host-dependency and a target-dependency. +# proc-macro2 is extra exciting because it is both a host-dependency (of proc_macro_crate above) +# and a target-dependency. proc-macro2 = "1.0" eyre = "0.6" diff --git a/src/tools/miri/test-cargo-miri/issue-1760/Cargo.toml b/src/tools/miri/test-cargo-miri/issue-1760/Cargo.toml deleted file mode 100644 index 80925c74746..00000000000 --- a/src/tools/miri/test-cargo-miri/issue-1760/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "issue_1760" -version = "0.1.0" -authors = ["Miri Team"] -edition = "2018" - -[lib] -proc-macro = true diff --git a/src/tools/miri/test-cargo-miri/proc-macro-crate/Cargo.toml b/src/tools/miri/test-cargo-miri/proc-macro-crate/Cargo.toml new file mode 100644 index 00000000000..89652f9b042 --- /dev/null +++ b/src/tools/miri/test-cargo-miri/proc-macro-crate/Cargo.toml @@ -0,0 +1,13 @@ +[package] +# regression test for issue 1760 +name = "proc_macro_crate" +version = "0.1.0" +authors = ["Miri Team"] +edition = "2018" + +[lib] +proc-macro = true + +[dependencies] +# A common dependency of proc macros, let's make sure that works. +proc-macro2 = "1.0" diff --git a/src/tools/miri/test-cargo-miri/issue-1760/build.rs b/src/tools/miri/test-cargo-miri/proc-macro-crate/build.rs similarity index 100% rename from src/tools/miri/test-cargo-miri/issue-1760/build.rs rename to src/tools/miri/test-cargo-miri/proc-macro-crate/build.rs diff --git a/src/tools/miri/test-cargo-miri/issue-1760/src/lib.rs b/src/tools/miri/test-cargo-miri/proc-macro-crate/src/lib.rs similarity index 100% rename from src/tools/miri/test-cargo-miri/issue-1760/src/lib.rs rename to src/tools/miri/test-cargo-miri/proc-macro-crate/src/lib.rs diff --git a/src/tools/miri/test-cargo-miri/src/lib.rs b/src/tools/miri/test-cargo-miri/src/lib.rs index e6b8c4ef65b..003341d0974 100644 --- a/src/tools/miri/test-cargo-miri/src/lib.rs +++ b/src/tools/miri/test-cargo-miri/src/lib.rs @@ -28,9 +28,9 @@ /// ``` #[no_mangle] pub fn make_true() -> bool { + proc_macro_crate::use_the_dependency!(); issue_1567::use_the_dependency(); issue_1705::use_the_dependency(); - issue_1760::use_the_dependency!(); issue_1691::use_me() } From 673ff09d6db6ea05dd4a22cabd7b5c9e38d8f964 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 26 Mar 2024 18:14:14 +0100 Subject: [PATCH 3/4] update proc-macro2 --- src/tools/miri/test-cargo-miri/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/miri/test-cargo-miri/Cargo.lock b/src/tools/miri/test-cargo-miri/Cargo.lock index a3cd2aa35fe..29b08eb5a0e 100644 --- a/src/tools/miri/test-cargo-miri/Cargo.lock +++ b/src/tools/miri/test-cargo-miri/Cargo.lock @@ -102,9 +102,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] From f1519144f285da1161ee8e470acc909bb194b3f3 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 26 Mar 2024 19:01:51 +0100 Subject: [PATCH 4/4] update the remaining test-cargo-miri dependencies as well (while we are at it) --- src/tools/miri/test-cargo-miri/Cargo.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/tools/miri/test-cargo-miri/Cargo.lock b/src/tools/miri/test-cargo-miri/Cargo.lock index 29b08eb5a0e..4783f79ea8f 100644 --- a/src/tools/miri/test-cargo-miri/Cargo.lock +++ b/src/tools/miri/test-cargo-miri/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "byteorder" @@ -16,9 +16,9 @@ checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cargo-miri-test" @@ -26,7 +26,7 @@ version = "0.1.0" dependencies = [ "autocfg", "byteorder 0.5.3", - "byteorder 1.4.3", + "byteorder 1.5.0", "cdylib", "exported_symbol", "eyre", @@ -42,7 +42,7 @@ dependencies = [ name = "cdylib" version = "0.1.0" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", ] [[package]] @@ -76,7 +76,7 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" name = "issue_1567" version = "0.1.0" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", ] [[package]] @@ -87,7 +87,7 @@ version = "0.1.0" name = "issue_1705" version = "0.1.0" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", ] [[package]] @@ -120,11 +120,11 @@ dependencies = [ name = "subcrate" version = "0.1.0" dependencies = [ - "byteorder 1.4.3", + "byteorder 1.5.0", ] [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"