Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 14229b5

Browse files
committed
Add 3.4-asan builds
**What does this PR do?** This PR introduces a new "3.4-asan" build, based on the existing asan builds, but just pointed at whatever's the latest tag in the 3.4 series. **Motivation:** The intention of "3.4-stable" is to provide the latest up-to-date stable Ruby, so that we can reliably use it as a breaking CI step. As discussed in ruby/setup-ruby#682, the current ruby-asan builds are a bit of a "sharp edge" when used in CI because they may break due to changes that are completely unrelated to asan. Building asan rubies is a bit awkward still, as e.g. ruby-build and other version managers don't have support for it, and it requires very modern versions of specific system tools (e.g. clang). **Additional Notes:** After some back-and-forth, the changes are reasonably minimal. In particular, I decided to not touch the logic that determines weather there's a more recent commit to build or not. This does mean that if ruby master sees no commits, but there's a new 3.4 stable release, this won't be picked up immediately; and it also means that if there's a new master commit and no change to the 3.4 branch we still rebuild 3.4-asan. My thinking is that the extra complexity to individually take care of the caching for both branches is not worth the trouble vs doing some extra rebuilds for 3.4-asan. Let me know if you're not convinced, and I can change that. **How to test the change?** I've built this in the downstream fork, and manually downloaded the resulting Ruby and it seems to be in good shape and with asan working fine. * Successful run: https://github.com/DataDog/ruby-dev-builder/actions/runs/12827351740 * Resulting builds: https://github.com/DataDog/ruby-dev-builder/releases/tag/v20250117.103455
1 parent 593dd01 commit 14229b5

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,40 @@ jobs:
1313
outputs:
1414
should_build: ${{ steps.check_commit.outputs.result }}
1515
commit: ${{ steps.latest_commit.outputs.commit }}
16+
commit_3_4_asan: ${{ steps.latest_commit_3_4_asan.outputs.commit }}
1617
steps:
1718
- name: Clone ruby
1819
uses: actions/checkout@v4
1920
with:
2021
repository: ruby/ruby
2122
path: ruby
23+
fetch-tags: true
24+
fetch-depth: 0 # Workaround for https://github.com/actions/checkout/issues/1781
2225
- name: Set latest_commit
2326
id: latest_commit
2427
working-directory: ruby
2528
run: echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
29+
- name: Set latest commit (3.4-asan)
30+
id: latest_commit_3_4_asan
31+
working-directory: ruby
32+
run: |
33+
LATEST_TAG=$(git tag --list | grep -E "v3_4_[0-9]+$" | sort -V | tail -n1)
34+
git checkout "$LATEST_TAG"
35+
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
2636
2737
- name: Check if latest commit already built
2838
uses: actions/github-script@v7
2939
id: check_commit
3040
with:
3141
script: |
3242
const latestDevCommit = "${{ steps.latest_commit.outputs.commit }}"
43+
const latest34Asan = "${{ steps.latest_commit_3_4_asan.outputs.commit }}"
3344
const { owner, repo } = context.repo
3445
let { data: release } = await github.rest.repos.getLatestRelease({ owner, repo })
3546
const latestReleaseCommit = release.body.split('@')[1]
3647
console.log(`Latest release commit: ${latestReleaseCommit}`)
3748
console.log(`Latest ruby commit: ${latestDevCommit}`)
49+
console.log(`Latest 3.4-asan: ${latest34Asan}`)
3850
if (latestReleaseCommit === latestDevCommit) {
3951
return 'false'
4052
} else {
@@ -82,13 +94,21 @@ jobs:
8294
name: [ head, debug ]
8395
include:
8496
- { os: ubuntu-24.04, name: asan }
97+
- { os: ubuntu-24.04, name: 3.4-asan }
8598
runs-on: ${{ matrix.os }}
8699
steps:
87100
- name: Clone ruby
88101
uses: actions/checkout@v4
89102
with:
90103
repository: ruby/ruby
91104
ref: ${{ needs.prepare.outputs.commit }}
105+
if: matrix.name != '3.4-asan'
106+
- name: Clone ruby (3.4-asan)
107+
uses: actions/checkout@v4
108+
with:
109+
repository: ruby/ruby
110+
ref: ${{ needs.prepare.outputs.commit_3_4_asan }}
111+
if: matrix.name == '3.4-asan'
92112
- name: Clone ruby-dev-builder
93113
uses: actions/checkout@v4
94114
with:
@@ -163,7 +183,7 @@ jobs:
163183
# Make the test timeouts more generous too (ASAN is slower)
164184
echo "RUBY_TEST_TIMEOUT_SCALE=5" >> $GITHUB_ENV
165185
echo "SYNTAX_SUGGEST_TIMEOUT=600" >> $GITHUB_ENV
166-
if: matrix.name == 'asan'
186+
if: matrix.name == 'asan' || matrix.name == '3.4-asan'
167187

168188
# Build
169189
- run: mkdir -p ~/.rubies

0 commit comments

Comments
 (0)