Skip to content

Commit

Permalink
Make it possible to override RUBY_TARGET (#512)
Browse files Browse the repository at this point in the history
* Revert "Append -gnu to RUBY_TARGET for GNU Linux builds (#511)"

This reverts commit 798fad1.

* Make it possible to override RUBY_TARGET

Previously if you attempt to run `rb-sys-dock --platform x86_64-linux-gnu`
the `RUBY_TARGET` was hard-coded to `x86_64-linux`. Now this can
be overriden by the `rb-sys-dock` so that the `--platform` argument
can work with `x86_64-linux` or `x86_64-linux-gnu`.
  • Loading branch information
stanhu authored Jan 30, 2025
1 parent 798fad1 commit 7b03755
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile.aarch64-linux
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-aarch64-linux

ENV RUBY_TARGET="aarch64-linux-gnu" \
ENV RUBY_TARGET="aarch64-linux" \
RUST_TARGET="aarch64-unknown-linux-gnu" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
PKG_CONFIG_ALLOW_CROSS="1" \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.arm-linux
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-arm-linux

ENV RUBY_TARGET="arm-linux-gnu" \
ENV RUBY_TARGET="arm-linux" \
RUST_TARGET="arm-unknown-linux-gnueabihf" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
PKG_CONFIG_ALLOW_CROSS="1" \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.x86-linux
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x86-linux

ENV RUBY_TARGET="x86-linux-gnu" \
ENV RUBY_TARGET="x86-linux" \
RUST_TARGET="i686-unknown-linux-gnu" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
PKG_CONFIG_ALLOW_CROSS="1" \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.x86_64-linux
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x86_64-linux

ENV RUBY_TARGET="x86_64-linux-gnu" \
ENV RUBY_TARGET="x86_64-linux" \
RUST_TARGET="x86_64-unknown-linux-gnu" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
PKG_CONFIG_ALLOW_CROSS="1" \
Expand Down
1 change: 0 additions & 1 deletion docker/setup/rubybashrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ main() {
echo "export PATH=\"/usr/local/cargo/bin:\$PATH\"" >> "$OUTFILE"
echo "export RUSTUP_HOME=\"$RUSTUP_HOME\"" >> "$OUTFILE"
echo "export CARGO_HOME=\"$CARGO_HOME\"" >> "$OUTFILE"
echo "export RUBY_TARGET=\"$RUBY_TARGET\"" >> "$OUTFILE"
echo "export RCD_PLATFORM=\"$RUBY_TARGET\"" >> "$OUTFILE"
echo "export RUST_TARGET=\"$RUST_TARGET\"" >> "$OUTFILE"
echo "export RUSTUP_DEFAULT_TOOLCHAIN=\"$RUSTUP_DEFAULT_TOOLCHAIN\"" >> "$OUTFILE"
Expand Down
1 change: 1 addition & 0 deletions gem/exe/rb-sys-dock
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ def rcd(input_args)
-e RB_SYS_DOCK_TMPDIR="/tmp/rb-sys-dock" \
-e RB_SYS_CARGO_TARGET_DIR=#{tmp_target_dir.inspect} \
-e RUBY_CC_VERSION="#{ruby_versions}" \
-e RUBY_TARGET="#{OPTIONS.fetch(:platform)}" \
-e RAKEOPT \
-e TERM \
-w #{working_directory} \
Expand Down

0 comments on commit 7b03755

Please sign in to comment.