Skip to content

Commit b9c2f32

Browse files
joa-quimclaude
andcommitted
Fix build.jl: call System32's tar.exe by full path, not bare tar
A bare `tar` can resolve to Git/MSYS's GNU tar (whichever is first on PATH) instead of Windows' own bsdtar in System32 -- GNU tar can't read ZIP at all and fails with "does not look like a tar archive" / "Error exit delayed from previous errors". Same PATH-shadowing class of bug as the earlier cpack -D issue. Windows 10 1803+/11 always ships a real bsdtar at System32\tar.exe; call it by full path to sidestep PATH order entirely. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 6aef030 commit b9c2f32

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

deps/build.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ end
2929
release_url(tag::String, asset::String) =
3030
"https://github.com/$REPO/releases/download/$tag/$asset"
3131

32+
# Windows 10 1803+/11 ships a real bsdtar (understands .zip) at System32\tar.exe. Called by
33+
# FULL PATH, never bare `tar` — a bare `tar` can resolve to Git/MSYS's GNU tar instead (whichever
34+
# comes first on PATH), which cannot read ZIP at all and fails with a cryptic
35+
# "does not look like a tar archive" / "Error exit delayed from previous errors".
36+
const TAR = joinpath(get(ENV, "SystemRoot", "C:\\Windows"), "System32", "tar.exe")
37+
3238
function fetch_and_extract(url::String, dest::String)
39+
isfile(TAR) || error("$TAR not found — need Windows 10 1803+ (bsdtar) to unzip gmtvtk binaries")
3340
zip = joinpath(tempdir(), basename(url))
3441
@info "InteractiveGMT: downloading gmtvtk binaries" url
3542
try
@@ -38,7 +45,7 @@ function fetch_and_extract(url::String, dest::String)
3845
error("failed to download $url — has this asset been uploaded yet? ($e)")
3946
end
4047
mkpath(dest)
41-
run(`tar -xf $zip -C $dest`)
48+
run(`$TAR -xf $zip -C $dest`)
4249
rm(zip; force=true)
4350
end
4451

0 commit comments

Comments
 (0)