Skip to content

Add 3.4-asan builds #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,40 @@ jobs:
outputs:
should_build: ${{ steps.check_commit.outputs.result }}
commit: ${{ steps.latest_commit.outputs.commit }}
commit_3_4_asan: ${{ steps.latest_commit_3_4_asan.outputs.commit }}
steps:
- name: Clone ruby
uses: actions/checkout@v4
with:
repository: ruby/ruby
path: ruby
fetch-tags: true
fetch-depth: 0 # Workaround for https://github.com/actions/checkout/issues/1781
- name: Set latest_commit
id: latest_commit
working-directory: ruby
run: echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Set latest commit (3.4-asan)
id: latest_commit_3_4_asan
working-directory: ruby
run: |
LATEST_TAG=$(git tag --list | grep -E "v3_4_[0-9]+$" | sort -V | tail -n1)
git checkout "$LATEST_TAG"
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
Comment on lines +29 to +35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a ruby_3_4 branch which could simplify quite a bit of logic added here.
It wouldn't necessarily be a release, but at least that branch should equivalent to a release + potentially some extra bug fixes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a ruby_3_4 branch which could simplify quite a bit of logic added here.
It wouldn't necessarily be a release, but at least that branch should equivalent to a release + potentially some extra bug fixes.

Actually that's even easier and in fact I started there. Then I decided to get a bit fancy haha. My assumption is that using the latest released snapshot is a bit more stable (and going back to your point above, it should mean even less rebuilds overall), but I'm happy to revert this back to directling using ruby_3_4.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do this change to see how much it simplifies?
It's probably good to keep the current diff in some other branch as those semantics might be desirable, but I'm keen to simplify if we can.


- name: Check if latest commit already built
uses: actions/github-script@v7
id: check_commit
with:
script: |
const latestDevCommit = "${{ steps.latest_commit.outputs.commit }}"
const latest34Asan = "${{ steps.latest_commit_3_4_asan.outputs.commit }}"
const { owner, repo } = context.repo
let { data: release } = await github.rest.repos.getLatestRelease({ owner, repo })
const latestReleaseCommit = release.body.split('@')[1]
console.log(`Latest release commit: ${latestReleaseCommit}`)
console.log(`Latest ruby commit: ${latestDevCommit}`)
console.log(`Latest 3.4-asan: ${latest34Asan}`)
if (latestReleaseCommit === latestDevCommit) {
return 'false'
} else {
Expand All @@ -47,6 +59,8 @@ jobs:
needs: [prepare]
if: needs.prepare.outputs.should_build == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
Expand Down Expand Up @@ -82,13 +96,21 @@ jobs:
name: [ head, debug ]
include:
- { os: ubuntu-24.04, name: asan }
- { os: ubuntu-24.04, name: 3.4-asan }
runs-on: ${{ matrix.os }}
steps:
- name: Clone ruby
uses: actions/checkout@v4
with:
repository: ruby/ruby
ref: ${{ needs.prepare.outputs.commit }}
if: matrix.name != '3.4-asan'
- name: Clone ruby (3.4-asan)
uses: actions/checkout@v4
with:
repository: ruby/ruby
ref: ${{ needs.prepare.outputs.commit_3_4_asan }}
if: matrix.name == '3.4-asan'
- name: Clone ruby-dev-builder
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -163,7 +185,7 @@ jobs:
# Make the test timeouts more generous too (ASAN is slower)
echo "RUBY_TEST_TIMEOUT_SCALE=5" >> $GITHUB_ENV
echo "SYNTAX_SUGGEST_TIMEOUT=600" >> $GITHUB_ENV
if: matrix.name == 'asan'
if: matrix.name == 'asan' || matrix.name == '3.4-asan'

# Build
- run: mkdir -p ~/.rubies
Expand Down Expand Up @@ -207,6 +229,8 @@ jobs:
publish:
name: Publish Release
needs: [release, build]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Publish Release
Expand Down