diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-08-15 22:47:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-15 23:47:16 +0200 |
| commit | 2bb013f9baa927fc7b392766b0182b91380b9aa8 (patch) | |
| tree | ca8a7ea961b50213adf0904d724974c317cefb55 /cli/build.rs | |
| parent | 5ec3c5c3a46ca95f355a4520676b85ac619ca102 (diff) | |
refactor: `version` module exports a single const struct (#25014)
This commit rewrites the internal `version` module that exported
various information about the current executable. Instead of exporting
several consts, we are now exporting a single const structure that
contains all the necessary information.
This is the first step towards cleaning up how we use this information
and should allow us to use SUI to be able to patch this information
in already produced binary making it easier to cut new releases.
---------
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli/build.rs')
| -rw-r--r-- | cli/build.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/cli/build.rs b/cli/build.rs index 4fe6fd1ea..05636f7f9 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -5,6 +5,7 @@ use std::path::PathBuf; use deno_core::snapshot::*; use deno_runtime::*; +mod shared; mod ts { use super::*; @@ -329,18 +330,7 @@ mod ts { fn create_cli_snapshot(snapshot_path: PathBuf) { use deno_runtime::ops::bootstrap::SnapshotOptions; - // NOTE(bartlomieju): keep in sync with `cli/version.rs`. - // Ideally we could deduplicate that code. - fn deno_version() -> String { - if env::var("DENO_CANARY").is_ok() { - format!("{}+{}", env!("CARGO_PKG_VERSION"), &git_commit_hash()[..7]) - } else { - env!("CARGO_PKG_VERSION").to_string() - } - } - let snapshot_options = SnapshotOptions { - deno_version: deno_version(), ts_version: ts::version(), v8_version: deno_core::v8_version(), target: std::env::var("TARGET").unwrap(), |
