Skip to content

Commit

Permalink
Build against glibc 2.26
Browse files Browse the repository at this point in the history
Previously we were building against glibc 2.26.

amazonlinux 2 has 2.26, and we have users wanting to use this, so let's
jump back a couple of glibcs to support them.

Another advantage here is that amazonlinux maintains `yum` working out
of the box, rather than needing to configure mirrors.

A down-side is that the `node` version used by the `checkout` action
links a newer glibc than 2.26. For now we activate a hatch to revert to
an older node, but in the future we may need to work around another way,
e.g. by manually checking out the source ourselves instead of relying on
the actions action which relies on node. We also now perform container
set-up before the checkout action, so we can set up the tools it assumes
(e.g. `tar`)
  • Loading branch information
illicitonion committed Sep 10, 2024
1 parent 8d24006 commit 51c0bf0
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 124 deletions.
113 changes: 68 additions & 45 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ name: PR
jobs:
unknown-linux-gnu-x86_64-x86_64:
runs-on: ubuntu-latest
container: centos:centos8
container: amazonlinux:2
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
steps:
- run: yum install -y bzip2 git gzip make patch tar wget which
- run: yum group install -y "Development Tools"
- run: ln -s /usr/bin/tar /usr/bin/gnutar
- name: Checkout repo
uses: actions/checkout@v3
- run: sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*
- run: sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g'
/etc/yum.repos.d/CentOS-*
- run: yum install -y bzip2 git make patch wget
- run: dnf group install -y "Development Tools"
- run: ln -s /usr/bin/tar /usr/bin/gnutar
- name: Build musl
run: ./build.sh x86_64
- name: Upload musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl.tar.gz
Expand All @@ -27,10 +27,14 @@ jobs:
if-no-files-found: error
unknown-linux-gnu-x86_64-x86_64-test-build:
runs-on: ubuntu-latest
container: centos:centos8
container: amazonlinux:2
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
needs:
- unknown-linux-gnu-x86_64-x86_64
steps:
- run: yum install -y gzip tar
- name: Checkout repo
uses: actions/checkout@v3
- name: Download musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl.tar.gz
Expand Down Expand Up @@ -81,9 +85,9 @@ jobs:
apple-darwin-x86_64-x86_64:
runs-on: macos-12
steps:
- run: brew install wget md5sha1sum gnu-tar
- name: Checkout repo
uses: actions/checkout@v3
- run: brew install wget md5sha1sum gnu-tar
- name: Build musl
run: ./build.sh x86_64
- name: Upload musl-1.2.3-platform-x86_64-apple-darwin-target-x86_64-linux-musl.tar.gz
Expand Down Expand Up @@ -142,9 +146,9 @@ jobs:
apple-darwin-aarch64-x86_64:
runs-on: macos-14
steps:
- run: brew install wget md5sha1sum gnu-tar
- name: Checkout repo
uses: actions/checkout@v3
- run: brew install wget md5sha1sum gnu-tar
- name: Build musl
run: ./build.sh x86_64
- name: Upload musl-1.2.3-platform-aarch64-apple-darwin-target-x86_64-linux-musl.tar.gz
Expand Down Expand Up @@ -202,7 +206,10 @@ jobs:
if-no-files-found: error
test-x86_64:
runs-on: ubuntu-latest
container: centos:centos8
container: amazonlinux:2
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
needs:
- unknown-linux-gnu-x86_64-x86_64-test-build
- apple-darwin-x86_64-x86_64-test-build
Expand Down Expand Up @@ -244,16 +251,16 @@ jobs:
-- -//:run_built_binary_aarch64-unknown-linux-gnu_test
unknown-linux-gnu-x86_64-aarch64:
runs-on: ubuntu-latest
container: centos:centos8
container: amazonlinux:2
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
steps:
- run: yum install -y bzip2 git gzip make patch tar wget which
- run: yum group install -y "Development Tools"
- run: ln -s /usr/bin/tar /usr/bin/gnutar
- name: Checkout repo
uses: actions/checkout@v3
- run: sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*
- run: sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g'
/etc/yum.repos.d/CentOS-*
- run: yum install -y bzip2 git make patch wget
- run: dnf group install -y "Development Tools"
- run: ln -s /usr/bin/tar /usr/bin/gnutar
- name: Build musl
run: ./build.sh aarch64
- name: Upload musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl.tar.gz
Expand All @@ -264,10 +271,14 @@ jobs:
if-no-files-found: error
unknown-linux-gnu-x86_64-aarch64-test-build:
runs-on: ubuntu-latest
container: centos:centos8
container: amazonlinux:2
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
needs:
- unknown-linux-gnu-x86_64-aarch64
steps:
- run: yum install -y gzip tar
- name: Checkout repo
uses: actions/checkout@v3
- name: Download musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl.tar.gz
Expand All @@ -291,14 +302,18 @@ jobs:
\ \"@platforms//os:linux\",\n ],\n target_compatible_with = [\n\
\ \"@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n \
\ ],\n toolchain = \"@musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:toolchain_type\",\n)\n\n\
platform(\n name = \"platform\",\n constraint_values = [\n \"\
@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n ],\n)\n\n\
EOF\n"
- name: Build test binary and test with musl
run: cd test-workspaces/builder && BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 bazel
build //:binary //:test --platforms=//config:platform --extra_toolchains=//config:musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl
--incompatible_enable_cc_toolchain_resolution
,\n toolchain_type = \"@bazel_tools//tools/cpp:toolchain_type\",\n)\ntoolchain(\n\
\ name = \"musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl_test_toolchain\"\
,\n exec_compatible_with = [\n \"@platforms//cpu:arm64\",\n \
\ \"@platforms//os:linux\",\n ],\n target_compatible_with = [\n \
\ \"@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n \
\ ],\n toolchain = \"@musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl//:musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl_test_toolchain\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:test_runner_toolchain_type\"\
,\n)\n\nplatform(\n name = \"platform\",\n constraint_values = [\n \
\ \"@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n \
\ ],\n)\n\nEOF\n"
- name: Build with musl
run: cd test-workspaces/builder && bazel build //:binary
- name: Move test binary
run: mkdir output && cp test-workspaces/builder/bazel-bin/binary output/test-binary-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl
- name: Upload test-binary-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl
Expand All @@ -310,9 +325,9 @@ jobs:
apple-darwin-x86_64-aarch64:
runs-on: macos-12
steps:
- run: brew install wget md5sha1sum gnu-tar
- name: Checkout repo
uses: actions/checkout@v3
- run: brew install wget md5sha1sum gnu-tar
- name: Build musl
run: ./build.sh aarch64
- name: Upload musl-1.2.3-platform-x86_64-apple-darwin-target-aarch64-linux-musl.tar.gz
Expand Down Expand Up @@ -348,14 +363,18 @@ jobs:
\ \"@platforms//os:osx\",\n ],\n target_compatible_with = [\n \
\ \"@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n \
\ ],\n toolchain = \"@musl-1_2_3-platform-x86_64-apple-darwin-target-aarch64-linux-musl\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:toolchain_type\",\n)\n\n\
platform(\n name = \"platform\",\n constraint_values = [\n \"\
@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n ],\n)\n\n\
EOF\n"
- name: Build test binary and test with musl
run: cd test-workspaces/builder && BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 bazel
build //:binary //:test --platforms=//config:platform --extra_toolchains=//config:musl-1_2_3-platform-x86_64-apple-darwin-target-aarch64-linux-musl
--incompatible_enable_cc_toolchain_resolution
,\n toolchain_type = \"@bazel_tools//tools/cpp:toolchain_type\",\n)\ntoolchain(\n\
\ name = \"musl-1_2_3-platform-x86_64-apple-darwin-target-aarch64-linux-musl_test_toolchain\"\
,\n exec_compatible_with = [\n \"@platforms//cpu:arm64\",\n \
\ \"@platforms//os:linux\",\n ],\n target_compatible_with = [\n \
\ \"@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n \
\ ],\n toolchain = \"@musl-1_2_3-platform-x86_64-apple-darwin-target-aarch64-linux-musl//:musl-1_2_3-platform-x86_64-apple-darwin-target-aarch64-linux-musl_test_toolchain\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:test_runner_toolchain_type\"\
,\n)\n\nplatform(\n name = \"platform\",\n constraint_values = [\n \
\ \"@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n \
\ ],\n)\n\nEOF\n"
- name: Build with musl
run: cd test-workspaces/builder && bazel build //:binary
- name: Move test binary
run: mkdir output && cp test-workspaces/builder/bazel-bin/binary output/test-binary-platform-x86_64-apple-darwin-target-aarch64-linux-musl
- name: Upload test-binary-platform-x86_64-apple-darwin-target-aarch64-linux-musl
Expand All @@ -367,9 +386,9 @@ jobs:
apple-darwin-aarch64-aarch64:
runs-on: macos-14
steps:
- run: brew install wget md5sha1sum gnu-tar
- name: Checkout repo
uses: actions/checkout@v3
- run: brew install wget md5sha1sum gnu-tar
- name: Build musl
run: ./build.sh aarch64
- name: Upload musl-1.2.3-platform-aarch64-apple-darwin-target-aarch64-linux-musl.tar.gz
Expand Down Expand Up @@ -405,14 +424,18 @@ jobs:
\ \"@platforms//os:osx\",\n ],\n target_compatible_with = [\n \
\ \"@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n ],\n\
\ toolchain = \"@musl-1_2_3-platform-aarch64-apple-darwin-target-aarch64-linux-musl\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:toolchain_type\",\n)\n\n\
platform(\n name = \"platform\",\n constraint_values = [\n \"\
@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n ],\n)\n\n\
EOF\n"
- name: Build test binary and test with musl
run: cd test-workspaces/builder && BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 bazel
build //:binary //:test --platforms=//config:platform --extra_toolchains=//config:musl-1_2_3-platform-aarch64-apple-darwin-target-aarch64-linux-musl
--incompatible_enable_cc_toolchain_resolution
,\n toolchain_type = \"@bazel_tools//tools/cpp:toolchain_type\",\n)\ntoolchain(\n\
\ name = \"musl-1_2_3-platform-aarch64-apple-darwin-target-aarch64-linux-musl_test_toolchain\"\
,\n exec_compatible_with = [\n \"@platforms//cpu:arm64\",\n \
\ \"@platforms//os:linux\",\n ],\n target_compatible_with = [\n \
\ \"@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n \
\ ],\n toolchain = \"@musl-1_2_3-platform-aarch64-apple-darwin-target-aarch64-linux-musl//:musl-1_2_3-platform-aarch64-apple-darwin-target-aarch64-linux-musl_test_toolchain\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:test_runner_toolchain_type\"\
,\n)\n\nplatform(\n name = \"platform\",\n constraint_values = [\n \
\ \"@platforms//cpu:arm64\",\n \"@platforms//os:linux\",\n \
\ ],\n)\n\nEOF\n"
- name: Build with musl
run: cd test-workspaces/builder && bazel build //:binary
- name: Move test binary
run: mkdir output && cp test-workspaces/builder/bazel-bin/binary output/test-binary-platform-aarch64-apple-darwin-target-aarch64-linux-musl
- name: Upload test-binary-platform-aarch64-apple-darwin-target-aarch64-linux-musl
Expand Down
Loading

0 comments on commit 51c0bf0

Please sign in to comment.