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

chore: build for aarch64-unknown-linux-musl #12

Merged
merged 1 commit into from
Sep 30, 2021
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
8 changes: 8 additions & 0 deletions build/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
- template: linux.yml
parameters:
target: aarch64-unknown-linux-gnu
- job: linux_aarch64_musl
pool:
vmImage: 'ubuntu-16.04'
steps:
- template: linux.yml
parameters:
target: aarch64-unknown-linux-musl
- job: macOS
pool:
vmImage: macOS-latest
Expand Down Expand Up @@ -74,6 +81,7 @@ jobs:
- linux_32
- linux_arm
- linux_aarch64
- linux_aarch64_musl
- macOS
- macOS_arm64
- win_64
Expand Down
11 changes: 5 additions & 6 deletions build/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ mk_tarball() {
pushd ..
this_tag=`git tag -l --contains HEAD`
popd

local name="ripgrep-${this_tag}-${TARGET}.tar.gz"
# When cross-compiling, use the right `strip` tool on the binary.
local gcc_prefix="$(gcc_prefix)"

local name="ripgrep-${this_tag}-${TARGET}.tar.gz"

# Copy the ripgrep binary and strip it.
"${gcc_prefix}strip" "target/$TARGET/release/rg"
if [ -n "${gcc_prefix}" ]; then
# Copy the ripgrep binary and strip it.
"${gcc_prefix}strip" "target/$TARGET/release/rg"
fi

tar czvf "$OUT_DIR/$name" -C ./target/$TARGET/release rg
echo "##vso[task.setvariable variable=Name]$name"
Expand Down
26 changes: 13 additions & 13 deletions build/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ architecture() {
aarch64-unknown-linux-gnu)
echo aarch64
;;
aarch64-unknown-linux-musl)
echo aarch64-musl
;;
aarch64-apple-darwin)
echo arm64
;;
Expand Down Expand Up @@ -90,6 +93,13 @@ is_aarch64() {
esac
}

is_aarch64_musl() {
case "$(architecture)" in
aarch64-musl) return 0 ;;
*) return 1 ;;
esac
}

is_arm64() {
case "$(architecture)" in
arm64) return 0 ;;
Expand All @@ -112,19 +122,9 @@ is_osx() {
}

builder() {
if is_musl && is_x86_64; then
# IMPORTANT - put this back when building anything past 11.0.1
# set -u
# D=$(mktemp -d)
# git clone https://github.com/rust-embedded/cross.git "$D"
# cd "$D"
# curl -O -L "https://gist.githubusercontent.com/nickbabcock/c7bdc8e5974ed9956abf46ffd7dc13ff/raw/e211bc17ea88e505003ad763fac7060b4ac1d8d0/patch"
# git apply patch
# cargo install --path .
# rm -rf "$D"
# echo "cross"

echo "cargo"
if is_musl && is_aarch64_musl; then
cargo install cross
echo "cross"
else
echo "cargo"
fi
Expand Down