Rearrange precompiled directory

This commit is contained in:
David Tolnay
2023-07-19 13:14:18 -07:00
parent a28292764c
commit b88052d875
13 changed files with 51 additions and 43 deletions
+1 -1
View File
@@ -1 +1 @@
/x86_64-unknown-linux-gnu/serde_derive
/serde_derive/serde_derive-x86_64-unknown-linux-gnu
+1 -1
View File
@@ -1,5 +1,5 @@
[workspace]
members = ["proc-macro2", "serde_derive"]
members = ["bin", "proc-macro2"]
resolver = "2"
[patch.crates-io]
+17
View File
@@ -0,0 +1,17 @@
[package]
name = "serde_derive"
version = "1.0.171"
authors = ["David Tolnay <dtolnay@gmail.com>"]
publish = false
[lib]
doctest = false
[[bin]]
name = "serde_derive"
path = "main.rs"
[dependencies]
proc-macro2 = "1"
quote = { version = "1", default-features = false }
syn = { version = "2.0.25", default-features = false, features = ["clone-impls", "derive", "parsing", "printing"] }
+7 -3
View File
@@ -1,17 +1,21 @@
#!/bin/bash
cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null
set -e -x
# TODO: Sanitize host filesystem paths. https://github.com/rust-lang/cargo/issues/12137
cargo +nightly build \
--manifest-path serde_derive/Cargo.toml \
--manifest-path bin/Cargo.toml \
--bin serde_derive \
--profile precompiled \
-Z unstable-options \
-Z build-std=std,panic_abort \
-Z build-std-features=panic_immediate_abort \
--target x86_64-unknown-linux-musl \
--out-dir x86_64-unknown-linux-gnu
--out-dir serde_derive
#upx --best --lzma x86_64-unknown-linux-gnu/serde_derive
rm -f serde_derive/serde_derive-x86_64-unknown-linux-gnu
mv serde_derive/serde_derive{,-x86_64-unknown-linux-gnu}
#upx --best --lzma serde_derive/serde_derive-x86_64-unknown-linux-gnu
+20 -11
View File
@@ -1,17 +1,26 @@
[package]
name = "serde_derive"
version = "1.0.171"
name = "serde_derive-x86_64-unknown-linux-gnu"
version = "1.0.171-alpha.3"
authors = ["David Tolnay <dtolnay@gmail.com>"]
publish = false
categories = ["no-std", "no-std::no-alloc"]
description = "Precompiled implementation of #[derive(Serialize, Deserialize)]"
documentation = "https://serde.rs/derive.html"
edition = "2015"
homepage = "https://serde.rs"
include = ["serde_derive", "src"]
keywords = ["serde", "serialization", "no_std", "derive"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/serde-rs/serde"
[lib]
doctest = false
[[bin]]
name = "serde_derive"
path = "main.rs"
proc-macro = true
[dependencies]
proc-macro2 = "1"
quote = { version = "1", default-features = false }
syn = { version = "2.0.25", default-features = false, features = ["clone-impls", "derive", "parsing", "printing"] }
[features]
default = []
deserialize_in_place = []
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[workspace]
@@ -36,7 +36,11 @@ fn derive(select: u8, input: TokenStream) -> TokenStream {
memory.linearize_token(token, &mut buf);
}
let mut child = Command::new(concat!(env!("CARGO_MANIFEST_DIR"), "/serde_derive"))
let path = concat!(
env!("CARGO_MANIFEST_DIR"),
"/serde_derive-x86_64-unknown-linux-gnu",
);
let mut child = Command::new(path)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()
@@ -1,26 +0,0 @@
[package]
name = "serde_derive-x86_64-unknown-linux-gnu"
version = "1.0.171-alpha.3"
authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["no-std", "no-std::no-alloc"]
description = "Precompiled implementation of #[derive(Serialize, Deserialize)]"
documentation = "https://serde.rs/derive.html"
edition = "2015"
homepage = "https://serde.rs"
include = ["serde_derive", "src"]
keywords = ["serde", "serialization", "no_std", "derive"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/serde-rs/serde"
[lib]
name = "serde_derive"
proc-macro = true
[features]
default = []
deserialize_in_place = []
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[workspace]