-
-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cryptography v36.0.2 w/ Rust (#2378)
- Loading branch information
Showing
22 changed files
with
195 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
emsdk/patches/0004-Fix-lookupPath-when-applied-to-a-symlink-loop.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
emsdk/patches/0007-Disable-whole-archive-when-linking-rust.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From 9fb8391c7e6b9f36f45a1448e49597f899cce29d Mon Sep 17 00:00:00 2001 | ||
From: Hood Chatham <roberthoodchatham@gmail.com> | ||
Date: Thu, 6 Jan 2022 09:40:39 -0800 | ||
Subject: [PATCH 7/8] Disable whole-archive when linking rust | ||
|
||
Rust .rlib archives contain an extra metadata file called lib.rmeta. | ||
Emscripten sets `--whole-archive` by default if LINKABLE is set. | ||
But with `--whole-archive` the linker crashes with an error due to | ||
the extra files. This disables the problematic `--whole-archive` | ||
setting when we are linking rust. | ||
|
||
See emscripten issue: | ||
https://github.com/emscripten-core/emscripten/issues/17109 | ||
--- | ||
tools/building.py | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/tools/building.py b/tools/building.py | ||
index 512561c69..d180993a1 100644 | ||
--- a/tools/building.py | ||
+++ b/tools/building.py | ||
@@ -443,7 +443,7 @@ def link_lld(args, target, external_symbols=None): | ||
|
||
# Emscripten currently expects linkable output (SIDE_MODULE/MAIN_MODULE) to | ||
# include all archive contents. | ||
- if settings.LINKABLE: | ||
+ if settings.LINKABLE and not any(arg.endswith(".rlib") for arg in args): | ||
args.insert(0, '--whole-archive') | ||
args.append('--no-whole-archive') | ||
|
||
-- | ||
2.25.1 | ||
|
26 changes: 26 additions & 0 deletions
26
emsdk/patches/0008-Add-signature-to-emscripten_get_now.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From b6839bba05c1a5eab390f47309a7bef1b7294eca Mon Sep 17 00:00:00 2001 | ||
From: Hood Chatham <roberthoodchatham@gmail.com> | ||
Date: Wed, 1 Jun 2022 10:54:08 -0700 | ||
Subject: [PATCH 8/8] Add signature to emscripten_get_now | ||
|
||
Upstream PR: | ||
https://github.com/emscripten-core/emscripten/pull/17123/files | ||
--- | ||
src/library.js | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/src/library.js b/src/library.js | ||
index ef8a618bb..5b5a9d838 100644 | ||
--- a/src/library.js | ||
+++ b/src/library.js | ||
@@ -2657,6 +2657,7 @@ LibraryManager.library = { | ||
}, | ||
|
||
emscripten_get_now__import: true, | ||
+ emscripten_get_now__sig: 'd', | ||
emscripten_get_now: ';' + | ||
#if ENVIRONMENT_MAY_BE_NODE | ||
"if (ENVIRONMENT_IS_NODE) {\n" + | ||
-- | ||
2.25.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/cryptography/patches/0001-Use-patched-chrono.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From 53ee3cee6aae5333d61ac687677cf2ca39cb831a Mon Sep 17 00:00:00 2001 | ||
From: Hood Chatham <roberthoodchatham@gmail.com> | ||
Date: Fri, 8 Apr 2022 18:17:51 -0700 | ||
Subject: [PATCH 1/2] Use patched chrono | ||
|
||
--- | ||
src/rust/Cargo.toml | 3 +++ | ||
1 file changed, 3 insertions(+) | ||
|
||
diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml | ||
index 617167d0..35bf38ae 100644 | ||
--- a/src/rust/Cargo.toml | ||
+++ b/src/rust/Cargo.toml | ||
@@ -5,6 +5,9 @@ authors = ["The cryptography developers <cryptography-dev@python.org>"] | ||
edition = "2018" | ||
publish = false | ||
|
||
+[patch.crates-io] | ||
+chrono = { path = "../../chrono" } | ||
+ | ||
[dependencies] | ||
lazy_static = "1" | ||
pyo3 = { version = "0.15.1" } | ||
-- | ||
2.25.1 | ||
|
24 changes: 24 additions & 0 deletions
24
packages/cryptography/patches/0002-Add-instant-patch.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
From 196ace04edb63a93000418f91d56a3cec11b8345 Mon Sep 17 00:00:00 2001 | ||
From: Hood Chatham <roberthoodchatham@gmail.com> | ||
Date: Wed, 1 Jun 2022 10:11:44 -0700 | ||
Subject: [PATCH 2/2] Add instant patch | ||
|
||
--- | ||
src/rust/Cargo.toml | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml | ||
index 35bf38ae..23a64977 100644 | ||
--- a/src/rust/Cargo.toml | ||
+++ b/src/rust/Cargo.toml | ||
@@ -7,6 +7,7 @@ publish = false | ||
|
||
[patch.crates-io] | ||
chrono = { path = "../../chrono" } | ||
+instant = { path = "../../instant" } | ||
|
||
[dependencies] | ||
lazy_static = "1" | ||
-- | ||
2.25.1 | ||
|
Oops, something went wrong.