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

Cargo.lock prevents Ruby 3.2.0 from installing commonmarker v1.0.0.pre4 #211

Closed
k0kubun opened this issue Jan 6, 2023 · 6 comments · Fixed by #212
Closed

Cargo.lock prevents Ruby 3.2.0 from installing commonmarker v1.0.0.pre4 #211

k0kubun opened this issue Jan 6, 2023 · 6 comments · Fixed by #212

Comments

@k0kubun
Copy link

k0kubun commented Jan 6, 2023

I can't make gem install commonmarker -v 1.0.0.pre4 work with Ruby 3.2.0 despite cargo installed to my environment. Not sure if it's relevant, but I confirmed that this happens on both macOS and Linux.

Is the Cargo.lock shipped in the gem package possibly not up-to-date?

macOS

$ ruby -v
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22]

$ rustc --version
rustc 1.64.0

$ cargo --version
cargo 1.64.0 (387270bc7 2022-09-16)

$ gem install commonmarker -v 1.0.0.pre4
Building native extensions. This could take a while...
ERROR:  Error installing commonmarker:
        ERROR: Failed to build gem native extension.

    current directory: /Users/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker
cargo rustc --crate-type cdylib --target-dir /Users/k0kubun/.gem/ruby/3.2.0/extensions/arm64-darwin-22/3.2.0-static/commonmarker-1.0.0.pre4 --manifest-path /Users/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker/Cargo.toml --lib --profile release --locked -- -C linker\=clang -L native\=/opt/rubies/3.2.0/lib -L native\=/opt/homebrew/opt/openssl@1.1/lib -L native\=/opt/homebrew/opt/readline/lib -L native\=/opt/homebrew/opt/libyaml/lib -L native\=/opt/homebrew/opt/gdbm/lib -C link-args\=-Wl,-multiply_defined,suppress -l pthread -C link-arg\=-Wl,-undefined,dynamic_lookup
    Updating crates.io index
error: the lock file /Users/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.

cargo failed, exit code 101

Gem files will remain installed in /Users/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4 for inspection.
Results logged to /Users/k0kubun/.gem/ruby/3.2.0/extensions/arm64-darwin-22/3.2.0-static/commonmarker-1.0.0.pre4/gem_make.out
/Users/k0kubun/.gem/ruby/3.2.0/extensions/arm64-darwin-22/3.2.0-static/commonmarker-1.0.0.pre4/gem_make.out
current directory: /Users/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker
cargo rustc --crate-type cdylib --target-dir /Users/k0kubun/.gem/ruby/3.2.0/extensions/arm64-darwin-22/3.2.0-static/commonmarker-1.0.0.pre4 --manifest-path /Users/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker/Cargo.toml --lib --profile release --locked -- -C linker\=clang -L native\=/opt/rubies/3.2.0/lib -L native\=/opt/homebrew/opt/openssl@1.1/lib -L native\=/opt/homebrew/opt/readline/lib -L native\=/opt/homebrew/opt/libyaml/lib -L native\=/opt/homebrew/opt/gdbm/lib -C link-args\=-Wl,-multiply_defined,suppress -l pthread -C link-arg\=-Wl,-undefined,dynamic_lookup
    Updating crates.io index
error: the lock file /Users/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.

cargo failed, exit code 101

Linux

$ ruby -v
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]

$ rustc --version
rustc 1.66.0 (69f9c33d7 2022-12-12)

$ cargo --version
cargo 1.66.0 (d65d197ad 2022-11-15)

$ gem install commonmarker -v 1.0.0.pre4
Fetching commonmarker-1.0.0.pre4.gem
Fetching rb_sys-0.9.53.gem
Successfully installed rb_sys-0.9.53
Building native extensions. This could take a while...
ERROR:  Error installing commonmarker:
        ERROR: Failed to build gem native extension.

    current directory: /home/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker
cargo rustc --crate-type cdylib --target-dir /home/k0kubun/.gem/ruby/3.2.0/extensions/x86_64-linux/3.2.0-static/commonmarker-1.0.0.pre4 --manifest-path /home/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker/Cargo.toml --lib --profile release --locked -- -C linker\=gcc -L native\=/opt/rubies/3.2.0/lib -l m -l pthread
    Updating crates.io index
error: the lock file /home/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.

cargo failed, exit code 101

Gem files will remain installed in /home/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4 for inspection.
Results logged to /home/k0kubun/.gem/ruby/3.2.0/extensions/x86_64-linux/3.2.0-static/commonmarker-1.0.0.pre4/gem_make.out
/home/k0kubun/.gem/ruby/3.2.0/extensions/x86_64-linux/3.2.0-static/commonmarker-1.0.0.pre4/gem_make.out
current directory: /home/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker
cargo rustc --crate-type cdylib --target-dir /home/k0kubun/.gem/ruby/3.2.0/extensions/x86_64-linux/3.2.0-static/commonmarker-1.0.0.pre4 --manifest-path /home/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker/Cargo.toml --lib --profile release --locked -- -C linker\=gcc -L native\=/opt/rubies/3.2.0/lib -l m -l pthread
    Updating crates.io index
error: the lock file /home/k0kubun/.gem/ruby/3.2.0/gems/commonmarker-1.0.0.pre4/ext/commonmarker/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.

cargo failed, exit code 101
@gjtorikian
Copy link
Owner

This might take some time to fix as downstream dependencies get resolved oxidize-rb/cross-gem-action#129

But I am working on this: #212

@k0kubun
Copy link
Author

k0kubun commented Jan 7, 2023

But I am working on this: #212

Even better :) Thank you!

@fliiiix
Copy link

fliiiix commented Jan 8, 2023

Is it possible to workaround? (I ran into the same issue but i still want to try the new commonmarker with rust)

@kivikakk
Copy link
Collaborator

kivikakk commented Jan 8, 2023

@fliiiix If you're feeling adventurous, you could test the fix at #212 by using something like this in your Gemfile:

gem "commonmarker", github: "gjtorikian/commonmarker", branch: "support-32"

Note that I've tested this as not working on darwin-arm64 yet.

@kivikakk
Copy link
Collaborator

kivikakk commented Jan 8, 2023

gem update --system was all I needed to get this working on darwin-arm64!

@fliiiix
Copy link

fliiiix commented Jan 10, 2023

thanks for the quick fixing 🎉

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.

4 participants