From 9e88155a4860b73e9175acbd3e9a4305ceb95f3d Mon Sep 17 00:00:00 2001 From: Maksim Bondarenkov <119937608+ognevny@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:59:18 +0300 Subject: [PATCH] Use winresource instead of embed-manifest (#10810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use winresource for crates/zed and crates/storybook. tested on `x86_64-pc-windows-gnu`. on `x86_64-pc-windows-msvc` I receive a error message, that looks like a problem with my machine   Release Notes: - N/A --- Cargo.lock | 9 +-------- crates/storybook/Cargo.toml | 2 +- crates/storybook/build.rs | 10 ++++++++-- crates/zed/Cargo.toml | 1 - crates/zed/build.rs | 5 ++--- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b28d6fd4a0..f980ce11fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3433,12 +3433,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "embed-manifest" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cd446c890d6bed1d8b53acef5f240069ebef91d6fae7c5f52efe61fe8b5eae" - [[package]] name = "emojis" version = "0.6.1" @@ -9489,7 +9483,6 @@ dependencies = [ "ctrlc", "dialoguer", "editor", - "embed-manifest", "fuzzy", "gpui", "indoc", @@ -9505,6 +9498,7 @@ dependencies = [ "strum", "theme", "ui", + "winresource", ] [[package]] @@ -12634,7 +12628,6 @@ dependencies = [ "db", "diagnostics", "editor", - "embed-manifest", "env_logger", "extension", "extensions_ui", diff --git a/crates/storybook/Cargo.toml b/crates/storybook/Cargo.toml index 5b19171349..b7fae8ebbc 100644 --- a/crates/storybook/Cargo.toml +++ b/crates/storybook/Cargo.toml @@ -36,7 +36,7 @@ theme.workspace = true ui = { workspace = true, features = ["stories"] } [target.'cfg(target_os = "windows")'.build-dependencies] -embed-manifest = "1.4.0" +winresource = "0.1" [dev-dependencies] gpui = { workspace = true, features = ["test-support"] } diff --git a/crates/storybook/build.rs b/crates/storybook/build.rs index fcb9db5cb7..d165aee5d5 100644 --- a/crates/storybook/build.rs +++ b/crates/storybook/build.rs @@ -12,7 +12,13 @@ fn main() { let manifest = std::path::Path::new("../zed/resources/windows/manifest.xml"); println!("cargo:rerun-if-changed={}", manifest.display()); - embed_manifest::embed_manifest(embed_manifest::new_manifest(manifest.to_str().unwrap())) - .unwrap(); + + let mut res = winresource::WindowsResource::new(); + res.set_manifest_file(manifest.to_str().unwrap()); + + if let Err(e) = res.compile() { + eprintln!("{}", e); + std::process::exit(1); + } } } diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 6f039a77a5..248b9488d4 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -96,7 +96,6 @@ workspace.workspace = true zed_actions.workspace = true [target.'cfg(target_os = "windows")'.build-dependencies] -embed-manifest = "1.4.0" winresource = "0.1" [dev-dependencies] diff --git a/crates/zed/build.rs b/crates/zed/build.rs index 8def598fd4..a1126afed7 100644 --- a/crates/zed/build.rs +++ b/crates/zed/build.rs @@ -57,11 +57,10 @@ fn main() { println!("cargo:rerun-if-changed={}", manifest.display()); println!("cargo:rerun-if-changed={}", icon.display()); - embed_manifest::embed_manifest(embed_manifest::new_manifest(manifest.to_str().unwrap())) - .unwrap(); - let mut res = winresource::WindowsResource::new(); res.set_icon(icon.to_str().unwrap()); + res.set_manifest_file(manifest.to_str().unwrap()); + if let Err(e) = res.compile() { eprintln!("{}", e); std::process::exit(1);