Skip to content

Conversation

@ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Nov 25, 2025

What does this PR do?

This PR bumps the gem version to 3.4.2 in preparation for releasing Ruby 4.0.0-preview2 support (added in #18).

It also updates the test-compilation.yml checks to run with Ruby 4.

Motivation:

Release a new version with support for 4.0.0-preview2.

Additional Notes:

Why version 3.4.2? Adding more headers is backwards-compatible, and while upstream was keeping gem version 1:1 with ruby version, it's awkward to do that with Ruby preview releases so I just bumped the patch 🤷 . We can decide to bump the major once 4.0 stable is out.

How to test the change?

The CI check validates this change + I've tested it locally by running bundle exec rake package, installing the result, and then confirming the profiler successfully builds with it (tested Ruby 3.4 and 4.0 manually).

**What does this PR do?**

This PR bumps the gem version to 3.4.2 in preparation for releasing
Ruby 4.0.0-preview2 support (added in #18).

It also updates the `test-compilation.yml` checks to run with Ruby 4.

**Motivation:**

Release a new version with support for 4.0.0-preview2.

**Additional Notes:**

**How to test the change?**

The CI check validates this change + I've tested it locally by
running `bundle exec rake package`, installing the result, and then
confirming the profiler successfully builds with it
(tested Ruby 3.4 and 4.0 manually).
ivoanjo added a commit to DataDog/dd-trace-rb that referenced this pull request Nov 25, 2025
**What does this PR do?**

This PR adds the `ruby-4.0.gemfile` file that's needed for running
`bundle install` on Ruby 4.0.0-preview2.

The contents of this file being added are copy/pasted from
`ruby-4.0.gemfile` with no changes.

I did not add or change anything on purpose: This is a very minimal
part of the Ruby 4 CI support being prepared in
#5084 but
unlocks local development with Ruby 4.0. I suggest we keep
adjustments/cleanups/etc for that later PR where we officially add Ruby
4.0 to our CI.

**Motivation:**

Without this file it's impossible to do local development on
Ruby 4.0.0-preview2.

It also came up in
<DataDog/datadog-ruby_core_source#19>:
we want to check if the profiler extension compiles on Ruby 4.0 and
we're not able without this file.

With this PR we can run `bundle install` and start running tests
and tackling what's missing.

**Additional Notes:**

N/A

**How to test the change?**

Validate that it's possible to run `bundle install` on Ruby 4.0.
@ivoanjo
Copy link
Member Author

ivoanjo commented Nov 25, 2025

Hmm dd-trace-rb is not building on Ruby 4.0.0-preview2 because it's missing the version-specific gemfile we use for development. I've opened DataDog/dd-trace-rb#5092 to add this. After that PR lands in master we should be able to re-trigger CI on this PR and get a green result.

@ivoanjo ivoanjo requested a review from a team November 25, 2025 14:35
@ivoanjo
Copy link
Member Author

ivoanjo commented Nov 25, 2025

✔️ DataDog/dd-trace-rb#5092 has been merged and I re-triggered CI and it's all a beautiful sea of ready for review green.

module Datadog
module RubyCoreSource
VERSION = '3.4.1'
VERSION = '3.4.2'
Copy link
Member

Choose a reason for hiding this comment

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

Do we still merge-rebase-sync with upstream or do we do things 100% our own way these days?

Should there be a Ruby 3.4.2 then we'd be kind of out of beat in a misleading and confusing way. Maybe using a suffix like 3.4.1.1?

Or... debase-ruby_core_source has released a 4.0.0.preview2. Would that work?

Or we simply do away with pretending to sync and just do our own very-obviously-not-sync'd versioning like 10.x.z or 2025.u.v.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah we're not in sync with upstream anymore -- we've changed a bit the helpers, only carry a subset of the headers, etc. I mentioned in the PR description:

Why version 3.4.2? Adding more headers is backwards-compatible, and while upstream was keeping gem version 1:1 with ruby version, it's awkward to do that with Ruby preview releases so I just bumped the patch 🤷 . We can decide to bump the major once 4.0 stable is out.

I think we should just decouple from Ruby versions, at least for now. We can always re-align once 4.0.0 comes out and we delete the 3.5.0-preview1 and 4.0.0-preview2 headers?

@ivoanjo ivoanjo merged commit 3abb0f7 into master Nov 26, 2025
35 of 37 checks passed
@ivoanjo ivoanjo deleted the ivoanjo/prof-13115-bump-gem-version branch November 26, 2025 08:46
ivoanjo added a commit that referenced this pull request Dec 9, 2025
**What does this PR do?**

This PR temporarily disables the "Ruby 4.0 corruption" test that's
blocking us from releasing the gem as per
<https://github.com/DataDog/datadog-ruby_core_source/actions/runs/20057267656/job/57525327190>.

**Motivation:**

Release latest version of the gem, including Ruby 4.0.0-beta2 support.

**Additional Notes:**

The issue in question is caused by dd-trace-rb currently pinning Ruby
4.0 to a specific hash
(in https://github.com/DataDog/dd-trace-rb/blob/48b4d79d6d043271dc760277ddc820f5343f335c/ruby-4.0.gemfile#L81).

This interacts incorrectly with the "corruption" test, making it use
the wrong version of the gem:

(This is the output from the `bundle info` right before the test runs
showing the wrong version being used for the "Add
datadog-ruby_core_source" step, from
<https://github.com/DataDog/datadog-ruby_core_source/actions/runs/20057267656/job/57525327190>)

```
  * datadog-ruby_core_source (3.4.1 7b95302)
	Summary: Provide Ruby core source files
	Homepage: https://github.com/DataDog/datadog-ruby_core_source
	Path: /usr/local/bundle/bundler/gems/datadog-ruby_core_source-7b95302a593c
	Reverse Dependencies:
		datadog (2.23.0) depends on datadog-ruby_core_source (~> 3.4, >= 3.4.1)
```

The expected correct output can be seen in
<https://github.com/DataDog/datadog-ruby_core_source/actions/runs/20057267656/job/57525327215>:

```
  * datadog-ruby_core_source (3.4.2)
	Summary: Provide Ruby core source files
	Homepage: https://github.com/DataDog/datadog-ruby_core_source
	Path: /__w/datadog-ruby_core_source/datadog-ruby_core_source/datadog-ruby_core_source
	Reverse Dependencies:
		datadog (2.23.0) depends on datadog-ruby_core_source (~> 3.4, >= 3.4.1)
```

This messup makes CI fail even though everything is fine.

This is a loop: dd-trace-rb requires the pinning BECAUSE we haven't
released this gem yet.

So to break the loop, let's:
1. omit this test temporarily
2. then we can release this gem
3. then we can undo the dd-trace-rb pinning
4. then we can re-enable the test

This PR is step 1. I'll take care of all 4 ;)

P.s.: Why didn't we see this before? That's because the dd-trace-rb
pinning was not there when we initially added the 4.0.0-preview2
headers in #19. Then the pinning was added on the dd-trace-rb side and
it silently created this problem for datadog-ruby_core_source CI.

**How to test the change?**

CI should be green after this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants