Skip to content

Commit 1034fda

Browse files
use upgraded gcc
1 parent ceba6c4 commit 1034fda

2 files changed

Lines changed: 32 additions & 7 deletions

File tree

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,27 @@ RUN case "$TARGETARCH" in \
1818
FROM ${BASE_IMAGE}
1919

2020
ARG EXTRA_APT_PACKAGES=""
21+
ARG DEFAULT_CC=""
22+
ARG DEFAULT_CXX=""
23+
ARG DEFAULT_AR=""
24+
ARG X86_64_UNKNOWN_LINUX_GNU_CC=""
25+
ARG X86_64_UNKNOWN_LINUX_GNU_CXX=""
26+
ARG X86_64_UNKNOWN_LINUX_GNU_LINKER=""
2127

2228
RUN if [ -n "$EXTRA_APT_PACKAGES" ]; then \
2329
apt-get update && \
2430
apt-get install -y --no-install-recommends $EXTRA_APT_PACKAGES && \
2531
rm -rf /var/lib/apt/lists/*; \
2632
fi
2733

34+
RUN touch /etc/rubybashrc && \
35+
if [ -n "$DEFAULT_CC" ]; then echo "export CC=$DEFAULT_CC" >> /etc/rubybashrc; fi && \
36+
if [ -n "$DEFAULT_CXX" ]; then echo "export CXX=$DEFAULT_CXX" >> /etc/rubybashrc; fi && \
37+
if [ -n "$DEFAULT_AR" ]; then echo "export AR=$DEFAULT_AR" >> /etc/rubybashrc; fi && \
38+
if [ -n "$X86_64_UNKNOWN_LINUX_GNU_CC" ]; then echo "export CC_x86_64_unknown_linux_gnu=$X86_64_UNKNOWN_LINUX_GNU_CC" >> /etc/rubybashrc; fi && \
39+
if [ -n "$X86_64_UNKNOWN_LINUX_GNU_CXX" ]; then echo "export CXX_x86_64_unknown_linux_gnu=$X86_64_UNKNOWN_LINUX_GNU_CXX" >> /etc/rubybashrc; fi && \
40+
if [ -n "$X86_64_UNKNOWN_LINUX_GNU_LINKER" ]; then echo "export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=$X86_64_UNKNOWN_LINUX_GNU_LINKER" >> /etc/rubybashrc; fi
41+
2842
COPY --from=protoc /opt/protoc/bin/protoc /usr/local/bin/protoc
2943
COPY --from=protoc /opt/protoc/include /usr/local/include
3044

.github/workflows/build-gems.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,32 @@ jobs:
4949
gem install rb_sys --no-document
5050
rb_sys_version="$(ruby -e 'require "rb_sys/version"; puts RbSys::VERSION')"
5151
extra_apt_packages=""
52+
default_cc=""
53+
default_cxx=""
54+
default_ar=""
55+
x86_64_unknown_linux_gnu_cc=""
56+
x86_64_unknown_linux_gnu_cxx=""
57+
x86_64_unknown_linux_gnu_linker=""
5258
if [[ "${{ matrix.rubyPlatform }}" == "x86_64-linux" ]]; then
5359
extra_apt_packages="gcc-10 g++-10"
60+
default_cc="gcc-10"
61+
default_cxx="g++-10"
62+
default_ar="gcc-ar-10"
63+
x86_64_unknown_linux_gnu_cc="gcc-10"
64+
x86_64_unknown_linux_gnu_cxx="g++-10"
65+
x86_64_unknown_linux_gnu_linker="gcc-10"
5466
fi
5567
custom_image="temporalio-rbsys/${{ matrix.rubyPlatform }}:${rb_sys_version}-protoc-${PROTOC_VERSION}"
5668
docker build \
5769
--platform linux/amd64 \
5870
--build-arg BASE_IMAGE="rbsys/${{ matrix.rubyPlatform }}:${rb_sys_version}" \
5971
--build-arg EXTRA_APT_PACKAGES="${extra_apt_packages}" \
72+
--build-arg DEFAULT_CC="${default_cc}" \
73+
--build-arg DEFAULT_CXX="${default_cxx}" \
74+
--build-arg DEFAULT_AR="${default_ar}" \
75+
--build-arg X86_64_UNKNOWN_LINUX_GNU_CC="${x86_64_unknown_linux_gnu_cc}" \
76+
--build-arg X86_64_UNKNOWN_LINUX_GNU_CXX="${x86_64_unknown_linux_gnu_cxx}" \
77+
--build-arg X86_64_UNKNOWN_LINUX_GNU_LINKER="${x86_64_unknown_linux_gnu_linker}" \
6078
--build-arg PROTOC_VERSION="${PROTOC_VERSION}" \
6179
-t "$custom_image" \
6280
-f ../.github/docker/rb-sys-protoc.Dockerfile \
@@ -70,13 +88,6 @@ jobs:
7088
id: cross-gem
7189
working-directory: ./temporalio
7290
run: |
73-
# aws-lc-sys rejects the Ubuntu 20.04 GCC 9 toolchain in the
74-
# current rb-sys x86_64 Linux image, so use GCC 10 in the
75-
# derived image for that target.
76-
if [[ "${{ matrix.rubyPlatform }}" == "x86_64-linux" ]]; then
77-
export CC_x86_64_unknown_linux_gnu=gcc-10
78-
export CXX_x86_64_unknown_linux_gnu=g++-10
79-
fi
8091
RCD_IMAGE="${{ steps.build-rb-sys-dock-image.outputs.image }}" rb-sys-dock --platform "${{ matrix.rubyPlatform }}" --ruby-versions "3.3,3.4,4.0" --mount-toolchains --build
8192
echo "gem-path=$(find pkg -name '*-${{ matrix.rubyPlatform }}.gem')" >> "$GITHUB_OUTPUT"
8293

0 commit comments

Comments
 (0)