Skip to content

Commit abf8dda

Browse files
committed
ci: allow overriding build target for build-deb
When building packages for buster, I do want to use glibc rather than musl, because it's being built for a specific distro. Allow a target argument to be passed through. (also ci/docker/buster/build-deb.sh was broken because the container didn't contain the musl target)
1 parent bd78899 commit abf8dda

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

ci/build-deb

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@ D="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
1212
#
1313
# This should be run from the root of the ripgrep repo.
1414

15+
TARGET=x86_64-unknown-linux-musl
16+
while (( $# )); do
17+
case "$1" in
18+
--target)
19+
TARGET="$2"
20+
shift
21+
;;
22+
--no-target)
23+
NO_TARGET=1
24+
;;
25+
esac
26+
shift
27+
done
28+
29+
if (( NO_TARGET )); then
30+
TARGET_ARGS=()
31+
else
32+
TARGET_ARGS=(--target "$TARGET")
33+
fi
34+
1535
if ! command -V cargo-deb > /dev/null 2>&1; then
1636
echo "cargo-deb command missing" >&2
1737
exit 1
@@ -39,4 +59,4 @@ cp complete/_rg "$DEPLOY_DIR/"
3959

4060
# Since we're distributing the dpkg, we don't know whether the user will have
4161
# PCRE2 installed, so just do a static build.
42-
PCRE2_SYS_STATIC=1 cargo deb --target x86_64-unknown-linux-musl
62+
PCRE2_SYS_STATIC=1 cargo deb "${TARGET_ARGS[@]}"

ci/docker/buster/build-deb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ run docker run -t --rm \
2626
--volume "$PWD:/ripgrep" \
2727
--workdir /ripgrep \
2828
$DOCKER_IMAGE \
29-
ci/build-deb
29+
ci/build-deb --no-target

0 commit comments

Comments
 (0)