Skip to content

Commit a497fde

Browse files
chore: fix linux x86 build (#427)
* try out clang * just bump gcc * use upgraded gcc * simplify dockerfile update * no longer build gems on pr * correct comment to be actual english
1 parent 0f87089 commit a497fde

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

.github/docker/rb-sys-protoc.Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ RUN case "$TARGETARCH" in \
1717

1818
FROM ${BASE_IMAGE}
1919

20+
ARG GCC_VERSION=""
21+
22+
RUN if [ -n "$GCC_VERSION" ]; then \
23+
apt-get update && \
24+
apt-get install -y --no-install-recommends gcc-${GCC_VERSION} g++-${GCC_VERSION} && \
25+
rm -rf /var/lib/apt/lists/*; \
26+
fi
27+
28+
RUN touch /etc/rubybashrc && \
29+
if [ -n "$GCC_VERSION" ]; then \
30+
echo "export CC=gcc-${GCC_VERSION}" >> /etc/rubybashrc; \
31+
echo "export CXX=g++-${GCC_VERSION}" >> /etc/rubybashrc; \
32+
echo "export AR=gcc-ar-${GCC_VERSION}" >> /etc/rubybashrc; \
33+
echo "export CC_x86_64_unknown_linux_gnu=gcc-${GCC_VERSION}" >> /etc/rubybashrc; \
34+
echo "export CXX_x86_64_unknown_linux_gnu=g++-${GCC_VERSION}" >> /etc/rubybashrc; \
35+
echo "export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=gcc-${GCC_VERSION}" >> /etc/rubybashrc; \
36+
fi
37+
2038
COPY --from=protoc /opt/protoc/bin/protoc /usr/local/bin/protoc
2139
COPY --from=protoc /opt/protoc/include /usr/local/include
2240

.github/workflows/build-gems.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ jobs:
1717
matrix:
1818
# TODO(cretz): Enable x64-mingw-ucrt if we can figure out Windows issue, see
1919
# https://github.com/temporalio/sdk-ruby/issues/172
20-
rubyPlatform: ["aarch64-linux", "aarch64-linux-musl", "x86_64-linux", "x86_64-linux-musl", "arm64-darwin", "x86_64-darwin"]
20+
include:
21+
- rubyPlatform: aarch64-linux
22+
- rubyPlatform: aarch64-linux-musl
23+
# aws-lc-rs refuses to use GCC version included in image due to compiler bug
24+
- rubyPlatform: x86_64-linux
25+
gccVersion: "10"
26+
- rubyPlatform: x86_64-linux-musl
27+
- rubyPlatform: arm64-darwin
28+
- rubyPlatform: x86_64-darwin
2129
steps:
2230
- name: Checkout repository
2331
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -51,6 +59,7 @@ jobs:
5159
docker build \
5260
--platform linux/amd64 \
5361
--build-arg BASE_IMAGE="rbsys/${{ matrix.rubyPlatform }}:${rb_sys_version}" \
62+
--build-arg GCC_VERSION="${{ matrix.gccVersion || '' }}" \
5463
--build-arg PROTOC_VERSION="${PROTOC_VERSION}" \
5564
-t "$custom_image" \
5665
-f ../.github/docker/rb-sys-protoc.Dockerfile \

0 commit comments

Comments
 (0)