Skip to content

Commit

Permalink
fix: pass LG_PAGE env configuration to jemalloc via cross (#30)
Browse files Browse the repository at this point in the history
* 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 e43bca3.

* Revert "Revert "chore: support 64k page size""

This reverts commit 40829fb.
  • Loading branch information
deepak1556 authored Jun 26, 2023
1 parent f9291b0 commit 96e5dcd
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions build/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From 2bb7321d024a3f7e28f072223551706ff556d68c Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
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",
+]

0 comments on commit 96e5dcd

Please sign in to comment.