fix(compile): read resource name in executable as uppercase on Windows (#29005)

* https://github.com/denoland/sui/pull/40 (this is the fix)
* https://github.com/denoland/sui/pull/39
* https://github.com/denoland/sui/pull/38

Closes https://github.com/denoland/deno/issues/28982

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
This commit is contained in:
David Sherret 2025-04-23 00:59:59 -04:00 committed by David Sherret
parent 305c03d4c0
commit a20bdf0772
7 changed files with 79 additions and 21 deletions

79
Cargo.lock generated
View file

@ -98,9 +98,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
dependencies = [
"cfg-if",
"const-random",
"once_cell",
"version_check",
"zerocopy",
"zerocopy 0.7.32",
]
[[package]]
@ -1037,6 +1038,26 @@ version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
[[package]]
name = "const-random"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359"
dependencies = [
"const-random-macro",
]
[[package]]
name = "const-random-macro"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e"
dependencies = [
"getrandom",
"once_cell",
"tiny-keccak",
]
[[package]]
name = "convert_case"
version = "0.4.0"
@ -1306,6 +1327,12 @@ dependencies = [
"winapi",
]
[[package]]
name = "crunchy"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929"
[[package]]
name = "crypto-bigint"
version = "0.5.5"
@ -3367,15 +3394,16 @@ dependencies = [
[[package]]
name = "editpe"
version = "0.1.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48cede2bb1b07dd598d269f973792c43e0cd92686d3b452bd6e01d7a8eb01211"
checksum = "7a7ef4fd9152764fe33ef270a380032555744da2f264a5634ae22003fcbba4e5"
dependencies = [
"ahash",
"debug-ignore",
"indexmap 2.8.0",
"log",
"thiserror 1.0.69",
"zerocopy",
"zerocopy 0.8.24",
]
[[package]]
@ -5188,15 +5216,16 @@ dependencies = [
[[package]]
name = "libsui"
version = "0.5.0"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89795977654ad6250d6c0915411b622bac22f9efb4f852af94b2e00964cab832"
checksum = "464183daecf10e3d48bc13d10f60d90df2a5a96bce01e43f8912c286e8a4092b"
dependencies = [
"editpe",
"image",
"libc",
"sha2",
"windows-sys 0.48.0",
"zerocopy",
"zerocopy 0.8.24",
]
[[package]]
@ -5252,9 +5281,9 @@ dependencies = [
[[package]]
name = "log"
version = "0.4.21"
version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
dependencies = [
"serde",
]
@ -8577,6 +8606,15 @@ dependencies = [
"time-core",
]
[[package]]
name = "tiny-keccak"
version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237"
dependencies = [
"crunchy",
]
[[package]]
name = "tiny_pretty"
version = "0.2.0"
@ -10010,8 +10048,16 @@ version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
dependencies = [
"byteorder",
"zerocopy-derive",
"zerocopy-derive 0.7.32",
]
[[package]]
name = "zerocopy"
version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879"
dependencies = [
"zerocopy-derive 0.8.24",
]
[[package]]
@ -10025,6 +10071,17 @@ dependencies = [
"syn 2.0.87",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.87",
]
[[package]]
name = "zerofrom"
version = "0.1.4"

View file

@ -290,7 +290,7 @@ dprint-plugin-typescript = "=0.94.0"
env_logger = "=0.11.6"
eszip = "=0.84.0"
fancy-regex = "=0.14.0"
libsui = "0.5.0"
libsui = "0.8.0"
malva = "=0.11.2"
markup_fmt = "=0.19.1"
open = "5.0.1"

View file

@ -24,6 +24,8 @@ const IS_RC: bool = option_env!("DENO_RC").is_some();
pub static DENO_VERSION_INFO: std::sync::LazyLock<DenoVersionInfo> =
std::sync::LazyLock::new(|| {
let release_channel = libsui::find_section("denover")
.ok()
.flatten()
.and_then(|buf| std::str::from_utf8(buf).ok())
.and_then(|str_| ReleaseChannel::deserialize(str_).ok())
.unwrap_or({

View file

@ -154,7 +154,7 @@ impl WorkspaceNpmPatchPackages {
log::warn!(
"{} {}\n at {}",
colors::yellow("Warning"),
err.to_string(),
err,
pkg_json.path.display(),
);
}

View file

@ -58,7 +58,9 @@ pub struct StandaloneData {
pub fn extract_standalone(
cli_args: Cow<Vec<OsString>>,
) -> Result<StandaloneData, AnyError> {
let Some(data) = libsui::find_section("d3n0l4nd") else {
let Some(data) = libsui::find_section("d3n0l4nd")
.context("Failed reading standalone binary section.")?
else {
bail!("Could not find standalone binary section.")
};

View file

@ -479,12 +479,9 @@ async fn update(
};
log::info!(
" - {}{} {}{} -> {}{}",
format!(
"{}{}",
colors::gray(package_name[0..4].to_string()),
package_name[4..].to_string()
),
" - {}{}{} {}{} -> {}{}",
colors::gray(package_name[0..4].to_string()),
&package_name[4..],
" ".repeat(max_name - package_name.len()),
" ".repeat(max_old - current_version.len()),
colors::gray(&current_version),

View file

@ -5,7 +5,7 @@
import { $ } from "jsr:@david/dax@0.41.0";
import { gray } from "jsr:@std/fmt@1/colors";
import { patchver } from "jsr:@deno/patchver@0.2.0";
import { patchver } from "jsr:@deno/patchver@0.3.0";
const SUPPORTED_TARGETS = [
"aarch64-apple-darwin",