Skip to content

build binaries for Linux ARM64 #142

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

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
shell: bash
run: |
rustup target add x86_64-unknown-linux-musl \
aarch64-unknown-linux-musl \
aarch64-apple-darwin \
x86_64-apple-darwin \
x86_64-pc-windows-gnu
Expand All @@ -46,11 +47,14 @@ jobs:
run: cargo zigbuild --target universal2-apple-darwin --release
- name: Linux - build x86_64 musl
run: cargo zigbuild --target x86_64-unknown-linux-musl --release
- name: Linux - build aarch64 musl
run: cargo zigbuild --target aarch64-unknown-linux-musl --release
- name: Windows - build x86_64 musl
run: cargo zigbuild --target x86_64-pc-windows-gnu --release
- name: Move / Rename Artifacts
run: |
mv target/x86_64-unknown-linux-musl/release/rewatch ./rewatch-linux
mv target/aarch64-unknown-linux-musl/release/rewatch ./rewatch-linux-arm64
mv target/universal2-apple-darwin/release/rewatch ./rewatch-macos
mv target/x86_64-pc-windows-gnu/release/rewatch.exe ./rewatch-windows.exe

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"/rewatch",
"/rewatch.cmd",
"/rewatch-linux",
"/rewatch-linux-arm64",
"/rewatch-macos",
"/rewatch-windows.exe"
]
Expand Down
6 changes: 5 additions & 1 deletion postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ const installWindowsBinary = () => {

switch (process.platform) {
case "linux":
installMacLinuxBinary("rewatch-linux");
if (process.arch === "arm64") {
installMacLinuxBinary("rewatch-linux-arm64");
} else {
installMacLinuxBinary("rewatch-linux");
}
break;
case "darwin":
installMacLinuxBinary("rewatch-macos");
Expand Down
7 changes: 6 additions & 1 deletion rewatch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ if [ "$(uname)" = "Darwin" ]; then
$DIR/rewatch-macos.exe $@
elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then
# Run the Linux Version
$DIR/rewatch-linux.exe $@
elif [ "$(expr substr $(uname -m) 1 7)" = "aarch64" ]; then
# Run the Linux ARM64 Version
$DIR/rewatch-linux-arm64.exe $@
else
$DIR/rewatch-linux.exe $@
fi
else
echo "No release available for '$(uname)'"
exit 1
Expand Down
1 change: 1 addition & 0 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ pub fn get_bsc(root_path: &str, workspace_root: Option<String>) -> String {
let subfolder = match (std::env::consts::OS, std::env::consts::ARCH) {
("macos", "aarch64") => "darwinarm64",
("macos", _) => "darwin",
("linux", "aarch64") => "linuxarm64",
("linux", _) => "linux",
("windows", _) => "win32",
_ => panic!("Unsupported architecture"),
Expand Down
Loading