Skip to content

Commit eb3f232

Browse files
authored
Merge pull request #2514 from dtolnay/precompiled
Add experiment to produce precompiled builds of serde_derive
2 parents 03da66c + 9e8f148 commit eb3f232

File tree

18 files changed

+1448
-2
lines changed

18 files changed

+1448
-2
lines changed

precompiled/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/x86_64-unknown-linux-gnu/serde_derive

precompiled/Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[workspace]
2+
members = ["proc-macro2", "serde_derive"]
3+
resolver = "2"
4+
5+
[patch.crates-io]
6+
proc-macro2 = { path = "proc-macro2" }
7+
8+
[profile.precompiled]
9+
inherits = "release"
10+
codegen-units = 1
11+
lto = true
12+
opt-level = "z"
13+
panic = "abort"
14+
strip = true

precompiled/build.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null
4+
5+
cargo +nightly build \
6+
--manifest-path serde_derive/Cargo.toml \
7+
--bin serde_derive \
8+
--profile precompiled \
9+
-Z unstable-options \
10+
-Z build-std=std,panic_abort \
11+
-Z build-std-features=panic_immediate_abort \
12+
--target x86_64-unknown-linux-musl \
13+
--out-dir x86_64-unknown-linux-gnu
14+
15+
#upx --best --lzma x86_64-unknown-linux-gnu/serde_derive

precompiled/proc-macro2/Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "proc-macro2"
3+
version = "1.0.66"
4+
edition = "2021"
5+
publish = false
6+
7+
[dependencies]
8+
proc-macro2 = { package = "proc-macro2-fallback", version = "1" }

0 commit comments

Comments
 (0)