diff --git a/precompiled/.gitignore b/precompiled/.gitignore index b4ac4d993..85df3acf1 100644 --- a/precompiled/.gitignore +++ b/precompiled/.gitignore @@ -1 +1 @@ -/x86_64-unknown-linux-gnu/serde_derive +/serde_derive/serde_derive-x86_64-unknown-linux-gnu diff --git a/precompiled/Cargo.toml b/precompiled/Cargo.toml index 44a1d8953..279a802bc 100644 --- a/precompiled/Cargo.toml +++ b/precompiled/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["proc-macro2", "serde_derive"] +members = ["bin", "proc-macro2"] resolver = "2" [patch.crates-io] diff --git a/precompiled/bin/Cargo.toml b/precompiled/bin/Cargo.toml new file mode 100644 index 000000000..aa812d95e --- /dev/null +++ b/precompiled/bin/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "serde_derive" +version = "1.0.171" +authors = ["David Tolnay "] +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"] } diff --git a/precompiled/serde_derive/build.rs b/precompiled/bin/build.rs similarity index 100% rename from precompiled/serde_derive/build.rs rename to precompiled/bin/build.rs diff --git a/precompiled/serde_derive/main.rs b/precompiled/bin/main.rs similarity index 100% rename from precompiled/serde_derive/main.rs rename to precompiled/bin/main.rs diff --git a/precompiled/serde_derive/src b/precompiled/bin/src similarity index 100% rename from precompiled/serde_derive/src rename to precompiled/bin/src diff --git a/precompiled/build.sh b/precompiled/build.sh index 16ec5516a..9f4a1ce72 100755 --- a/precompiled/build.sh +++ b/precompiled/build.sh @@ -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 diff --git a/precompiled/serde_derive/Cargo.toml b/precompiled/serde_derive/Cargo.toml index aa812d95e..c67a76b0d 100644 --- a/precompiled/serde_derive/Cargo.toml +++ b/precompiled/serde_derive/Cargo.toml @@ -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 "] -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 + +[features] +default = [] +deserialize_in_place = [] + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] -[dependencies] -proc-macro2 = "1" -quote = { version = "1", default-features = false } -syn = { version = "2.0.25", default-features = false, features = ["clone-impls", "derive", "parsing", "printing"] } +[workspace] diff --git a/precompiled/x86_64-unknown-linux-gnu/README.md b/precompiled/serde_derive/README.md similarity index 100% rename from precompiled/x86_64-unknown-linux-gnu/README.md rename to precompiled/serde_derive/README.md diff --git a/precompiled/x86_64-unknown-linux-gnu/src/buffer.rs b/precompiled/serde_derive/src/buffer.rs similarity index 100% rename from precompiled/x86_64-unknown-linux-gnu/src/buffer.rs rename to precompiled/serde_derive/src/buffer.rs diff --git a/precompiled/x86_64-unknown-linux-gnu/src/bytecode.rs b/precompiled/serde_derive/src/bytecode.rs similarity index 100% rename from precompiled/x86_64-unknown-linux-gnu/src/bytecode.rs rename to precompiled/serde_derive/src/bytecode.rs diff --git a/precompiled/x86_64-unknown-linux-gnu/src/lib.rs b/precompiled/serde_derive/src/lib.rs similarity index 98% rename from precompiled/x86_64-unknown-linux-gnu/src/lib.rs rename to precompiled/serde_derive/src/lib.rs index 09809a74b..21368861a 100644 --- a/precompiled/x86_64-unknown-linux-gnu/src/lib.rs +++ b/precompiled/serde_derive/src/lib.rs @@ -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() diff --git a/precompiled/x86_64-unknown-linux-gnu/Cargo.toml b/precompiled/x86_64-unknown-linux-gnu/Cargo.toml deleted file mode 100644 index c67a76b0d..000000000 --- a/precompiled/x86_64-unknown-linux-gnu/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "serde_derive-x86_64-unknown-linux-gnu" -version = "1.0.171-alpha.3" -authors = ["David Tolnay "] -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]