Skip to content

Conversation

@b-dean
Copy link

@b-dean b-dean commented Aug 21, 2025

Description

If I have a project with a ruby version of 3.2.0 or higher, and I build for CentOS/RHEL, I get the following error when it tries to apply ruby-3.1.6-configure.patch:

          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 | Starting build
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 | Version overridden from 3.1.3 to 3.3.6
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 | Environment:
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 |   CFLAGS="-I/opt/example/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector -O3 -g -pipe"
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 |   CPPFLAGS="-I/opt/example/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector -O3 -g -pipe"
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 |   CXXFLAGS="-I/opt/example/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector -O3 -g -pipe"
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 |   LDFLAGS="-Wl,-rpath,/opt/example/embedded/lib -L/opt/example/embedded/lib"
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 |   LD_RUN_PATH="/opt/example/embedded/lib"
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 |   OMNIBUS_INSTALL_DIR="/opt/example"
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 |   PATH="/opt/example/bin:/opt/example/embedded/bin:/work/.vendor/bundle/ruby/3.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/omnibus-toolchain/bin:/opt/omnibus-toolchain/embedded/bin/"
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 |   PKG_CONFIG_PATH="/opt/example/embedded/lib/pkgconfig"
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 | $ patch -p1 -i /work/.vendor/bundle/ruby/3.3.0/bundler/gems/omnibus-software-50c78858b655/config/patches/ruby/ruby-3.1.6-configure.patch
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 | Apply patch `ruby-3.1.6-configure.patch': 0.0196s
          [Builder: ruby] I | 2025-08-20T16:32:54+00:00 | Build ruby: 0.0199s
The following shell command exited with status 1:

    $ CFLAGS=-I/opt/example/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector -O3 -g -pipe CPPFLAGS=-I/opt/example/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector -O3 -g -pipe CXXFLAGS=-I/opt/example/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector -O3 -g -pipe LDFLAGS=-Wl,-rpath,/opt/example/embedded/lib -L/opt/example/embedded/lib LD_RUN_PATH=/opt/example/embedded/lib OMNIBUS_INSTALL_DIR=/opt/example PATH=/opt/example/bin:/opt/example/embedded/bin:/work/.vendor/bundle/ruby/3.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/omnibus-toolchain/bin:/opt/omnibus-toolchain/embedded/bin/ PKG_CONFIG_PATH=/opt/example/embedded/lib/pkgconfig patch -p1 -i /work/.vendor/bundle/ruby/3.3.0/bundler/gems/omnibus-software-50c78858b655/config/patches/ruby/ruby-3.1.6-configure.patch

Output:

    patching file configure.ac
Hunk #1 FAILED at 363.
1 out of 1 hunk FAILED -- saving rejects to file configure.ac.rej
patching file thread_pthread.h
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 72.
1 out of 1 hunk FAILED -- saving rejects to file thread_pthread.h.rej

Error:

    (nothing)

The project file looks something like this:

name 'example'
override :ruby, version: '3.3.6', source: { sha256: '8dc48fffaf270f86f1019053f28e51e4da4cce32a36760a0603a9aee67d7fd8d' }
# ... and so on ...

This worked for us previously in 052b094. The diff shows that the constraint for this patch was changed from = 3.1.6 to >= 3.1.6, despite the patch not being needed in >= 3.2.0
052b094...50c7885#files_bucket

In Ruby 3.2.0, configure.ac already has the lines added by the patch: https://github.com/ruby/ruby/blob/v3_2_0/configure.ac#L369-L374

Also in thread_pthread.h:
https://github.com/ruby/ruby/blob/v3_2_0/thread_pthread.h#L93-L100

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

@b-dean b-dean requested review from a team as code owners August 21, 2025 20:27
@sonarqubecloud
Copy link

In Ruby 3.2.0, `configure.ac` already has the lines added by the patch:
https://github.com/ruby/ruby/blob/v3_2_0/configure.ac#L369-L374

Also in `thread_pthread.h`:
https://github.com/ruby/ruby/blob/v3_2_0/thread_pthread.h#L93-L100

Signed-off-by: Ben Dean <[email protected]>
@sonarqubecloud
Copy link

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.

1 participant