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

(#9302) Add Ruby 3.3 to CI matrix #9303

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

bastelfreak
Copy link
Contributor

No description provided.

@bastelfreak bastelfreak requested a review from a team as a code owner March 26, 2024 17:01
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@cthorn42 cthorn42 linked an issue Mar 26, 2024 that may be closed by this pull request
@joshcooper joshcooper added the enhancement New feature or request label Apr 23, 2024
@mhashizume
Copy link
Contributor

Hi @bastelfreak , now that #9398 has been merged, can you rebase your PR? Thanks!

@bastelfreak bastelfreak force-pushed the issue9302 branch 2 times, most recently from 43b4176 to 2e9c110 Compare June 21, 2024 16:35
@bastelfreak
Copy link
Contributor Author

@mhashizume rebased it

@joshcooper
Copy link
Contributor

@bastelfreak It seems ruby 3.3 changed the error message again, could you relax these expectations:

}.to raise_error(OpenSSL::PKey::PKeyError, /Could not parse PKey: (no start line|bad decrypt)/)

}.to raise_error(OpenSSL::PKey::PKeyError, /(unknown|invalid) curve name|Could not parse PKey: (no start line|bad decrypt)/)

@bastelfreak
Copy link
Contributor Author

mhm I'm not sure why the windows runner doesn't find any spec files:

error: no rspec examples were found.
rake aborted!
error: no specs were found.
D:/a/puppet/puppet/rakelib/parallel.rake:214:in `group_specs'
D:/a/puppet/puppet/rakelib/parallel.rake:183:in `run'
D:/a/puppet/puppet/rakelib/parallel.rake:407:in `block (2 levels) in <top (required)>'
D:/a/puppet/puppet/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => parallel:spec
(See full trace by running task with --trace)

@joshcooper
Copy link
Contributor

I was able to reproduce using:

C:\Users\Administrator\puppet>bundle exec ruby util/rspec_grouper 1000

An error occurred while loading ./spec/integration/agent/logging_spec.rb. - Did you mean?
                    rspec ./spec/integration/util/settings_spec.rb
                    rspec ./spec/integration/type/notify_spec.rb
                    rspec ./spec/integration/data_binding_spec.rb

Failure/Error: require 'racc/parser.rb'

LoadError:
  cannot load such file -- racc/parser.rb
# ./lib/puppet/pops/parser/eparser.rb:7:in `<top (required)>'
...

To resolve this issue for right now, I suggest changing this line in Gemfile

C:\Users\Administrator\puppet>git diff
diff --git a/Gemfile b/Gemfile
index 5d3caa47a3..ec0cb70688 100644
--- a/Gemfile
+++ b/Gemfile
@@ -62,7 +62,7 @@ end
 group(:development, optional: true) do
   gem 'memory_profiler', require: false, platforms: [:mri]
   gem 'pry', require: false, platforms: [:ruby]
-  gem "racc", "1.5.2", require: false, platforms: [:ruby]
+  gem "racc", "1.5.2", require: false
   if RUBY_PLATFORM != 'java'
     gem 'ruby-prof', '>= 0.16.0', require: false
   end

C:\Users\Administrator\puppet>bundle update
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Bundle updated!

C:\Users\Administrator\puppet>bundle exec ruby -e 'require "racc"; puts Racc::VERSION'
1.5.2

C:\Users\Administrator\puppet>bundle exec ruby util/rspec_grouper 1000
Grouped 27030 rspec example(s) into 23 group(s) from 746 file(s).

C:/Users/Administrator/AppData/Local/Temp/1/rspecrun20240912-5408-l8m3b4/d20240912-5408-jix1k5/group1
C:/Users/Administrator/AppData/Local/Temp/1/rspecrun20240912-5408-l8m3b4/d20240912-5408-jix1k5/group2
C:/Users/Administrator/AppData/Local/Temp/1/rspecrun20240912-5408-l8m3b4/d20240912-5408-jix1k5/group3
...

I'm going to file a separate issue about fixing our racc dependency. The problem is we use racc 1.5.2 to generate our eparser.rb. But the resulting parser has a runtime dependency on racc

require 'racc/parser.rb'

At the same time, Ruby 3.3 switched racc from a default gem to a bundled gem https://stdgems.org/racc/ So there's no guarantee that racc will be available when running in a bundler context.

We don't want to add racc as a hard runtime requirement, because it contains native extensions (so you'd need a compiler to gem install puppet).

I think the right thing is to use racc -E so that it generates a standalone eparser.rb which has no runtime dependency on racc.

@bastelfreak
Copy link
Contributor Author

Added it, lets see.

@bastelfreak
Copy link
Contributor Author

mhm wnidows still fails 🤔

Gemfile Outdated Show resolved Hide resolved
@joshcooper joshcooper merged commit e65bc7d into puppetlabs:main Sep 13, 2024
11 checks passed
@joshcooper
Copy link
Contributor

Thanks @bastelfreak!

@joshcooper joshcooper added the maintenance Maintenance chores are excluded from changelogs label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintenance Maintenance chores are excluded from changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Ruby 3.3 support
4 participants