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

puppet doesn't run with Ruby 3.3.0 #9209

Open
joshcooper opened this issue Jan 17, 2024 · 1 comment
Open

puppet doesn't run with Ruby 3.3.0 #9209

joshcooper opened this issue Jan 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@joshcooper
Copy link
Contributor

joshcooper commented Jan 17, 2024

Describe the Bug

Ruby 3.3.0 was released Dec 25, 2023, but puppet cannot be loaded with the default set of gems, because racc was moved from a default to bundled gem. More gems will be moved in 3.4, so warnings are generated for those.

Expected Behavior

It should be possible to load puppet on Ruby 3.3 without warnings

Steps to Reproduce

PS C:\Users\Administrator\puppet> bundle exec puppet --version
C:/Users/Administrator/puppet/lib/puppet/settings.rb:4: warning: getoptlong was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add getoptlong to your Gemfile or gemspec.
C:/tools/ruby33/lib/ruby/gems/3.3.0/gems/fast_gettext-2.3.0/lib/fast_gettext/vendor/mofile.rb:171: warning: prime was loaded from the standard library, but is not part of the default gems since Ruby 3.1.0. Add prime to your Gemfile or gemspec. Also contact author of fast_gettext-2.3.0 to add prime into its gemspec.
C:/Users/Administrator/puppet/lib/puppet/pops/types/p_binary_type.rb:3: warning: base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec.
cannot load such file -- racc/parser.rb

PS C:\Users\Administrator\puppet> git grep racc/parser
lib/puppet/pops/parser/eparser.rb:require 'racc/parser.rb'

Environment

PS C:\Users\Administrator\puppet> ruby --version
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x64-mingw-ucrt]

PS C:\Users\Administrator\puppet> bundle list
Gems included by the bundle:
  * CFPropertyList (2.3.6)
  * abbrev (0.1.2)
  * addressable (2.8.6)
  * apt_stage_artifacts (0.11.0)
  * artifactory (3.0.15)
  * concurrent-ruby (1.2.3)
  * crack (0.4.5)
  * csv (3.2.8)
  * declarative (0.0.20)
  * deep_merge (1.2.2)
  * diff-lcs (1.5.0)
  * digest-crc (0.6.5)
  * docopt (0.6.1)
  * facter (4.5.1)
  * faraday (2.9.0)
  * faraday-net_http (3.1.0)
  * fast_gettext (2.3.0)
  * ffi (1.15.5)
  * google-apis-core (0.11.3)
  * google-apis-iamcredentials_v1 (0.17.0)
  * google-apis-storage_v1 (0.31.0)
  * google-cloud-core (1.6.1)
  * google-cloud-env (2.1.0)
  * google-cloud-errors (1.3.1)
  * google-cloud-storage (1.47.0)
  * googleauth (1.9.1)
  * hashdiff (1.1.0)
  * hiera-eyaml (3.4.0)
  * highline (3.0.0)
  * hocon (1.4.0)
  * httpclient (2.8.3)
  * json-schema (2.8.1)
  * jwt (2.7.1)
  * locale (2.1.3)
  * mini_mime (1.1.5)
  * minitar (0.9)
  * msgpack (1.7.2)
  * multi_json (1.15.0)
  * net-http (0.4.1)
  * optimist (3.1.0)
  * os (1.1.4)
  * packaging (0.113.0)
  * public_suffix (5.0.4)
  * puppet (8.5.0)
  * puppet-resource_api (1.9.0)
  * puppetserver-ca (2.6.0)
  * rake (13.1.0)
  * release-metrics (1.1.0)
  * representable (3.2.0)
  * retriable (3.1.2)
  * rexml (3.2.6)
  * rspec (3.12.0)
  * rspec-core (3.12.2)
  * rspec-expectations (3.12.3)
  * rspec-its (1.3.0)
  * rspec-mocks (3.12.6)
  * rspec-support (3.12.1)
  * scanf (1.0.0)
  * semantic_puppet (1.1.0)
  * signet (0.18.0)
  * thor (1.3.0)
  * trailblazer-option (0.1.2)
  * uber (0.1.0)
  * uri (0.13.0)
  * vcr (6.2.0)
  * webmock (3.19.1)
  * webrick (1.8.1)
  * yard (0.9.34)

PS C:\Users\Administrator\puppet> bundle config list
Settings are listed in order of priority. The top value will be used.

Workaround

On *nix, add the development group:

❯ bundle config set with development

❯ bundle install
Fetching gem metadata from https://rubygems.org/.......
Fetching racc 1.5.2
Installing racc 1.5.2 with native extensions
Bundle complete! 33 Gemfile dependencies, 98 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

❯ bundle exec puppet --version
/home/josh/work/puppet/lib/puppet/settings.rb:4: warning: getoptlong was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add getoptlong to your Gemfile or gemspec.
/home/josh/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/fast_gettext-2.3.0/lib/fast_gettext/vendor/mofile.rb:171: warning: prime was loaded from the standard library, but is not part of the default gems since Ruby 3.1.0. Add prime to your Gemfile or gemspec. Also contact author of fast_gettext-2.3.0 to add prime into its gemspec.
/home/josh/work/puppet/lib/puppet/util/feature.rb:118: warning: syslog was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add syslog to your Gemfile or gemspec.
/home/josh/work/puppet/lib/puppet/pops/types/p_binary_type.rb:3: warning: base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec.
8.5.0

Note adding the development group does not resolve the issue on Windows, because the racc gem is confined to the ruby platform:

 gem "racc", "1.5.2", require: false, platforms: [:ruby]

Additional Context

This is mostly likely due to https://github.com/ruby/ruby/blob/a49643340eb6b8d65299912b640887ea18495909/NEWS.md#stdlib-compatibility-issues

You need to add racc to your Gemfile if you use racc under bundler environment.

@joshcooper joshcooper added the bug Something isn't working label Jan 17, 2024
@joshcooper
Copy link
Contributor Author

Based on https://stdgems.org/racc/ we'll need to add racc to our Gemfile. Not sure if if this needs to be conditional based on RUBY_VERSION or not?

Also need to determine if racc needs to be a runtime dependency when building and publishing the puppet gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant