From 3cb4a63e06b1ddce077369299347b2f0f51a9d92 Mon Sep 17 00:00:00 2001 From: andreamah Date: Mon, 5 Jun 2023 11:40:43 -0700 Subject: [PATCH 1/5] linux-aarch64 no longer allows for 16K page size Fixes #26 --- build/build.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/build/build.sh b/build/build.sh index 597f33c..34bc2e0 100755 --- a/build/build.sh +++ b/build/build.sh @@ -10,15 +10,15 @@ set -ex main() { CARGO="$(builder)" - if is_linux && is_musl; then - # jemalloc doesn't allow 16K page sizes for linux musl - # https://github.com/microsoft/ripgrep-prebuilt/issues/26 - JEMALLOC_SYS_WITH_LG_PAGE=14 - fi - # Test a normal debug build. if is_arm || is_aarch64 || is_ppc64le; then - "$CARGO" build --target "$TARGET" --release --features 'pcre2' + if is_linux && is_musl; then + # jemalloc doesn't allow 16K page sizes for linux musl + # https://github.com/microsoft/ripgrep-prebuilt/issues/26 + JEMALLOC_SYS_WITH_LG_PAGE=14 "$CARGO" build --target "$TARGET" --release --features 'pcre2' + else + "$CARGO" build --target "$TARGET" --release --features 'pcre2' + fi # pcre2 is not supported on s390x # https://github.com/zherczeg/sljit/issues/89 elif is_s390x; then @@ -26,7 +26,11 @@ main() { else # Technically, MUSL builds will force PCRE2 to get statically compiled, # but we also want PCRE2 statically build for macOS binaries. - PCRE2_SYS_STATIC=1 "$CARGO" build --target "$TARGET" --release --features 'pcre2' + if is_linux && is_musl; then + JEMALLOC_SYS_WITH_LG_PAGE=14 PCRE2_SYS_STATIC=1 "$CARGO" build --target "$TARGET" --release --features 'pcre2' + else + PCRE2_SYS_STATIC=1 "$CARGO" build --target "$TARGET" --release --features 'pcre2' + fi fi # Show the output of the most recent build.rs stderr. From 276f6ad8ea7f4d23167b9e56cba2af9035931881 Mon Sep 17 00:00:00 2001 From: andreamah Date: Tue, 6 Jun 2023 08:43:54 -0700 Subject: [PATCH 2/5] remove conditional for non arm cases --- build/build.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/build/build.sh b/build/build.sh index 34bc2e0..94a3611 100755 --- a/build/build.sh +++ b/build/build.sh @@ -26,11 +26,7 @@ main() { else # Technically, MUSL builds will force PCRE2 to get statically compiled, # but we also want PCRE2 statically build for macOS binaries. - if is_linux && is_musl; then - JEMALLOC_SYS_WITH_LG_PAGE=14 PCRE2_SYS_STATIC=1 "$CARGO" build --target "$TARGET" --release --features 'pcre2' - else - PCRE2_SYS_STATIC=1 "$CARGO" build --target "$TARGET" --release --features 'pcre2' - fi + PCRE2_SYS_STATIC=1 "$CARGO" build --target "$TARGET" --release --features 'pcre2' fi # Show the output of the most recent build.rs stderr. From 76aba3b24cb389ca666e9e55e4ac5d94b1d9edab Mon Sep 17 00:00:00 2001 From: Andrea Mah <31675041+andreamah@users.noreply.github.com> Date: Tue, 6 Jun 2023 09:50:30 -0700 Subject: [PATCH 3/5] Update build/build.sh Co-authored-by: Robo --- build/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 94a3611..45dc5e9 100755 --- a/build/build.sh +++ b/build/build.sh @@ -12,7 +12,7 @@ main() { # Test a normal debug build. if is_arm || is_aarch64 || is_ppc64le; then - if is_linux && is_musl; then + if is_linux && is_aarch64 && is_musl; then # jemalloc doesn't allow 16K page sizes for linux musl # https://github.com/microsoft/ripgrep-prebuilt/issues/26 JEMALLOC_SYS_WITH_LG_PAGE=14 "$CARGO" build --target "$TARGET" --release --features 'pcre2' From 91eaac5403cc33cf989effd834babe6611d7f7df Mon Sep 17 00:00:00 2001 From: Andrea Mah <31675041+andreamah@users.noreply.github.com> Date: Tue, 6 Jun 2023 10:16:42 -0700 Subject: [PATCH 4/5] Update build/build.sh Co-authored-by: Robo --- build/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 45dc5e9..a9c19c0 100755 --- a/build/build.sh +++ b/build/build.sh @@ -12,7 +12,7 @@ main() { # Test a normal debug build. if is_arm || is_aarch64 || is_ppc64le; then - if is_linux && is_aarch64 && is_musl; then + if is_linux && is_aarch64_musl; then # jemalloc doesn't allow 16K page sizes for linux musl # https://github.com/microsoft/ripgrep-prebuilt/issues/26 JEMALLOC_SYS_WITH_LG_PAGE=14 "$CARGO" build --target "$TARGET" --release --features 'pcre2' From 9120cb48ea081abe542a2f71c2c0b74ef5182d4c Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Wed, 7 Jun 2023 02:32:46 +0900 Subject: [PATCH 5/5] chore: cleanup conditions --- build/build.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/build/build.sh b/build/build.sh index a9c19c0..f6140b3 100755 --- a/build/build.sh +++ b/build/build.sh @@ -12,17 +12,15 @@ main() { # Test a normal debug build. if is_arm || is_aarch64 || is_ppc64le; then - if is_linux && is_aarch64_musl; then - # jemalloc doesn't allow 16K page sizes for linux musl - # https://github.com/microsoft/ripgrep-prebuilt/issues/26 - JEMALLOC_SYS_WITH_LG_PAGE=14 "$CARGO" build --target "$TARGET" --release --features 'pcre2' - else - "$CARGO" build --target "$TARGET" --release --features 'pcre2' - fi + "$CARGO" build --target "$TARGET" --release --features 'pcre2' # pcre2 is not supported on s390x # https://github.com/zherczeg/sljit/issues/89 elif is_s390x; then "$CARGO" build --release --target=$TARGET + elif is_aarch64_musl; then + # force jemalloc to allow 16K page sizes for linux musl + # https://github.com/microsoft/ripgrep-prebuilt/issues/26 + JEMALLOC_SYS_WITH_LG_PAGE=14 "$CARGO" build --target "$TARGET" --release --features 'pcre2' else # Technically, MUSL builds will force PCRE2 to get statically compiled, # but we also want PCRE2 statically build for macOS binaries.