From 2d7f22e31bb792acb491141bf62b3fd4f62f9e46 Mon Sep 17 00:00:00 2001 From: oisupov Date: Mon, 29 Apr 2024 22:57:23 +0700 Subject: [PATCH] Rework spin deletion --- .../rust/chromium_crates_io/Cargo.lock | 8 +++++++ .../rust/chromium_crates_io/gnrt_config.toml | 5 +++- ..._std-for-lazy_static-in-pasta_curves.patch | 24 ------------------- .../vendor/pasta_curves-0.5.1/Cargo.toml | 1 + .../vendor/spin-0.5.2/.cargo-checksum.json | 1 + .../vendor/spin-0.5.2/Cargo.toml | 16 +++++++++++++ .../vendor/spin-0.5.2/src/lib.rs | 9 +++++++ 7 files changed, 39 insertions(+), 25 deletions(-) delete mode 100644 third_party/rust/chromium_crates_io/patches/pasta_curves-0.5.1/0001-Remove-spin_no_std-for-lazy_static-in-pasta_curves.patch create mode 100644 third_party/rust/chromium_crates_io/vendor/spin-0.5.2/.cargo-checksum.json create mode 100644 third_party/rust/chromium_crates_io/vendor/spin-0.5.2/Cargo.toml create mode 100644 third_party/rust/chromium_crates_io/vendor/spin-0.5.2/src/lib.rs diff --git a/third_party/rust/chromium_crates_io/Cargo.lock b/third_party/rust/chromium_crates_io/Cargo.lock index f66ff819cf5c..08fa4c7c7c92 100644 --- a/third_party/rust/chromium_crates_io/Cargo.lock +++ b/third_party/rust/chromium_crates_io/Cargo.lock @@ -1309,6 +1309,9 @@ dependencies = [ [[package]] name = "lazy_static" version = "1.4.0" +dependencies = [ + "spin", +] [[package]] name = "lazycell" @@ -2303,6 +2306,11 @@ dependencies = [ "speedreader", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "sta-rs" version = "0.3.0" diff --git a/third_party/rust/chromium_crates_io/gnrt_config.toml b/third_party/rust/chromium_crates_io/gnrt_config.toml index 6cd41296612b..82bd893f2d28 100644 --- a/third_party/rust/chromium_crates_io/gnrt_config.toml +++ b/third_party/rust/chromium_crates_io/gnrt_config.toml @@ -76,7 +76,10 @@ config_template = "vet_config.toml.hbs" [resolve] root = "chromium" -remove_crates = ['cc', 'link-cplusplus', 'wasi', 'winapi-i686-pc-windows-gnu', 'winapi-x86_64-pc-windows-gnu', 'minimal-lexical'] +# spin is added by pasta-curves lazy_static/spin_no_std, but we don't want to +# use it and lazy_static is an upstream crate with a patch.crates-io so the +# feature (and dependency) do not get added to the build anyway +remove_crates = ['cc', 'link-cplusplus', 'wasi', 'winapi-i686-pc-windows-gnu', 'winapi-x86_64-pc-windows-gnu', 'minimal-lexical', 'spin'] [crate.bitvec] extra_input_roots = ['../doc', '../README.md' ] diff --git a/third_party/rust/chromium_crates_io/patches/pasta_curves-0.5.1/0001-Remove-spin_no_std-for-lazy_static-in-pasta_curves.patch b/third_party/rust/chromium_crates_io/patches/pasta_curves-0.5.1/0001-Remove-spin_no_std-for-lazy_static-in-pasta_curves.patch deleted file mode 100644 index a37c3ec8a666..000000000000 --- a/third_party/rust/chromium_crates_io/patches/pasta_curves-0.5.1/0001-Remove-spin_no_std-for-lazy_static-in-pasta_curves.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 6c2fb69094126dd4f36b8dfa45d81b1a1ea6893a Mon Sep 17 00:00:00 2001 -From: oisupov -Date: Wed, 17 Apr 2024 23:30:37 +0700 -Subject: [PATCH] Remove spin_no_std for lazy_static in pasta_curves - ---- - .../rust/chromium_crates_io/vendor/pasta_curves-0.5.1/Cargo.toml | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/third_party/rust/chromium_crates_io/vendor/pasta_curves-0.5.1/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/pasta_curves-0.5.1/Cargo.toml -index 72b348ecb47..97a8363b582 100644 ---- a/third_party/rust/chromium_crates_io/vendor/pasta_curves-0.5.1/Cargo.toml -+++ b/third_party/rust/chromium_crates_io/vendor/pasta_curves-0.5.1/Cargo.toml -@@ -81,7 +81,6 @@ default-features = false - - [dependencies.lazy_static] - version = "1.4.0" --features = ["spin_no_std"] - optional = true - - [dependencies.rand] --- -2.38.1 - diff --git a/third_party/rust/chromium_crates_io/vendor/pasta_curves-0.5.1/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/pasta_curves-0.5.1/Cargo.toml index 97a8363b582a..72b348ecb470 100644 --- a/third_party/rust/chromium_crates_io/vendor/pasta_curves-0.5.1/Cargo.toml +++ b/third_party/rust/chromium_crates_io/vendor/pasta_curves-0.5.1/Cargo.toml @@ -81,6 +81,7 @@ default-features = false [dependencies.lazy_static] version = "1.4.0" +features = ["spin_no_std"] optional = true [dependencies.rand] diff --git a/third_party/rust/chromium_crates_io/vendor/spin-0.5.2/.cargo-checksum.json b/third_party/rust/chromium_crates_io/vendor/spin-0.5.2/.cargo-checksum.json new file mode 100644 index 000000000000..697c9ce2fbb4 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/spin-0.5.2/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{}} diff --git a/third_party/rust/chromium_crates_io/vendor/spin-0.5.2/Cargo.toml b/third_party/rust/chromium_crates_io/vendor/spin-0.5.2/Cargo.toml new file mode 100644 index 000000000000..43a506543b6b --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/spin-0.5.2/Cargo.toml @@ -0,0 +1,16 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# @generated from third_party/rust/chromium_crates_io/removed_Cargo.toml +# by tools/crates/gnrt. Do not edit! + +# This is an empty crate that has replaced the 'spin' crate, since +# it was listed in `resolve.remove_crates` in gnrt_config.toml. + +[package] +name = "spin" +version = "0.5.2" + +[features] + diff --git a/third_party/rust/chromium_crates_io/vendor/spin-0.5.2/src/lib.rs b/third_party/rust/chromium_crates_io/vendor/spin-0.5.2/src/lib.rs new file mode 100644 index 000000000000..6b8f21c9b344 --- /dev/null +++ b/third_party/rust/chromium_crates_io/vendor/spin-0.5.2/src/lib.rs @@ -0,0 +1,9 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// @generated from third_party/rust/chromium_crates_io/removed_lib.rs +// by tools/crates/gnrt. Do not edit! + +// This is an empty crate that has replaced the 'spin' crate, since +// it was listed in `resolve.remove_crates` in gnrt_config.toml.