fix(swc_core): Revert crate version metadata patch (#5501)

This commit is contained in:
OJ Kwon 2022-08-15 07:06:34 -07:00 committed by GitHub
parent 0c3011e717
commit ef1f259a93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 342 deletions

158
Cargo.lock generated
View File

@ -369,9 +369,6 @@ name = "cc"
version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
dependencies = [
"jobserver",
]
[[package]]
name = "cfg-if"
@ -893,16 +890,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4eeac5c5edb79e4e39fe8439ef35207780a11f69c52cbe424ce3dfad4cb78de6"
dependencies = [
"enum-iterator-derive 0.7.0",
]
[[package]]
name = "enum-iterator"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45a0ac4aeb3a18f92eaf09c6bb9b3ac30ff61ca95514fc58cbead1c9a6bf5401"
dependencies = [
"enum-iterator-derive 1.0.2",
"enum-iterator-derive",
]
[[package]]
@ -916,17 +904,6 @@ dependencies = [
"syn",
]
[[package]]
name = "enum-iterator-derive"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b13f1e69590421890f90448c3cd5f554746a31adc6dc0dac406ec6901db8dc25"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "enum_kind"
version = "0.2.1"
@ -1127,18 +1104,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "getset"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9"
dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "gimli"
version = "0.26.1"
@ -1150,19 +1115,6 @@ dependencies = [
"stable_deref_trait",
]
[[package]]
name = "git2"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0155506aab710a86160ddb504a480d2964d7ab5b9e62419be69e0032bc5931c"
dependencies = [
"bitflags",
"libc",
"libgit2-sys",
"log",
"url",
]
[[package]]
name = "glob"
version = "0.3.0"
@ -1385,15 +1337,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
[[package]]
name = "jobserver"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
dependencies = [
"libc",
]
[[package]]
name = "js-sys"
version = "0.3.59"
@ -1521,18 +1464,6 @@ version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
[[package]]
name = "libgit2-sys"
version = "0.13.4+1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0fa6563431ede25f5cc7f6d803c6afbc1c5d3ad3d4925d12c882bf2b526f5d1"
dependencies = [
"cc",
"libc",
"libz-sys",
"pkg-config",
]
[[package]]
name = "libloading"
version = "0.7.3"
@ -1543,18 +1474,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "libz-sys"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "lock_api"
version = "0.4.6"
@ -1951,15 +1870,6 @@ dependencies = [
"libc",
]
[[package]]
name = "num_threads"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44"
dependencies = [
"libc",
]
[[package]]
name = "object"
version = "0.27.1"
@ -2348,11 +2258,11 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
[[package]]
name = "proc-macro2"
version = "1.0.43"
version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
dependencies = [
"unicode-ident",
"unicode-xid",
]
[[package]]
@ -2377,9 +2287,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.21"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145"
dependencies = [
"proc-macro2",
]
@ -3512,7 +3422,7 @@ dependencies = [
[[package]]
name = "swc_core"
version = "0.7.13"
version = "0.7.14"
dependencies = [
"binding_macros 0.2.3",
"once_cell",
@ -3537,7 +3447,6 @@ dependencies = [
"swc_plugin_runner 0.71.10",
"swc_trace_macro 0.1.2",
"testing",
"vergen",
"wasmer",
"wasmer-wasi",
]
@ -5325,13 +5234,13 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.99"
version = "1.0.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"
checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
"unicode-xid",
]
[[package]]
@ -5511,17 +5420,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "time"
version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db76ff9fa4b1458b3c7f077f3ff9887394058460d21e634355b273aaf11eea45"
dependencies = [
"itoa 1.0.1",
"libc",
"num_threads",
]
[[package]]
name = "time-macros"
version = "0.1.1"
@ -5747,12 +5645,6 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4285d92be83dfbc8950a2601178b89ed36f979ebf51bfcf7b272b17001184e6c"
[[package]]
name = "unicode-ident"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf"
[[package]]
name = "unicode-linebreak"
version = "0.1.2"
@ -5777,6 +5669,12 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]]
name = "unicode-xid"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
name = "unreachable"
version = "0.1.1"
@ -5810,22 +5708,6 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "vergen"
version = "7.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bbc4fafd30514504c7593cfa52eaf4d6c4ef660386e2ec54edc17f14aa08e8d"
dependencies = [
"anyhow",
"cfg-if 1.0.0",
"enum-iterator 1.1.3",
"getset",
"git2",
"rustversion",
"thiserror",
"time 0.3.13",
]
[[package]]
name = "version_check"
version = "0.9.4"
@ -6066,7 +5948,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad0358af9c154724587731175553805648d9acb8f6657880d165e378672b7e53"
dependencies = [
"cfg-if 1.0.0",
"enum-iterator 0.7.0",
"enum-iterator",
"enumset",
"leb128",
"libloading",
@ -6111,7 +5993,7 @@ version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68f1db3f54152657eb6e86c44b66525ff7801dad8328fe677da48dd06af9ad41"
dependencies = [
"enum-iterator 0.7.0",
"enum-iterator",
"enumset",
"loupe",
"rkyv",
@ -6140,7 +6022,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39df01ea05dc0a9bab67e054c7cb01521e53b35a7bb90bd02eca564ed0b2667f"
dependencies = [
"backtrace",
"enum-iterator 0.7.0",
"enum-iterator",
"indexmap",
"loupe",
"more-asserts",
@ -6171,7 +6053,7 @@ dependencies = [
"cc",
"cfg-if 1.0.0",
"corosensei",
"enum-iterator 0.7.0",
"enum-iterator",
"indexmap",
"lazy_static",
"libc",

View File

@ -6,7 +6,7 @@ edition = "2021"
license = "Apache-2.0"
name = "swc_core"
repository = "https://github.com/swc-project/swc.git"
version = "0.7.13"
version = "0.7.14"
[package.metadata.docs.rs]
features = [
"common_perf",
@ -249,10 +249,3 @@ swc_plugin_runner = { optional = true, version = "0.71.10", path = "../swc_plugi
[dev-dependencies]
testing = { version = "0.29.4", path = "../testing" }
[build-dependencies]
vergen = { version = "7.3.2", default-features = false, features = [
"build",
"git",
"cargo",
] }

View File

@ -1,4 +1,9 @@
use vergen::{vergen, Config};
use std::{
env,
fs::File,
io::{BufWriter, Write},
path::Path,
};
// Validate conflict between host / plugin features
#[cfg(all(
@ -24,5 +29,12 @@ compile_error!(
);
fn main() {
vergen(Config::default()).expect("Build time metadata should be available");
// Creates a static compile time constants for the version of swc_core.
let pkg_version = env::var("CARGO_PKG_VERSION").unwrap();
let out_dir = env::var("OUT_DIR").expect("Outdir should exist");
let dest_path = Path::new(&out_dir).join("core_pkg_version.txt");
let mut f = BufWriter::new(
File::create(&dest_path).expect("Failed to create swc_core version constant"),
);
write!(f, "{}", pkg_version).expect("Failed to write swc_core version constant");
}

View File

@ -124,32 +124,4 @@ pub mod node {
#[cfg_attr(docsrs, doc(cfg(feature = "allocator_node")))]
extern crate swc_node_base;
pub mod diagnostics {
/// Set of metadata swc_core was built against.
/// This is useful for the diagnostics to determine any runtime, or guest
/// uses specific version of swc_core, or desired features to be enabled or
/// not.
#[derive(Debug)]
pub struct CoreEngineDiagnostics {
/// Semver package version of swc_core.
pub package_semver: String,
/// Git branch of swc_core built against.
pub git_branch: String,
/// Commit sha of swc_core built against.
pub git_sha: String,
/// List of features enabled
pub cargo_features: String,
pub cargo_target_triple: String,
}
/// Returns metadata about the swc_core engine that was built against.
pub fn get_core_engine_diagnostics() -> CoreEngineDiagnostics {
CoreEngineDiagnostics {
package_semver: env!("VERGEN_BUILD_SEMVER").to_string(),
git_branch: env!("VERGEN_GIT_BRANCH").to_string(),
git_sha: env!("VERGEN_GIT_SHA").to_string(),
cargo_features: env!("VERGEN_CARGO_FEATURES").to_string(),
cargo_target_triple: env!("VERGEN_CARGO_TARGET_TRIPLE").to_string(),
}
}
}
pub static SWC_CORE_VERSION: &str = include_str!(concat!(env!("OUT_DIR"), "/core_pkg_version.txt"));

View File

@ -160,9 +160,6 @@ name = "cc"
version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
dependencies = [
"jobserver",
]
[[package]]
name = "cfg-if"
@ -271,26 +268,6 @@ version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be"
[[package]]
name = "enum-iterator"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45a0ac4aeb3a18f92eaf09c6bb9b3ac30ff61ca95514fc58cbead1c9a6bf5401"
dependencies = [
"enum-iterator-derive",
]
[[package]]
name = "enum-iterator-derive"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b13f1e69590421890f90448c3cd5f554746a31adc6dc0dac406ec6901db8dc25"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "enum_kind"
version = "0.2.1"
@ -357,37 +334,12 @@ dependencies = [
"wasi",
]
[[package]]
name = "getset"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9"
dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "gimli"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"
[[package]]
name = "git2"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0155506aab710a86160ddb504a480d2964d7ab5b9e62419be69e0032bc5931c"
dependencies = [
"bitflags",
"libc",
"libgit2-sys",
"log",
"url",
]
[[package]]
name = "glob"
version = "0.3.0"
@ -485,15 +437,6 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754"
[[package]]
name = "jobserver"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
dependencies = [
"libc",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
@ -579,30 +522,6 @@ version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
[[package]]
name = "libgit2-sys"
version = "0.13.4+1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0fa6563431ede25f5cc7f6d803c6afbc1c5d3ad3d4925d12c882bf2b526f5d1"
dependencies = [
"cc",
"libc",
"libz-sys",
"pkg-config",
]
[[package]]
name = "libz-sys"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "lock_api"
version = "0.4.7"
@ -730,15 +649,6 @@ dependencies = [
"libc",
]
[[package]]
name = "num_threads"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44"
dependencies = [
"libc",
]
[[package]]
name = "object"
version = "0.29.0"
@ -848,12 +758,6 @@ version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
[[package]]
name = "pkg-config"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
[[package]]
name = "pmutil"
version = "0.5.3"
@ -889,30 +793,6 @@ dependencies = [
"output_vt100",
]
[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
"version_check",
]
[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]
[[package]]
name = "proc-macro-hack"
version = "0.5.19"
@ -1092,12 +972,6 @@ dependencies = [
"semver",
]
[[package]]
name = "rustversion"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8"
[[package]]
name = "ryu"
version = "1.0.11"
@ -1314,7 +1188,7 @@ dependencies = [
[[package]]
name = "swc_common"
version = "0.27.8"
version = "0.27.6"
dependencies = [
"ahash",
"anyhow",
@ -1345,7 +1219,7 @@ dependencies = [
[[package]]
name = "swc_core"
version = "0.7.12"
version = "0.7.6"
dependencies = [
"once_cell",
"swc_atoms",
@ -1357,7 +1231,6 @@ dependencies = [
"swc_plugin",
"swc_plugin_macro",
"swc_plugin_proxy",
"vergen",
]
[[package]]
@ -1454,7 +1327,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_base"
version = "0.103.7"
version = "0.103.6"
dependencies = [
"better_scoped_tls",
"bitflags",
@ -1569,7 +1442,7 @@ dependencies = [
[[package]]
name = "swc_plugin_macro"
version = "0.9.5"
version = "0.9.2"
dependencies = [
"proc-macro2",
"quote",
@ -1578,7 +1451,7 @@ dependencies = [
[[package]]
name = "swc_plugin_proxy"
version = "0.18.6"
version = "0.18.5"
dependencies = [
"better_scoped_tls",
"bytecheck",
@ -1734,17 +1607,6 @@ dependencies = [
"once_cell",
]
[[package]]
name = "time"
version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db76ff9fa4b1458b3c7f077f3ff9887394058460d21e634355b273aaf11eea45"
dependencies = [
"itoa",
"libc",
"num_threads",
]
[[package]]
name = "tinyvec"
version = "1.6.0"
@ -1903,28 +1765,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "vergen"
version = "7.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bbc4fafd30514504c7593cfa52eaf4d6c4ef660386e2ec54edc17f14aa08e8d"
dependencies = [
"anyhow",
"cfg-if",
"enum-iterator",
"getset",
"git2",
"rustversion",
"thiserror",
"time",
]
[[package]]
name = "version_check"
version = "0.9.4"