Skip to content
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

convert/gem: Update convert gem to reflect the state of ruby3.3 #1660

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

justinvreeland
Copy link
Contributor

Melange Pull Request Template

Functional Changes

  • This change can build all of Wolfi without errors (describe results in notes)

Notes:
These changes are just in the gem convert pieces and won't effect builds

convert/gem: Update convert gem to reflect the state of ruby3.3

Changes:

  • Update default ruby to 3.3
  • Remove keyring entries wolfictl lint rejects them
❯ wolfictl lint ruby3.2-diff-lcs.yaml
2024/11/19 09:51:17 INFO Package: ruby3.2-diff-lcs: [forbidden-repository-used]: forbidden repository https://packages.wolfi.dev/os is used (ERROR)
[forbidden-keyring-used]: forbidden keyring https://packages.wolfi.dev/os/wolfi-signing.rsa.pub is used (ERROR)
  • Remove README it causes build to fial
  • Remove patch people will notice when it fails and the sed in pipelines/ruby/build should account for it
  • Truncate dscription becuase it breaks index generation
2024/11/19 10:01:40 ERRO failed to build package: unable to generate index: updating index: failed to parse package packages/aarch64/ruby3.2-diff-lcs-1.5.1-r0.apk: ini.ShadowLoad(): key-value delimiter not found: McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities

@justinvreeland
Copy link
Contributor Author

justinvreeland commented Nov 19, 2024

@smoser might be interested since they did the ruby3.3 stuff
@Dentrax also might be interested since IIC believe is also working on a PR for adding a ruby require test pipeline.

@justinvreeland
Copy link
Contributor Author

Current version:

# Generated from https://github.com/halostatue/diff-lcs
package:
  name: ruby3.2-diff-lcs
  version: 1.5.1
  epoch: 0
  description: |-
    Diff::LCS computes the difference between two Enumerable sequences using the
    McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
    to create a simple HTML diff output format and a standard diff-like tool.

    This is release 1.4.3, providing a simple extension that allows for
    Diff::LCS::Change objects to be treated implicitly as arrays and fixes a
    number of formatting issues.

    Ruby versions below 2.5 are soft-deprecated, which means that older versions
    are no longer part of the CI test suite. If any changes have been introduced
    that break those versions, bug reports and patches will be accepted, but it
    will be up to the reporter to verify any fixes prior to release. The next
    major release will completely break compatibility.
  copyright:
    - license: MIT
    - license: Artistic-2.0
    - license: GPL-2.0-or-later
environment:
  contents:
    build_repositories:
      - https://packages.wolfi.dev/os
    keyring:
      - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
    packages:
      - build-base
      - busybox
      - ca-certificates-bundle
      - git
      - ruby-3.2
      - ruby-3.2-dev
pipeline:
  - uses: fetch
    with:
      README: 'CONFIRM WITH: curl -L https://github.com/halostatue/diff-lcs/archive/refs/tags/v1.5.1.tar.gz | sha256sum'
      expected-sha256: 50c1e43e1cae4bf65c139d628688cd80a29fe6c33bda4a66a98e98d3c8c601c2
      uri: https://github.com/halostatue/diff-lcs/archive/refs/tags/v${{package.version}}.tar.gz
  - uses: patch
    with:
      README: This is only required if the gemspec is using a signing key
      patches: patches/${{package.name}}.patch
  - uses: ruby/build
    with:
      gem: ${{vars.gem}}
  - uses: ruby/install
    with:
      gem: ${{vars.gem}}
      version: ${{package.version}}
  - uses: ruby/clean
vars:
  gem: diff-lcs

New Version:

# Generated from https://github.com/halostatue/diff-lcs
package:
  name: ruby3.3-diff-lcs
  version: 1.5.1
  epoch: 0
  description: Diff::LCS computes the difference between two Enumerable sequences using the
  copyright:
    - license: MIT
    - license: Artistic-2.0
    - license: GPL-2.0-or-later
environment:
  contents:
    packages:
      - build-base
      - busybox
      - ca-certificates-bundle
      - git
      - ruby-${{rubyMM}}
      - ruby-${{rubyMM}}-dev
pipeline:
  - uses: fetch
    with:
      expected-sha256: 50c1e43e1cae4bf65c139d628688cd80a29fe6c33bda4a66a98e98d3c8c601c2
      uri: https://github.com/halostatue/diff-lcs/archive/refs/tags/v${{package.version}}.tar.gz
  - uses: ruby/build
    with:
      gem: ${{vars.gem}}
  - uses: ruby/install
    with:
      gem: ${{vars.gem}}
      version: ${{package.version}}
  - uses: ruby/clean
vars:
  gem: diff-lcs
var-transforms:
  - from: ${{package.name}}
    match: ^ruby(\d.\d+)-.
    replace: $1
    to: rubyMM

Diff:

3c3
<   name: ruby3.2-diff-lcs
---
>   name: ruby3.3-diff-lcs
6,19c6
<   description: |-
<     Diff::LCS computes the difference between two Enumerable sequences using the
<     McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
<     to create a simple HTML diff output format and a standard diff-like tool.
< 
<     This is release 1.4.3, providing a simple extension that allows for
<     Diff::LCS::Change objects to be treated implicitly as arrays and fixes a
<     number of formatting issues.
< 
<     Ruby versions below 2.5 are soft-deprecated, which means that older versions
<     are no longer part of the CI test suite. If any changes have been introduced
<     that break those versions, bug reports and patches will be accepted, but it
<     will be up to the reporter to verify any fixes prior to release. The next
<     major release will completely break compatibility.
---
>   description: Diff::LCS computes the difference between two Enumerable sequences using the
26,29d12
<     build_repositories:
<       - https://packages.wolfi.dev/os
<     keyring:
<       - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
35,36c18,19
<       - ruby-3.2
<       - ruby-3.2-dev
---
>       - ruby-${{rubyMM}}
>       - ruby-${{rubyMM}}-dev
40d22
<       README: 'CONFIRM WITH: curl -L https://github.com/halostatue/diff-lcs/archive/refs/tags/v1.5.1.tar.gz | sha256sum'
43,46d24
<   - uses: patch
<     with:
<       README: This is only required if the gemspec is using a signing key
<       patches: patches/${{package.name}}.patch
56a35,39
> var-transforms:
>   - from: ${{package.name}}
>     match: ^ruby(\d.\d+)-.
>     replace: $1
>     to: rubyMM

@justinvreeland justinvreeland force-pushed the jvreeland/update-ruby-convert branch 3 times, most recently from 5812821 to b8173ae Compare November 19, 2024 19:15
@justinvreeland justinvreeland marked this pull request as ready for review November 19, 2024 20:10
@smoser
Copy link
Contributor

smoser commented Nov 20, 2024

OK, I took your old and new and used diff -u and then let github syntax highlight. it looks like below.

--- old.yaml	2024-11-19 22:33:07.216304123 -0500
+++ new.yaml	2024-11-19 22:33:19.479146407 -0500
@@ -1,49 +1,27 @@
 # Generated from https://github.com/halostatue/diff-lcs
 package:
-  name: ruby3.2-diff-lcs
+  name: ruby3.3-diff-lcs
   version: 1.5.1
   epoch: 0
-  description: |-
-    Diff::LCS computes the difference between two Enumerable sequences using the
-    McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
-    to create a simple HTML diff output format and a standard diff-like tool.
-
-    This is release 1.4.3, providing a simple extension that allows for
-    Diff::LCS::Change objects to be treated implicitly as arrays and fixes a
-    number of formatting issues.
-
-    Ruby versions below 2.5 are soft-deprecated, which means that older versions
-    are no longer part of the CI test suite. If any changes have been introduced
-    that break those versions, bug reports and patches will be accepted, but it
-    will be up to the reporter to verify any fixes prior to release. The next
-    major release will completely break compatibility.
+  description: Diff::LCS computes the difference between two Enumerable sequences using the
   copyright:
     - license: MIT
     - license: Artistic-2.0
     - license: GPL-2.0-or-later
 environment:
   contents:
-    build_repositories:
-      - https://packages.wolfi.dev/os
-    keyring:
-      - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
     packages:
       - build-base
       - busybox
       - ca-certificates-bundle
       - git
-      - ruby-3.2
-      - ruby-3.2-dev
+      - ruby-${{rubyMM}}
+      - ruby-${{rubyMM}}-dev
 pipeline:
   - uses: fetch
     with:
-      README: 'CONFIRM WITH: curl -L https://github.com/halostatue/diff-lcs/archive/refs/tags/v1.5.1.tar.gz | sha256sum'
       expected-sha256: 50c1e43e1cae4bf65c139d628688cd80a29fe6c33bda4a66a98e98d3c8c601c2
       uri: https://github.com/halostatue/diff-lcs/archive/refs/tags/v${{package.version}}.tar.gz
-  - uses: patch
-    with:
-      README: This is only required if the gemspec is using a signing key
-      patches: patches/${{package.name}}.patch
   - uses: ruby/build
     with:
       gem: ${{vars.gem}}
@@ -54,3 +32,8 @@
   - uses: ruby/clean
 vars:
   gem: diff-lcs
+var-transforms:
+  - from: ${{package.name}}
+    match: ^ruby(\d.\d+)-.
+    replace: $1
+    to: rubyMM

questions

  1. did you actually truncate the description like it looks?
  2. what is the 'build-repositories' change?
  3. I just put up Remove php provides with a version, replace with providerPriority wolfi-dev/os#34680 which chooses the less fancy use of vars compared to var-transforms . The similar change here would be to use :
vars:
  rubyMM: 3.3

I'm not stuck on 3 but food for thought there.

@smoser
Copy link
Contributor

smoser commented Nov 20, 2024

  1. what is the 'build-repositories' change?

i see. never mind.

@justinvreeland
Copy link
Contributor Author

justinvreeland commented Nov 20, 2024

did you actually truncate the description like it looks?

yeap, it's not pretty but I used:
Description: strings.Split(g.Info, "\n")[0]

Open to other suggestions but the multi line description seems to annoy whatever generates our index files.

I just put up wolfi-dev/os#34680 which chooses the less fancy use of vars compared to var-transforms

Mmmm it's nice to only change the packages name but I'm using sed to adjust them anyway so might as well make keep it simple.

Changes:
- Update default ruby to 3.3
- Remove keyring entries wolfictl lint rejects them
```
❯ wolfictl lint ruby3.2-diff-lcs.yaml
2024/11/19 09:51:17 INFO Package: ruby3.2-diff-lcs: [forbidden-repository-used]: forbidden repository https://packages.wolfi.dev/os is used (ERROR)
[forbidden-keyring-used]: forbidden keyring https://packages.wolfi.dev/os/wolfi-signing.rsa.pub is used (ERROR)
```
- Remove README it causes build to fial
- Remove patch people will notice when it fails and the sed in
  pipelines/ruby/build should account for it
- Truncate dscription becuase it breaks index generation
```
2024/11/19 10:01:40 ERRO failed to build package: unable to generate index: updating index: failed to parse package packages/aarch64/ruby3.2-diff-lcs-1.5.1-r0.apk: ini.ShadowLoad(): key-value delimiter not found: McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
```
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