From 755029a1dcca394c31828d1d708eaeb953b49ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 1 Dec 2026 02:40:36 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20release=20snapshots=20are?= =?UTF-8?q?=20extracted=20with=20fresh=20mtimes=20(tar=20-m)=20so=20cargo?= =?UTF-8?q?=20always=20recompiles=20workspace=20crates;=20archive=20mtimes?= =?UTF-8?q?=20older=20than=20the=20last=20build=20made=20the=20Windows=20b?= =?UTF-8?q?uild=20reuse=20a=20stale=20exe.=20The=20previous=20output=20bin?= =?UTF-8?q?ary=20is=20deleted=20before=20each=20build=20so=20a=20no-op=20b?= =?UTF-8?q?uild=20can=20never=20ship=20an=20old=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/release.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/client/src/release.rs b/crates/client/src/release.rs index 7ffbb51..e587024 100644 --- a/crates/client/src/release.rs +++ b/crates/client/src/release.rs @@ -47,7 +47,7 @@ const ARCHIVE: &str = "dist/source.tgz"; const VM: &str = "yumush-win"; const TARGET: &str = "yumush@127.0.0.1"; const PORT: &str = "2222"; -const EXTRACT: &str = "Remove-Item -Recurse -Force release -ErrorAction SilentlyContinue; New-Item -ItemType Directory release | Out-Null; tar xzf release.tgz -C release"; +const EXTRACT: &str = "Remove-Item -Recurse -Force release -ErrorAction SilentlyContinue; New-Item -ItemType Directory release | Out-Null; tar -xmzf release.tgz -C release"; pub fn is_source(path: &Path) -> bool { path.join("crates/client/Cargo.toml").is_file() && path.join(".git").exists() @@ -232,7 +232,7 @@ fn snapshot(source: &Path) -> Result<(), String> { )?; check( Command::new("tar") - .arg("xzf") + .arg("-xmzf") .arg(&tgz) .arg("-C") .arg(&tree), @@ -256,13 +256,13 @@ fn build_linux(job: Job, level: Level, source: &Path, cx: &Cx) -> Result<(), Str .env("CARGO_TERM_PROGRESS_WIDTH", "200") .env("CARGO_TERM_COLOR", "never") .stdout(Stdio::null()); + let built = source.join(format!("target/release-{name}/release/client")); + if built.exists() { + fs::remove_file(&built).map_err(|e| e.to_string())?; + } stream(&mut cmd, job, cx)?; let dest = source.join("dist").join(format!("x86_64_{name}-linux")); - fs::copy( - source.join(format!("target/release-{name}/release/client")), - &dest, - ) - .map_err(|e| e.to_string())?; + fs::copy(&built, &dest).map_err(|e| e.to_string())?; cx.send(Event::Built(job, dest)); cx.send(Event::Finished(job)); Ok(()) @@ -289,6 +289,7 @@ $env:Path += ";$env:USERPROFILE\.cargo\bin" $env:CARGO_TERM_PROGRESS_WHEN = 'always'; $env:CARGO_TERM_PROGRESS_WIDTH = '200'; $env:CARGO_TERM_COLOR = 'never' @' {toml}'@ | Set-Content -Encoding ascii level.toml +Remove-Item -Force ..\target-release-{name}\release\client.exe -ErrorAction SilentlyContinue cargo build --release -p client --target-dir ..\target-release-{name} --config level.toml exit $LASTEXITCODE "#,