Skip to content

Commit

Permalink
Update to 1.18.1
Browse files Browse the repository at this point in the history
fix-proc-macro-crate.patch contains a fix for bkchr/proc-macro-crate#48
  • Loading branch information
im-0 committed Feb 1, 2024

Verified

This commit was signed with the committer’s verified signature.
qzed Maximilian Luz
1 parent 5af5941 commit ca9bb39
Showing 9 changed files with 230 additions and 28 deletions.
26 changes: 13 additions & 13 deletions 0001-Replace-bundled-C-C-libraries-with-system-provided.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cdf03ad10c83eb77827b00881f9ed3549b300af7 Mon Sep 17 00:00:00 2001
From 14d8003c18483a6fe25bc0e8873569de50eb45d9 Mon Sep 17 00:00:00 2001
From: Ivan Mironov <mironov.ivan@gmail.com>
Date: Thu, 18 Feb 2021 17:17:32 +0500
Subject: [PATCH 1/3] Replace bundled C/C++ libraries with system provided
Subject: [PATCH 1/5] Replace bundled C/C++ libraries with system provided

---
Cargo.lock | 11 +----------
@@ -12,34 +12,34 @@ Subject: [PATCH 1/3] Replace bundled C/C++ libraries with system provided
5 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index a2a8c340e5af..f1a0435ae837 100644
index 3f849019645c..635100180046 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3520,15 +3520,6 @@ version = "0.1.4"
@@ -3592,15 +3592,6 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a"

-[[package]]
-name = "openssl-src"
-version = "111.25.0+1.1.1t"
-version = "300.1.6+3.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3173cd3626c43e3854b1b727422a276e568d9ec5fe8cec197822cf52cfb743d6"
-checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085"
-dependencies = [
- "cc",
-]
-
[[package]]
name = "openssl-sys"
version = "0.9.92"
@@ -3537,7 +3528,6 @@ checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b"
version = "0.9.99"
@@ -3609,7 +3600,6 @@ checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae"
dependencies = [
"cc",
"libc",
- "openssl-src",
"pkg-config",
"vcpkg",
]
@@ -9138,4 +9128,5 @@ checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b"
@@ -9436,4 +9426,5 @@ checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b"
dependencies = [
"cc",
"libc",
@@ -59,7 +59,7 @@ index 7aee8478b4f1..20398a98b51b 100644
[dev-dependencies]
assert_matches = { workspace = true }
diff --git a/remote-wallet/Cargo.toml b/remote-wallet/Cargo.toml
index 21fecb564b21..0e963a6320db 100644
index 8cea360d7c14..31afed7ee253 100644
--- a/remote-wallet/Cargo.toml
+++ b/remote-wallet/Cargo.toml
@@ -27,7 +27,7 @@ uriparse = { workspace = true }
@@ -68,11 +68,11 @@ index 21fecb564b21..0e963a6320db 100644
[features]
-default = ["linux-static-hidraw", "hidapi"]
+default = ["linux-shared-hidraw", "hidapi"]
linux-static-libusb = ["hidapi/linux-static-libusb"]
linux-static-hidraw = ["hidapi/linux-static-hidraw"]
linux-shared-hidraw = ["hidapi/linux-shared-hidraw"]
linux-shared-libusb = ["hidapi/linux-shared-libusb"]
linux-static-hidraw = ["hidapi/linux-static-hidraw"]
diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml
index 2d15c7acbace..788c4b8626f7 100644
index 355c85859789..b21922dc9237 100644
--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -77,7 +77,7 @@ symlink = { workspace = true }
8 changes: 4 additions & 4 deletions 0002-Manually-vendor-the-patched-crossbeam.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
From e9b52a085b95f9555e79925c52203f94d1365e82 Mon Sep 17 00:00:00 2001
From 87134cc98cd6ded30fcc2425050b54503797de7c Mon Sep 17 00:00:00 2001
From: Ivan Mironov <mironov.ivan@gmail.com>
Date: Tue, 7 Feb 2023 00:07:34 +0100
Subject: [PATCH 2/3] Manually vendor the patched crossbeam
Subject: [PATCH 2/5] Manually vendor the patched crossbeam

Cargo does not support this: https://github.com/rust-lang/cargo/issues/9172
---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Cargo.toml b/Cargo.toml
index 40c7d7494f9a..6d749182c04b 100644
index 657068a42017..678062baafb3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -420,7 +420,7 @@ zstd = "0.11.2"
@@ -435,7 +435,7 @@ zstd = "0.11.2"

[patch.crates-io]
# for details, see https://github.com/solana-labs/crossbeam/commit/fd279d707025f0e60951e429bf778b4813d1b6bf
8 changes: 4 additions & 4 deletions 0003-Manually-vendor-the-patched-tokio.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
From d7e0ad9a246913445d65c65f39f635d37263c96e Mon Sep 17 00:00:00 2001
From b9fc48e55d651c732377a35118c722854bba57a8 Mon Sep 17 00:00:00 2001
From: Ivan Mironov <mironov.ivan@gmail.com>
Date: Thu, 21 Dec 2023 01:17:37 +0100
Subject: [PATCH 3/3] Manually vendor the patched tokio
Subject: [PATCH 3/5] Manually vendor the patched tokio

Cargo does not support this: https://github.com/rust-lang/cargo/issues/9172
---
Cargo.toml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 6d749182c04b..3b4b97feca6a 100644
index 678062baafb3..9739f6902d52 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -463,5 +463,4 @@ solana-zk-token-sdk = { path = "zk-token-sdk" }
@@ -559,5 +559,4 @@ rev = "b500cdc2a920cd5bff9e2dd974d7b97349d61464"
# https://github.com/tokio-rs/tokio/compare/tokio-1.29.1...solana-labs:solana-tokio:tokio-1.29.1-revert-4eed411
#
[patch.crates-io.tokio]
27 changes: 27 additions & 0 deletions 0004-Manually-vendor-the-patched-aes-gcm-siv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From bb6ea70241c8224877506f8971a200d0513506e7 Mon Sep 17 00:00:00 2001
From: Ivan Mironov <mironov.ivan@gmail.com>
Date: Wed, 31 Jan 2024 18:30:46 +0100
Subject: [PATCH 4/5] Manually vendor the patched aes-gcm-siv

Cargo does not support this: https://github.com/rust-lang/cargo/issues/9172
---
Cargo.toml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 9739f6902d52..2fb6fce1e9fb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -508,8 +508,7 @@ solana-zk-token-sdk = { path = "zk-token-sdk" }
# https://github.com/RustCrypto/AEADs/compare/aes-gcm-siv-v0.10.3..6105d7a5591aefa646a95d12b5e8d3f55a9214ef
#
[patch.crates-io.aes-gcm-siv]
-git = "https://github.com/RustCrypto/AEADs"
-rev = "6105d7a5591aefa646a95d12b5e8d3f55a9214ef"
+path = "./AEADs/aes-gcm-siv"

# Our dependency tree has `curve25519-dalek` v3.2.1. They have removed the
# constraint in the next major release. The commit that removes the `zeroize`
--
2.43.0

27 changes: 27 additions & 0 deletions 0005-Manually-vendor-the-patched-curve25519-dalek.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 74fb9e7b08080952d4d26991f12fa327cfbc8e22 Mon Sep 17 00:00:00 2001
From: Ivan Mironov <mironov.ivan@gmail.com>
Date: Wed, 31 Jan 2024 18:32:19 +0100
Subject: [PATCH 5/5] Manually vendor the patched curve25519-dalek

Cargo does not support this: https://github.com/rust-lang/cargo/issues/9172
---
Cargo.toml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 2fb6fce1e9fb..db5a2eeecaca 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -540,8 +540,7 @@ path = "./AEADs/aes-gcm-siv"
# https://github.com/dalek-cryptography/curve25519-dalek/compare/3.2.1...solana-labs:curve25519-dalek:3.2.1-unpin-zeroize
#
[patch.crates-io.curve25519-dalek]
-git = "https://github.com/solana-labs/curve25519-dalek.git"
-rev = "b500cdc2a920cd5bff9e2dd974d7b97349d61464"
+path = "./curve25519-dalek"

# Solana RPC nodes experience stalls when running with `tokio` containing this
# commit:
--
2.43.0

68 changes: 68 additions & 0 deletions bump-rpm-version
Original file line number Diff line number Diff line change
@@ -36,6 +36,8 @@ class _Config(typing.NamedTuple):
new_version: str
crossbeam_commit: str
tokio_commit: str
aes_gcm_siv_commit: str
curve25519_dalek_commit: str
rust_version: str
author: str

@@ -157,11 +159,23 @@ def _main() -> None:
else:
tokio_commit = ''

if (ver[0] > 1) or ((ver[0] == 1) and (ver[1] > 17)):
# if version > 1.17:
aes_gcm_siv_commit = _find_spec_aes_gcm_siv_commit(spec)
skip_patches.add('0004-Manually-vendor-the-patched-aes-gcm-siv.patch')
curve25519_dalek_commit = _find_spec_curve25519_dalek_commit(spec)
skip_patches.add('0005-Manually-vendor-the-patched-curve25519-dalek.patch')
else:
aes_gcm_siv_commit = ''
curve25519_dalek_commit = ''

config = _Config(
old_version=old_version,
new_version=new_version,
crossbeam_commit=crossbeam_commit,
tokio_commit=tokio_commit,
aes_gcm_siv_commit=aes_gcm_siv_commit,
curve25519_dalek_commit=curve25519_dalek_commit,
rust_version=_find_spec_rust_version(spec),
author=author)
print('Configuration:')
@@ -313,6 +327,44 @@ def _find_spec_tokio_commit(spec: _Spec) -> str:
return tokio_commit


_RE_SPEC_AES_GCM_SIV_COMMIT = re.compile(r'^\s*%global\s+solana_aes_gcm_siv_commit\s+(\S+)\s*?$')


def _find_spec_aes_gcm_siv_commit(spec: _Spec) -> str:
aes_gcm_siv_commit = None
with open(spec.file_name, 'r') as spec_f:
for line in spec_f:
line = line.strip()
commit_match = _RE_SPEC_AES_GCM_SIV_COMMIT.match(line)

if commit_match is not None:
commit = commit_match[1]
assert aes_gcm_siv_commit is None, \
f'Duplicate aes-gcm-siv commit, previous == {aes_gcm_siv_commit}, new == {commit}'
aes_gcm_siv_commit = commit
assert aes_gcm_siv_commit is not None, 'aes-gcm-siv commit not found in RPM SPEC'
return aes_gcm_siv_commit


_RE_SPEC_CURVE25519_DALEK_COMMIT = re.compile(r'^\s*%global\s+solana_curve25519_dalek_commit\s+(\S+)\s*?$')


def _find_spec_curve25519_dalek_commit(spec: _Spec) -> str:
curve25519_dalek_commit = None
with open(spec.file_name, 'r') as spec_f:
for line in spec_f:
line = line.strip()
commit_match = _RE_SPEC_CURVE25519_DALEK_COMMIT.match(line)

if commit_match is not None:
commit = commit_match[1]
assert curve25519_dalek_commit is None, \
f'Duplicate curve25519-dalek commit, previous == {curve25519_dalek_commit}, new == {commit}'
curve25519_dalek_commit = commit
assert curve25519_dalek_commit is not None, 'curve25519-dalek commit not found in RPM SPEC'
return curve25519_dalek_commit


_RE_SPEC_RUST_VERSION = re.compile(r'^\s*%global\s+rust_version\s+(\S+)\s*?$')


@@ -379,6 +431,18 @@ def _download(conf: _Config) -> None:
f'https://github.com/solana-labs/solana-tokio/archive/{conf.tokio_commit}/{tarball_name}',
tarball_name)

if conf.aes_gcm_siv_commit:
tarball_name = f'AEADs-{conf.aes_gcm_siv_commit}.tar.gz'
_download_one(
f'https://github.com/RustCrypto/AEADs/archive/{conf.aes_gcm_siv_commit}/{tarball_name}',
tarball_name)

if conf.curve25519_dalek_commit:
tarball_name = f'curve25519-dalek-{conf.curve25519_dalek_commit}.tar.gz'
_download_one(
f'https://github.com/solana-labs/curve25519-dalek/archive/{conf.curve25519_dalek_commit}/{tarball_name}',
tarball_name)

if conf.old_version != conf.new_version:
old_tarball_name = f'solana-{conf.old_version}.tar.gz'
if os.path.exists(old_tarball_name):
@@ -632,6 +696,10 @@ def _hash_tarballs(conf: _Config) -> None:
cmd.append(f'solana-crossbeam-{conf.crossbeam_commit}.tar.gz')
if conf.tokio_commit:
cmd.append(f'solana-tokio-{conf.tokio_commit}.tar.gz')
if conf.aes_gcm_siv_commit:
cmd.append(f'AEADs-{conf.aes_gcm_siv_commit}.tar.gz')
if conf.curve25519_dalek_commit:
cmd.append(f'curve25519-dalek-{conf.curve25519_dalek_commit}.tar.gz')

hashes = subprocess.check_output(
cmd,
51 changes: 51 additions & 0 deletions fix-proc-macro-crate.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Only in solana-1.18.1.b/vendor/proc-macro-crate: 8c83fda5d9b440e94d036395b0df666fa6998ccd.patch
diff -ru solana-1.18.1.a/vendor/proc-macro-crate/.cargo-checksum.json solana-1.18.1.b/vendor/proc-macro-crate/.cargo-checksum.json
--- solana-1.18.1.a/vendor/proc-macro-crate/.cargo-checksum.json 2024-01-31 18:34:34.000000000 +0100
+++ solana-1.18.1.b/vendor/proc-macro-crate/.cargo-checksum.json 2024-02-01 13:42:57.565286529 +0100
@@ -1 +1 @@
-{"files":{"Cargo.toml":"0f88c7d1f929e7d8e227f8a538776cb2f727d3b13d96d370c21f3cb736364d47","LICENSE-APACHE":"8ada45cd9f843acf64e4722ae262c622a2b3b3007c7310ef36ac1061a30f6adb","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"bf71b469e066c36321488ff63927863e13ed35dd2f433a06db930055d4720b65","src/lib.rs":"3456806fdcd8a48d9b455079149f45b9ab5848d1bd159f3fa00313112d59a98e","tests/workspace_deps.rs":"d8722fdbda99135c5291ba197fae72a5697d8a5f29103e6ee61b156e0287bc12"},"package":"7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8"}
\ No newline at end of file
+{"files":{"Cargo.toml":"0f88c7d1f929e7d8e227f8a538776cb2f727d3b13d96d370c21f3cb736364d47","LICENSE-APACHE":"8ada45cd9f843acf64e4722ae262c622a2b3b3007c7310ef36ac1061a30f6adb","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"bf71b469e066c36321488ff63927863e13ed35dd2f433a06db930055d4720b65","src/lib.rs":"bf7bc6454186ea4a6976f83d219c711721e0fd20dcdc7c26fdda33831e12481f","tests/workspace_deps.rs":"d8722fdbda99135c5291ba197fae72a5697d8a5f29103e6ee61b156e0287bc12"},"package":"7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8"}
diff -ru solana-1.18.1.a/vendor/proc-macro-crate/src/lib.rs solana-1.18.1.b/vendor/proc-macro-crate/src/lib.rs
--- solana-1.18.1.a/vendor/proc-macro-crate/src/lib.rs 2024-01-31 18:34:34.000000000 +0100
+++ solana-1.18.1.b/vendor/proc-macro-crate/src/lib.rs 2024-02-01 13:42:02.956392730 +0100
@@ -186,7 +186,12 @@
let manifest_dir = env::var("CARGO_MANIFEST_DIR").map_err(|_| Error::CargoManifestDirNotSet)?;
let manifest_path = Path::new(&manifest_dir).join("Cargo.toml");

- let workspace_manifest_path = workspace_manifest_path(&manifest_path)?;
+ // If `workspace_manifest_path` returns `None`, we are probably in a vendored deps
+ // folder and cargo complaining that we have some package inside a workspace, that isn't
+ // part of the workspace. In this case we just use the `manifest_path` as the
+ // `workspace_manifest_path`.
+ let workspace_manifest_path =
+ workspace_manifest_path(&manifest_path)?.unwrap_or_else(|| manifest_path.clone());

let manifest_ts = cargo_toml_timestamp(&manifest_path)?;
let workspace_manifest_ts = cargo_toml_timestamp(&workspace_manifest_path)?;
@@ -232,7 +237,7 @@
.clone())
}

-fn workspace_manifest_path(cargo_toml_manifest: &Path) -> Result<PathBuf, Error> {
+fn workspace_manifest_path(cargo_toml_manifest: &Path) -> Result<Option<PathBuf>, Error> {
let stdout = Command::new(env::var("CARGO").map_err(|_| Error::CargoEnvVariableNotSet)?)
.arg("locate-project")
.args(&["--workspace", "--message-format=plain"])
@@ -243,7 +248,15 @@

String::from_utf8(stdout)
.map_err(|_| Error::FailedGettingWorkspaceManifestPath)
- .map(|s| s.trim().into())
+ .map(|s| {
+ let path = s.trim();
+
+ if path.is_empty() {
+ None
+ } else {
+ Some(path.into())
+ }
+ })
}

fn cargo_toml_timestamp(manifest_path: &Path) -> Result<SystemTime, Error> {
Loading

0 comments on commit ca9bb39

Please # to comment.