Skip to content

ruby-3.4/3.4.4 package update #53280

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

Merged
merged 3 commits into from
May 16, 2025

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented May 14, 2025

@octo-sts octo-sts bot added request-version-update request for a newer version of a package automated pr labels May 14, 2025
Copy link
Contributor Author

octo-sts bot commented May 14, 2025

🩹 Build Failed: Patch Application Failed

patching file gems/bundled_gems
Hunk #1 FAILED at 10.
1 out of 1 hunk FAILED -- saving rejects to file gems/bundled_gems.rej

Build Details

Category Details
Build System git patching
Failure Point Patch application for removing rexml and net-imap modules from bundled_gems

Root Cause Analysis 🔍

The patch failed to apply cleanly to the gems/bundled_gems file, likely because the content at line 10 differs from what the patch expected. This suggests that either the source code has changed since the patch was created or the patch was created against a different version of the file. Since the build is for ruby-3.4 and targeting tag v3_4_4, there may be differences in the bundled_gems file from what the patch was expecting.


🔍 Build failure fix suggestions

Found similar build failures that have been fixed in the past and analyzed them to suggest a fix:

Suggested Changes

File: remove-already-provided-gems-from-gems_bundled_gems.patch

  • replacement at line all (Entire file)
    Original:
The current patch content that's failing to apply

Replacement:

Create a new patch based on the current source

Content:

To fix this issue, you need to create a new patch file that removes rexml and net-imap modules from the current version of the bundled_gems file. Steps to create this patch:

1. Check out the Ruby source at tag v3_4_4
2. Create a copy of the original gems/bundled_gems file
3. Edit the gems/bundled_gems file to remove the lines for rexml and net-imap
4. Run `git diff --no-index original_bundled_gems gems/bundled_gems > remove-already-provided-gems-from-gems_bundled_gems.patch`

File: Melange YAML

  • alternative at line After git-checkout step (Pipeline section)
    Original:
- uses: patch
    with:
      patches: remove-already-provided-gems-from-gems_bundled_gems.patch

Replacement:

A more dynamic approach to remove bundled gems

Content:

Replace the patch step with a direct file modification:

- name: Remove already provided gems
  runs: |
    # Remove specific gems from bundled gems list
    sed -i '/^rexml/d' gems/bundled_gems
    sed -i '/^net-imap/d' gems/bundled_gems
Click to expand fix analysis

Analysis

The build failure is occurring when trying to apply a patch to the gems/bundled_gems file in the Ruby 3.4.4 source code. The patch is failing to apply cleanly at line 10 of the file. This issue is likely due to changes in the upstream Ruby repository's bundled gems list that has made the existing patch incompatible with the current source code version (v3_4_4).

The patch named remove-already-provided-gems-from-gems_bundled_gems.patch appears to be attempting to remove certain gems (rexml and net-imap) from the bundled gems list. Since Ruby versions may update which gems are bundled or change their positioning in the list, patches targeting specific line numbers can easily break when upstream makes changes.

Click to expand fix explanation

Explanation

The patch is failing because the content of the gems/bundled_gems file in Ruby 3.4.4 has likely changed compared to the version the patch was created for. The patch specifically fails at line 10, which suggests that either:

  1. The position of the gems to be removed (rexml and net-imap) has changed in the file
  2. The content surrounding those entries has changed
  3. Those gems might no longer be included in the bundled gems list or have different versions

Creating a new patch against the current Ruby 3.4.4 source code would ensure that it applies cleanly. Alternatively, using the sed-based approach would make the build more resilient to changes in the bundled_gems file layout, as it removes the targeted gems by name rather than relying on specific line numbers or context.

The sed commands target the specific gems by their names at the beginning of lines, which makes the solution more robust as it will work regardless of where in the file those gems are listed. This approach will continue to work even if the ordering of gems in the file changes in future Ruby versions, as long as the format of the file remains consistent with gem names at the beginning of lines.

Click to expand alternative approaches

Alternative Approaches

  • Update the bundled_gems modification logic to use Ruby itself instead of patching: Add a step after checkout that runs a Ruby script to read the bundled_gems file, filter out unwanted gems, and write back the modified file.
  • Update the Melange YAML to explicitly exclude those gems during configure step: If Ruby's configure script supports excluding certain bundled gems, you could modify the ./configure command to include those options.
  • Create a more robust patch using unified diff format with more context lines: If you prefer using patches, create a new one with more context lines (e.g., git diff -U10) to make it more resilient to small changes in the file.

Was this comment helpful? Please use 👍 or 👎 reactions on this comment.

@octo-sts octo-sts bot added the ai/skip-comment Stop AI from commenting on PR label May 14, 2025
Signed-off-by: Batuhan Apaydin <[email protected]>
Signed-off-by: Batuhan Apaydin <[email protected]>
@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label May 16, 2025
@developer-guy developer-guy requested a review from a team May 16, 2025 17:19
@developer-guy developer-guy self-assigned this May 16, 2025
@kbsteere kbsteere merged commit 8a2c326 into main May 16, 2025
24 checks passed
@kbsteere kbsteere deleted the wolfictl-4fdef11b-f5f7-4234-b71d-ee37b0f511af branch May 16, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/skip-comment Stop AI from commenting on PR automated pr bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. request-version-update request for a newer version of a package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants