Project

General

Profile

Actions

Misc #21770

open

Stop bumping RUBY_PATCHLEVEL in release versions

Misc #21770: Stop bumping RUBY_PATCHLEVEL in release versions
2

Added by k0kubun (Takashi Kokubun) 1 day ago. Updated about 11 hours ago.

Status:
Open
Assignee:
-
[ruby-core:124071]

Description

Proposal

  • Stop bumping RUBY_PATCHLEVEL from 0 in Ruby 4.0.0+

Motivation

  • As a stable branch maintainer, I find it frustrating that reverting a commit made by tool/merger.rb often causes a conflict on #define RUBY_PATCHLEVEL.

Background

  • From Ruby 2.1.0, we stopped doing multiple patch-level releases for a single version, e.g. 2.0.0-p647 and 2.0.0-p648 for Ruby 2.0.0.
  • From Ruby 3.2.0, we stopped showing patch levels on RUBY_DESCRIPTION [Feature #18513]. We thought "patch levels no longer serves us very well".
  • Today, we also backport patches using pull requests on GitHub. We often don't bump RUBY_PATCHLEVEL there because it's easier to use git cherry-pick instead of tool/merger.rb.

Updated by k0kubun (Takashi Kokubun) 1 day ago Actions #1

  • Subject changed from Stop bumping RUBY_PATCHLEVEL in released versions to Stop bumping RUBY_PATCHLEVEL in release versions

Updated by hsbt (Hiroshi SHIBATA) 1 day ago Actions #2 [ruby-core:124077]

I agreed this.

I already hide patchlevel from lockfile of Bundler 4.

https://github.com/ruby/rubygems/pull/7772

Updated by Eregon (Benoit Daloze) about 11 hours ago Actions #3 [ruby-core:124114]

:+1: I don't think it has any usefulness anymore.

I do know of one usage of RUBY_PATCHLEVEL, for detecting if on a dev build or release version via is_release = RUBY_PATCHLEVEL >= 0.
Notably used in https://github.com/grpc/grpc/blob/46b1795eacc99065c46e3fb60fad808c19f71a87/src/ruby/ext/grpc/extconf.rb#L155

So probably best to keep the constant, but only give it values 0 for releases (and on release branch) or -1 for dev builds (from master).

Actions

Also available in: PDF Atom