From 9aa49cae09edc99793008da6779e3ecc7a50bdee Mon Sep 17 00:00:00 2001 From: NewtonChutney <70827815+NewtonChutney@users.noreply.github.com> Date: Mon, 25 Dec 2023 22:34:43 +0530 Subject: [PATCH 1/5] injecting the icon through a resource file, no extra deps --- contrib/helix-icon-windows.lib | Bin 0 -> 10636 bytes helix-term/build.rs | 10 ++++++++++ 2 files changed, 10 insertions(+) create mode 100644 contrib/helix-icon-windows.lib diff --git a/contrib/helix-icon-windows.lib b/contrib/helix-icon-windows.lib new file mode 100644 index 0000000000000000000000000000000000000000..faaf44ee8705419114495113415863f861ed5f12 GIT binary patch literal 10636 zcmY*f1ymH#yPpkO0f7bS25C?!K|<*+LCHlhKq=`EmJkGyR6r1EX{48CQD8v?q;p{@ z>7}IWjsO37=e)Oj=IrducW3UsU;VxS007_skIT#d9^mQ!`&<$D-}^9-2J)YK)YN3~ z|0Rkv&{Mxk&O{FWzpAOBVgvyHXdnP7G5BNos^ICr;hHMSCO)4xalQc`M(Qy;v!6D| zsO`z1%JE7gMR~(-FqtD$Qz8l;uj7kltmYriTg$!~RTNj24oAL_ z?&=_IN3!S32|mI-Dr`8&-!|$@8lRpmii?#yHU{4ENl#c3X)$cHD1IXO%|jyngHuOO ztlgtdjc|B5))#X#4t@H%ZSLYl(rOI0(o*ab4WPs%4m%nhN4i}eTCjf_!f(CouMJK!Pgjr+bytu0f|pcL z;ye|pKRx|c*gL=){e(9`7toRtClN3Mr@wXdt+pqs zbQnpCS$+@wqF(-Mi-PSI?%6X6qmJA{h0f0>PB>eh&$@sO59%?VHPYw%76s)nYaAj- zD7h7r7kl1kY{+n8q-v$%EkkCvVUjXy=Fiu~K)Y=^g*rtMiCvx_lzl9|h(n>PJqin6 z90|UC$2-lBwDL6!CdAGEGzB80;B|_VR>X1F zIua{v{=iKE|3pki@GF6i(?j7eDR?xRChM`&jjL@Ls4eJ=;G0N?o2IZ@=-U{e50XU2 zxdk#yeTA|ss(H79$QGZ~6%<1hNOe||E$U(N1Z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zjpyQ!bzavg&(#C~qn}+VsJ~e)*TpjL0L!Ei@qRf~kNez)E9?{a4bY6Z(B|G7f|_^l zm|D@(VICE5x6Hr-KNsaJF1ndz1%qFGUiV~i4T}( z9#aZnth>@ky@5(-peR?AWrU@?nm4&%3NZ1$VG0Ec>o5av2FoZWx)@2jMgYXgCBr60 z##9Lvq-^)nNfFwee5l+l=tKH{C3x~N=w)O>&la)=YaFf%m}-H6csgj^5OFrdW%sO( zQY&9V%Z-dMaz(6?Rz6p@Eix@!RQy2amsisDvh8W`nXLGyFB#$=Z~r5+UJUq-=9$;Q z2Ow(*DKuauttSe!mX$(ykt;x=L2^3ZYp|dMfEW&AQD@A-ka@sxmc%n-;7p5pvZm`Xo^%7GPOqzcC3sQizs-_j*;O+Mmt+WQ$5 zu*(t9RMk@{yN3*+1J8xQ Date: Wed, 27 Dec 2023 22:20:38 +0530 Subject: [PATCH 2/5] formatted --- helix-term/build.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/helix-term/build.rs b/helix-term/build.rs index dc37e3d20285..e815d8c1ef03 100644 --- a/helix-term/build.rs +++ b/helix-term/build.rs @@ -10,10 +10,14 @@ fn main() { // link icon to windows executable if cfg!(target_os = "windows") { // fetch manifest dir from env var set by Cargo: - let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR should be set by Cargo"); + let manifest_dir = + std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR should be set by Cargo"); // link against the helix-icon-windows library from contrib dir: - println!("cargo:rustc-link-search=native={}", manifest_dir.replace("helix-term", "contrib")); + println!( + "cargo:rustc-link-search=native={}", + manifest_dir.replace("helix-term", "contrib") + ); println!("cargo:rustc-link-lib=dylib=helix-icon-windows"); } } From 625ed79bf267e6129c31b904cdf36b5c34b70a5a Mon Sep 17 00:00:00 2001 From: NewtonChutney <70827815+NewtonChutney@users.noreply.github.com> Date: Tue, 9 Jan 2024 22:24:08 +0530 Subject: [PATCH 3/5] scripted rc compilation --- contrib/helix-256p.ico | Bin 0 -> 270398 bytes contrib/helix-icon-windows.lib | Bin 10636 -> 0 bytes helix-term/build.rs | 142 ++++++++++++++++++++++++++++++--- 3 files changed, 131 insertions(+), 11 deletions(-) create mode 100644 contrib/helix-256p.ico delete mode 100644 contrib/helix-icon-windows.lib diff --git a/contrib/helix-256p.ico b/contrib/helix-256p.ico new file mode 100644 index 0000000000000000000000000000000000000000..16781cc10b53d50b51f56c7a1d95473eec2a8fb8 GIT binary patch literal 270398 zcmeHw4Qv!wwx)-N7!)BEp$J7N!U#nXiXs$6(FmbYKoN=%LTr{8md7w`CNGa6#$f(2 zZHI1bLm0wj2w}kXFj0&P0H7e0XbpP!ofYSw_OG;pJ3(J1i!W#AKl`uKwDdY{aHSJfUDhBc78 z1_oQoo(13E2S&2+Uibp$f9~q$D_H}s&;YppBtY-;x(xE3`R|IF<3g|oa@W96>*BHC z`)fcm@W>?h$p`TBKX>)>m8^k+X#m{)32+R!4~XZv*-z$w!D^5*W(}Cv0JuIC*ah6o zgZIKuF#pY00bjuya9jiOoZZ&NE5Z587Vw_=?|2PzhO7be8W?I_G6sB~2b=;PTF8C! z0sQ(qP60>bUpjZe9#h+GtlH89Y+_&M)ojV@O~2bz6sEa%N6{z`;(vl1vZb?t@8NZ5^%jM#(UyEA%bWBa|JFQXK%3v z23udJxZEW`3y{m4T`PS8^WWn7HIrOtppnM*sh@u*#(BYg`aBDaHs}2Ew90Y0 zv%vWi!1sWaJkB*O=6?ZA2K-(M=y9L;f3&@Z$NdUeJ(guX&|3Bk_`Vkyb_wr=zhM4b zR?FrR0>5Vf$!&i1^Z#&oTLZuEH>XxtosBhkC@!}Gxau> z4`1uN2Eg~1fTKV@ak+Y2wc{A`-(eH!*m{V@{Ptye_LC170cJT|JkBmh4S?@cfO=pM zu!F01q{;lxvA%P?EF5Tf3cS8xfdAwJcIBE6U+0Vl!1W2hTfij`@m}~6=D#y$63+$v zp9x-PYx|2nKp)P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TpjL0L!Ei@qRf~kNez)E9?{a4bY6Z(B|G7f|_^l zm|D@(VICE5x6Hr-KNsaJF1ndz1%qFGUiV~i4T}( z9#aZnth>@ky@5(-peR?AWrU@?nm4&%3NZ1$VG0Ec>o5av2FoZWx)@2jMgYXgCBr60 z##9Lvq-^)nNfFwee5l+l=tKH{C3x~N=w)O>&la)=YaFf%m}-H6csgj^5OFrdW%sO( zQY&9V%Z-dMaz(6?Rz6p@Eix@!RQy2amsisDvh8W`nXLGyFB#$=Z~r5+UJUq-=9$;Q z2Ow(*DKuauttSe!mX$(ykt;x=L2^3ZYp|dMfEW&AQD@A-ka@sxmc%n-;7p5pvZm`Xo^%7GPOqzcC3sQizs-_j*;O+Mmt+WQ$5 zu*(t9RMk@{yN3*+1J8xQ io::Result { + let find_reg_key = process::Command::new("reg") + .arg("query") + .arg(r"HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots") + .arg("/reg:32") + .arg("/v") + .arg("KitsRoot10") + .output() + .unwrap(); + + if find_reg_key.status.code().unwrap() != 0 { + return Err(io::Error::new( + io::ErrorKind::Other, + "Can not find Windows SDK", + )); } + + let lines = String::from_utf8(find_reg_key.stdout).expect("Should be able to parse the output"); + let mut lines: Vec<&str> = lines.lines().collect(); + let mut rc_exe_paths: Vec = Vec::new(); + lines.reverse(); + for line in lines { + if line.trim().starts_with("KitsRoot") { + let kit: String = line + .chars() + .skip(line.find("REG_SZ").unwrap() + 6) + .skip_while(|c| c.is_whitespace()) + .collect(); + + let p = PathBuf::from(&kit); + let rc = if cfg!(target_arch = "x86_64") { + p.join(r"bin\x64\rc.exe") + } else { + p.join(r"bin\x86\rc.exe") + }; + + if rc.exists() { + println!("{:?}", rc); + rc_exe_paths.push(rc.to_owned()); + } + + if let Ok(bin) = p.join("bin").read_dir() { + for e in bin.filter_map(|e| e.ok()) { + let p = if cfg!(target_arch = "x86_64") { + e.path().join(r"x64\rc.exe") + } else { + e.path().join(r"x86\rc.exe") + }; + if p.exists() { + // println!("{:?}", p); + // dbg!(&p); + rc_exe_paths.push(p.to_owned()); + } + } + } + } + } + if rc_exe_paths.is_empty() { + return Err(io::Error::new( + io::ErrorKind::Other, + "Can not find Windows SDK", + )); + } + + println!("{:?}", rc_exe_paths); + let rc_path = rc_exe_paths.pop().unwrap(); + + let rc_exe = if !rc_path.exists() { + if cfg!(target_arch = "x86_64") { + PathBuf::from(rc_path.parent().unwrap()).join(r"bin\x64\rc.exe") + } else { + PathBuf::from(rc_path.parent().unwrap()).join(r"bin\x86\rc.exe") + } + } else { + rc_path + }; + + println!("Selected RC path: '{}'", rc_exe.display()); + Ok(rc_exe) +} + +fn write_resource_file(rc_path: &Path, icon_path: &str) -> io::Result<()> { + let mut f = std::fs::File::create(rc_path)?; + writeln!(f, "{} ICON \"{}\"", 1, icon_path)?; + + Ok(()) } From 74d934ebf0dc5c4ae9fe142f8461d5b48fe827b0 Mon Sep 17 00:00:00 2001 From: NewtonChutney <70827815+NewtonChutney@users.noreply.github.com> Date: Wed, 10 Jan 2024 07:52:02 +0530 Subject: [PATCH 4/5] formatted and restructured --- helix-term/build.rs | 228 ++++++++++++++++++++++++-------------------- 1 file changed, 122 insertions(+), 106 deletions(-) diff --git a/helix-term/build.rs b/helix-term/build.rs index f8be023fc961..8472da8af719 100644 --- a/helix-term/build.rs +++ b/helix-term/build.rs @@ -1,10 +1,5 @@ use helix_loader::grammar::{build_grammars, fetch_grammars}; -// #[cfg(windows)] -use std::io::prelude::Write; -use std::path::Path; -use std::{io, path::PathBuf, process}; - fn main() { if std::env::var("HELIX_DISABLE_AUTO_GRAMMAR_BUILD").is_err() { fetch_grammars().expect("Failed to fetch tree-sitter grammars"); @@ -12,16 +7,27 @@ fn main() { .expect("Failed to compile tree-sitter grammars"); } + #[cfg(windows)] if cfg!(target_os = "windows") { + let icon_path = "../contrib/helix-256p.ico"; + windows_rc::link_icon_in_windows_exe(&icon_path); + } +} + +#[cfg(windows)] +mod windows_rc { + use std::io::prelude::Write; + use std::{env, io, path::Path, path::PathBuf, process}; + + #[cfg(windows)] + pub(crate) fn link_icon_in_windows_exe(icon_path: &str) { let rc_exe = find_rc_exe().expect("Windows SDK is to be installed along with MSVC"); - let output = - std::env::var("OUT_DIR").expect("Env var OUT_DIR should have been set by compiler"); + let output = env::var("OUT_DIR").expect("Env var OUT_DIR should have been set by compiler"); let output_dir = PathBuf::from(output); let rc_path = output_dir.join("resource.rc"); - let icon_path = PathBuf::from("../contrib/helix-256p.ico"); - write_resource_file(&rc_path, icon_path.to_str().unwrap()).unwrap(); + write_resource_file(&rc_path, icon_path).unwrap(); let resource_file = PathBuf::from(&output_dir).join("resource.lib"); compile_with_toolkit_msvc(rc_exe, resource_file, rc_path); @@ -29,115 +35,125 @@ fn main() { println!("cargo:rustc-link-search=native={}", output_dir.display()); println!("cargo:rustc-link-lib=dylib=resource"); } -} -fn compile_with_toolkit_msvc(rc_exe: PathBuf, output: PathBuf, input: PathBuf) { - let mut command = process::Command::new(rc_exe); - let command = command.arg(format!( - "/I{}", - std::env::var("CARGO_MANIFEST_DIR").unwrap() - )); - - let status = command - .arg(format!("/fo{}", output.display())) - .arg(format!("{}", input.display())) - .output() - .unwrap(); - - println!( - "RC Output:\n{}\n------", - String::from_utf8_lossy(&status.stdout) - ); - println!( - "RC Error:\n{}\n------", - String::from_utf8_lossy(&status.stderr) - ); -} - -fn find_rc_exe() -> io::Result { - let find_reg_key = process::Command::new("reg") - .arg("query") - .arg(r"HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots") - .arg("/reg:32") - .arg("/v") - .arg("KitsRoot10") - .output() - .unwrap(); - - if find_reg_key.status.code().unwrap() != 0 { - return Err(io::Error::new( - io::ErrorKind::Other, - "Can not find Windows SDK", + fn compile_with_toolkit_msvc(rc_exe: PathBuf, output: PathBuf, input: PathBuf) { + let mut command = process::Command::new(rc_exe); + let command = command.arg(format!( + "/I{}", + env::var("CARGO_MANIFEST_DIR") + .expect("CARGO_MANIFEST_DIR should have been set by Cargo") )); + + let status = command + .arg(format!("/fo{}", output.display())) + .arg(format!("{}", input.display())) + .output() + .unwrap(); + + println!( + "RC Output:\n{}\n------", + String::from_utf8_lossy(&status.stdout) + ); + println!( + "RC Error:\n{}\n------", + String::from_utf8_lossy(&status.stderr) + ); } - let lines = String::from_utf8(find_reg_key.stdout).expect("Should be able to parse the output"); - let mut lines: Vec<&str> = lines.lines().collect(); - let mut rc_exe_paths: Vec = Vec::new(); - lines.reverse(); - for line in lines { - if line.trim().starts_with("KitsRoot") { - let kit: String = line - .chars() - .skip(line.find("REG_SZ").unwrap() + 6) - .skip_while(|c| c.is_whitespace()) - .collect(); - - let p = PathBuf::from(&kit); - let rc = if cfg!(target_arch = "x86_64") { - p.join(r"bin\x64\rc.exe") - } else { - p.join(r"bin\x86\rc.exe") - }; - - if rc.exists() { - println!("{:?}", rc); - rc_exe_paths.push(rc.to_owned()); + fn find_rc_exe() -> io::Result { + let find_reg_key = process::Command::new("reg") + .arg("query") + .arg(r"HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots") + .arg("/reg:32") + .arg("/v") + .arg("KitsRoot10") + .output(); + + match find_reg_key { + Err(find_reg_key) => { + return Err(io::Error::new( + io::ErrorKind::Other, + format!("Failed to run registry query: {}", find_reg_key), + )) } + Ok(find_reg_key) => { + if find_reg_key.status.code().unwrap() != 0 { + return Err(io::Error::new( + io::ErrorKind::Other, + "Can not find Windows SDK", + )); + } else { + let lines = String::from_utf8(find_reg_key.stdout) + .expect("Should be able to parse the output"); + let mut lines: Vec<&str> = lines.lines().collect(); + let mut rc_exe_paths: Vec = Vec::new(); + lines.reverse(); + for line in lines { + if line.trim().starts_with("KitsRoot") { + let kit: String = line + .chars() + .skip(line.find("REG_SZ").unwrap() + 6) + .skip_while(|c| c.is_whitespace()) + .collect(); + + let p = PathBuf::from(&kit); + let rc = if cfg!(target_arch = "x86_64") { + p.join(r"bin\x64\rc.exe") + } else { + p.join(r"bin\x86\rc.exe") + }; + + if rc.exists() { + println!("{:?}", rc); + rc_exe_paths.push(rc.to_owned()); + } + + if let Ok(bin) = p.join("bin").read_dir() { + for e in bin.filter_map(|e| e.ok()) { + let p = if cfg!(target_arch = "x86_64") { + e.path().join(r"x64\rc.exe") + } else { + e.path().join(r"x86\rc.exe") + }; + if p.exists() { + println!("{:?}", p); + rc_exe_paths.push(p.to_owned()); + } + } + } + } + } + if rc_exe_paths.is_empty() { + return Err(io::Error::new( + io::ErrorKind::Other, + "Can not find Windows SDK", + )); + } - if let Ok(bin) = p.join("bin").read_dir() { - for e in bin.filter_map(|e| e.ok()) { - let p = if cfg!(target_arch = "x86_64") { - e.path().join(r"x64\rc.exe") + println!("{:?}", rc_exe_paths); + let rc_path = rc_exe_paths.pop().unwrap(); + + let rc_exe = if !rc_path.exists() { + if cfg!(target_arch = "x86_64") { + PathBuf::from(rc_path.parent().unwrap()).join(r"bin\x64\rc.exe") + } else { + PathBuf::from(rc_path.parent().unwrap()).join(r"bin\x86\rc.exe") + } } else { - e.path().join(r"x86\rc.exe") + rc_path }; - if p.exists() { - // println!("{:?}", p); - // dbg!(&p); - rc_exe_paths.push(p.to_owned()); - } + + println!("Selected RC path: '{}'", rc_exe.display()); + Ok(rc_exe) } } } } - if rc_exe_paths.is_empty() { - return Err(io::Error::new( - io::ErrorKind::Other, - "Can not find Windows SDK", - )); - } - println!("{:?}", rc_exe_paths); - let rc_path = rc_exe_paths.pop().unwrap(); + fn write_resource_file(rc_path: &Path, icon_path: &str) -> io::Result<()> { + let mut f = std::fs::File::create(rc_path)?; + writeln!(f, "{} ICON \"{}\"", 1, icon_path)?; - let rc_exe = if !rc_path.exists() { - if cfg!(target_arch = "x86_64") { - PathBuf::from(rc_path.parent().unwrap()).join(r"bin\x64\rc.exe") - } else { - PathBuf::from(rc_path.parent().unwrap()).join(r"bin\x86\rc.exe") - } - } else { - rc_path - }; - - println!("Selected RC path: '{}'", rc_exe.display()); - Ok(rc_exe) -} - -fn write_resource_file(rc_path: &Path, icon_path: &str) -> io::Result<()> { - let mut f = std::fs::File::create(rc_path)?; - writeln!(f, "{} ICON \"{}\"", 1, icon_path)?; - - Ok(()) + Ok(()) + } } From 6aec4b72bda1932048a6b08b7e6bd43dd5b6b856 Mon Sep 17 00:00:00 2001 From: NewtonChutney <70827815+NewtonChutney@users.noreply.github.com> Date: Wed, 10 Jan 2024 08:18:39 +0530 Subject: [PATCH 5/5] simplified conditional func call --- helix-term/build.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/helix-term/build.rs b/helix-term/build.rs index 8472da8af719..6bebf00c6152 100644 --- a/helix-term/build.rs +++ b/helix-term/build.rs @@ -8,10 +8,7 @@ fn main() { } #[cfg(windows)] - if cfg!(target_os = "windows") { - let icon_path = "../contrib/helix-256p.ico"; - windows_rc::link_icon_in_windows_exe(&icon_path); - } + windows_rc::link_icon_in_windows_exe("../contrib/helix-256p.ico"); } #[cfg(windows)] @@ -19,7 +16,6 @@ mod windows_rc { use std::io::prelude::Write; use std::{env, io, path::Path, path::PathBuf, process}; - #[cfg(windows)] pub(crate) fn link_icon_in_windows_exe(icon_path: &str) { let rc_exe = find_rc_exe().expect("Windows SDK is to be installed along with MSVC");