From 96e5dcda0700c00721d3aa022c4c40ee436ebba5 Mon Sep 17 00:00:00 2001 From: Robo Date: Tue, 27 Jun 2023 00:35:17 +0900 Subject: [PATCH] fix: pass LG_PAGE env configuration to jemalloc via cross (#30) * fix: pass LG_PAGE env configuration to jemalloc via cross * chore: update config location * chore: fix array parsing * chore: support 64k page size * Revert "chore: support 64k page size" This reverts commit e43bca329b8400be3221cd5b7aba16878661cc12. * Revert "Revert "chore: support 64k page size"" This reverts commit 40829fb7cbe0f504932c9b99832388647a5c7656. --- build/build.sh | 2 +- build/linux.yml | 8 ++++++++ config.json | 5 ++++- ...aarch64-unknown-linux-musl-via-cross.patch | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 patches/0001-feat-pass-env-for-aarch64-unknown-linux-musl-via-cross.patch diff --git a/build/build.sh b/build/build.sh index f6140b3..12f1be1 100755 --- a/build/build.sh +++ b/build/build.sh @@ -20,7 +20,7 @@ main() { 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' + JEMALLOC_SYS_WITH_LG_PAGE=16 "$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. diff --git a/build/linux.yml b/build/linux.yml index 03eece4..baadc92 100644 --- a/build/linux.yml +++ b/build/linux.yml @@ -13,6 +13,14 @@ steps: cd ripgrep git checkout $TREEISH displayName: Clone Ripgrep +- script: | + set -ex + for patch in $(node -p "require('../config.json').patches.join(' ')"); do + git apply --ignore-whitespace --ignore-space-change ../patches/$patch + done + workingDirectory: ripgrep + displayName: Apply patches + condition: succeeded() - script: build/install.sh displayName: Install Rust env: diff --git a/config.json b/config.json index c2d0fd4..f27f86b 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,7 @@ { "ripgrepRepo": "BurntSushi/ripgrep", - "ripgrepTag": "13.0.0" + "ripgrepTag": "13.0.0", + "patches": [ + "0001-feat-pass-env-for-aarch64-unknown-linux-musl-via-cross.patch" + ] } \ No newline at end of file diff --git a/patches/0001-feat-pass-env-for-aarch64-unknown-linux-musl-via-cross.patch b/patches/0001-feat-pass-env-for-aarch64-unknown-linux-musl-via-cross.patch new file mode 100644 index 0000000..bfbd6fa --- /dev/null +++ b/patches/0001-feat-pass-env-for-aarch64-unknown-linux-musl-via-cross.patch @@ -0,0 +1,19 @@ +From 2bb7321d024a3f7e28f072223551706ff556d68c Mon Sep 17 00:00:00 2001 +From: deepak1556 +Date: Tue, 13 Jun 2023 01:09:11 +0900 +Subject: [PATCH] feat: pass env for aarch64-unknown-linux-musl via cross + +diff --git a/Cross.toml b/Cross.toml +index 3b0e4ca..7fd7d06 100644 +--- a/Cross.toml ++++ b/Cross.toml +@@ -9,3 +9,8 @@ image = "burntsushi/cross:mips64-unknown-linux-gnuabi64" + + [target.arm-unknown-linux-gnueabihf] + image = "burntsushi/cross:arm-unknown-linux-gnueabihf" ++ ++[target.aarch64-unknown-linux-musl.env] ++passthrough = [ ++ "JEMALLOC_SYS_WITH_LG_PAGE", ++] +