Skip to content

Commit

Permalink
ci(next-swc): print glibc version when build
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Aug 14, 2023
1 parent b4d5ddb commit 243d675
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -136,3 +136,4 @@ url = "2.2.2"
urlencoding = "2.1.2"
webbrowser = "0.8.7"
dhat = { version = "0.3.2" }
glibc_version = { version = "0.1.2" }
1 change: 1 addition & 0 deletions packages/next-swc/crates/napi/Cargo.toml
Expand Up @@ -89,6 +89,7 @@ serde = "1"
serde_json = "1"
# It is not a mistake this dependency is specified in dep / build-dep both.
shadow-rs = { workspace = true }
glibc_version = { workspace = true }
turbopack-binding = { workspace = true, features = [
"__turbo_tasks_build"
]}
15 changes: 15 additions & 0 deletions packages/next-swc/crates/napi/build.rs
Expand Up @@ -10,6 +10,21 @@ use turbopack_binding::turbo::tasks_build::generate_register;
extern crate napi_build;

fn main() {
// Print glibc version we're building against at the build time.
// We do not embed this into runtime api, since if next-swc fails to load due to
// glibc version mismatch, there's no way to run those api anyway.
#[cfg(all(target_os = "linux", target_env = "gnu"))]
{
let glibc_version = glibc_version::get_version();
if let Ok(glibc_version) = glibc_version {
let message = format!(
"Building with glibc version: {}.{}",
glibc_version.major, glibc_version.minor
);
println!("cargo:warning={}", message);
}
}

// Generates, stores build-time information as static values.
// There are some places relying on correct values for this (i.e telemetry),
// So failing build if this fails.
Expand Down

0 comments on commit 243d675

Please sign in to comment.