Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For build scripts, symlink zig.exe to zig on posix #8147

Merged
merged 2 commits into from
Jan 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions scripts/download-zig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@ fi

case $(uname -ms) in
'Darwin x86_64')
target='macos'
arch='x86_64'
;;
target='macos'
arch='x86_64'
;;
'Darwin arm64')
target='macos'
arch='aarch64'
;;
target='macos'
arch='aarch64'
;;
'Linux aarch64' | 'Linux arm64')
target='linux'
arch='aarch64'
;;
target='linux'
arch='aarch64'
;;
'Linux x86_64')
target='linux'
arch='x86_64'
;;
target='linux'
arch='x86_64'
;;
*)
printf "error: cannot get platform name from '%s'\n" "${unamestr}"
exit 1
;;
printf "error: cannot get platform name from '%s'\n" "${unamestr}"
exit 1
;;
esac

url="https://ziglang.org/builds/zig-${target}-${arch}-${zig_version}.tar.xz"
dest=".cache/zig-${zig_version}.tar.xz"
extract_at=".cache/zig"
dest="$(pwd)/.cache/zig-${zig_version}.tar.xz"
extract_at="$(pwd)/.cache/zig"

mkdir -p ".cache"

Expand All @@ -50,7 +50,7 @@ update_repo_if_needed() {
Dockerfile
scripts/download-zig.ps1
.github/workflows/*
);
)

zig_version_previous=$(grep 'recommended_zig_version = "' "build.zig" | cut -d'"' -f2)

Expand All @@ -59,6 +59,12 @@ update_repo_if_needed() {
done

printf "Zig was updated to ${zig_version}. Please commit new files."

# symlink extracted zig to extracted zig.exe
Jarred-Sumner marked this conversation as resolved.
Show resolved Hide resolved
# TODO: Workaround for https://github.com/ziglang/vscode-zig/issues/164
ln -sf "${extract_at}/zig" "${extract_at}/zig.exe"
chmod +x "${extract_at}/zig.exe"

fi
}

Expand Down
Loading