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

issue with 2.0.2 #333

Closed
igorkasyanchuk opened this issue Dec 29, 2024 · 11 comments · Fixed by #337
Closed

issue with 2.0.2 #333

igorkasyanchuk opened this issue Dec 29, 2024 · 11 comments · Fixed by #337

Comments

@igorkasyanchuk
Copy link

Hello, when I start rails s I have a crash

image

with version 2.0.1 everything works fine.

Ruby 3.3.6 and Rails 8.0.1.

@gjtorikian
Copy link
Owner

What operating system ?

And, was this installed through gem or bundler? Can you copy paste the logs for when you install 2.0.2?

Probably something in the gem did not get packaged correctly. But I can’t imagine what.

@igorkasyanchuk
Copy link
Author

Using bundle. Added to my Gemfile

@gjtorikian
Copy link
Owner

And OS?

@kivikakk
Copy link
Collaborator

kivikakk commented Dec 30, 2024

Decided to have a look into this since I think we might see more reports of this soon. I'm on arm64-darwin and Ruby 3.3.x, same as the reporter. Tried a plain gem install commonmarker -v 2.0.2:

$ gem install commonmarker -v 2.0.2
Fetching commonmarker-2.0.2-arm64-darwin.gem
Successfully installed commonmarker-2.0.2-arm64-darwin
Parsing documentation for commonmarker-2.0.2-arm64-darwin
Installing ri documentation for commonmarker-2.0.2-arm64-darwin
Done installing documentation for commonmarker after 0 seconds
1 gem installed

A new release of RubyGems is available: 3.5.22 → 3.6.2!
Run `gem update --system 3.6.2` to update your installation.

$ irb -rcommonmarker
/Users/kivikakk/.gem/ruby/3.3.0/gems/irb-1.14.0/lib/irb/init.rb:471: warning: LoadError: cannot load such file -- commonmarker/commonmarker
irb(main):001>
$ ls ~/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/*
/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/config.rb
/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/constants.rb
/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/extension.rb
/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/node.rb
/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/renderer.rb
/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/utils.rb
/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/version.rb

/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/3.2:
commonmarker.bundle

/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/3.4:
commonmarker.bundle

/Users/kivikakk/.gem/ruby/3.3.0/gems/commonmarker-2.0.2-arm64-darwin/lib/commonmarker/node:
ast.rb  inspect.rb

Same on 3.4.0preview2, with same extracted tree and error, but that may be because it's the preview (what I have in my current Nixpkgs pin) and it seems to use 3.4.0+0 as the ABI thingy; I suspect (and will confirm) that a released 3.4 will work fine.

Works on Ruby 3.2.5 without any issues, so I'm guessing it's the lack of 3.3 build in the gem that's causing OP's issue.

edit: confirmed works fine on 3.4.1.

@gjtorikian
Copy link
Owner

That’s really strange. Nothing about the build system changed that should have affected the packaging; doubly weird that it’s only 3.3.

@gjtorikian
Copy link
Owner

gjtorikian commented Dec 30, 2024

The only clue I could find is this reference to rake-compiler-dock (which was upgraded to support Ruby 3.4): https://github.com/rake-compiler/rake-compiler-dock/blob/cc37afbe112d14ccacec6bf7b4d78852cfc74aba/History.md?plain=1#L35

But even still, it looks like OP is using 3.3.6. Edit: ah, but this refers to the Ruby version on the docker image building the gem. So yeah this might actually need to change: https://github.com/oxidize-rb/rb-sys/blob/5d1999ba70d301581524b8252c8ff3b8a825afa2/docker/Dockerfile.arm64-darwin#L3

@kivikakk
Copy link
Collaborator

Ah, yep, might need to be 3.3.5!

@jagthedrummer
Copy link

I just ran into this problem in CI on GitHub Actions. You can see a failed run here: https://github.com/bullet-train-co/bullet_train-core/actions/runs/12549241610/job/34989960868

We're running Ruby 3.3.6.

There's the complaint about cannot load such file -- commonmarker/commonmarker which is caused by a previous cannot load such file -- /home/runner/work/bullet_train-core/bullet_train-core/tmp/starter/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker/3.3/commonmarker.

It looks like this fallback line doesn't work as intended:

require "commonmarker/commonmarker"

@gjtorikian
Copy link
Owner

Yep. There’s already a PR open upstream for the fix.

mjgiarlo added a commit to sul-dlss/cocina-models that referenced this issue Jan 7, 2025
Ruby 3.4 is unsupported until commonmarker 2.0.2, but 2.0.2 breaks Ruby 3.3. See gjtorikian/commonmarker#333. This change allows cocina-models dependents to use either Ruby 3.3 or 3.4.
mjgiarlo added a commit to sul-dlss/cocina-models that referenced this issue Jan 7, 2025
Ruby 3.4 is unsupported until commonmarker 2.0.2, but 2.0.2 breaks Ruby 3.3. See gjtorikian/commonmarker#333. This change allows cocina-models dependents to use either Ruby 3.3 or 3.4.
@bvogel
Copy link

bvogel commented Jan 8, 2025

the fix on rb_sys was merged and released, however I still see this on ruby 3.3.6:

LoadError: cannot load such file -- commonmarker/commonmarker (LoadError)
/build/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require'
/build/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'
/build/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker/extension.rb:13:in `rescue in <main>'
/build/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker/extension.rb:3:in `<main>'
/build/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker.rb:3:in `require_relative'
/build/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker.rb:3:in `<main>'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/build/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:55:in `each'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:55:in `block in require'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:44:in `each'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:44:in `require'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler.rb:212:in `require'
/build/config/application.rb:8:in `<top (required)>'
/build/Rakefile:4:in `require_relative'
/build/Rakefile:4:in `<top (required)>'
/build/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli/exec.rb:58:in `load'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli/exec.rb:58:in `kernel_load'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli/exec.rb:23:in `run'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli.rb:455:in `exec'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli.rb:35:in `dispatch'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli.rb:29:in `start'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/exe/bundle:28:in `block in <top (required)>'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Caused by:
LoadError: cannot load such file -- /build/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker/3.3/commonmarker (LoadError)
/build/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker/extension.rb:7:in `require_relative'
/build/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker/extension.rb:7:in `<main>'
/build/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker.rb:3:in `require_relative'
/build/vendor/bundle/ruby/3.3.0/gems/commonmarker-2.0.2-x86_64-linux/lib/commonmarker.rb:3:in `<main>'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/build/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:55:in `each'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:55:in `block in require'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:44:in `each'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/runtime.rb:44:in `require'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler.rb:212:in `require'
/build/config/application.rb:8:in `<top (required)>'
/build/Rakefile:4:in `require_relative'
/build/Rakefile:4:in `<top (required)>'
/build/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli/exec.rb:58:in `load'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli/exec.rb:58:in `kernel_load'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli/exec.rb:23:in `run'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli.rb:455:in `exec'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli.rb:35:in `dispatch'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/cli.rb:29:in `start'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/exe/bundle:28:in `block in <top (required)>'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/build/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.16/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'

edit: I reckon merging #336 should fix this

@gjtorikian
Copy link
Owner

Thanks for the report @igorkasyanchuk and the verification @kivikakk. I believe this should be fixed on 2.0.2.1:

❯ ruby -v
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [arm64-darwin24]

❯ gem install commonmarker -v 2.0.2
Fetching commonmarker-2.0.2-arm64-darwin.gem
Successfully installed commonmarker-2.0.2-arm64-darwin
1 gem installed

❯ irb -rcommonmarker
/Users/gjtorikian/.rbenv/versions/3.3.6/lib/ruby/3.3.0/irb/init.rb:436: warning: LoadError: cannot load such file -- commonmarker/commonmarker
irb(main):001>

❯ gem uninstall commonmarker
Successfully uninstalled commonmarker-2.0.2-arm64-darwin

❯ gem install commonmarker -v 2.0.2.1
Fetching commonmarker-2.0.2.1-arm64-darwin.gem
Successfully installed commonmarker-2.0.2.1-arm64-darwin
1 gem installed

❯  irb -rcommonmarker
irb(main):001>

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 a pull request may close this issue.

5 participants