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

Dependency on strscan #235

Open
martinthomson opened this issue Jun 17, 2024 · 8 comments
Open

Dependency on strscan #235

martinthomson opened this issue Jun 17, 2024 · 8 comments

Comments

@martinthomson
Copy link
Contributor

#9 18.89 Installing unicode-name 1.12.0
#9 19.08 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
#9 19.08 
#9 19.08     current directory: /usr/lib/ruby/gems/3.3.0/gems/strscan-3.1.0/ext/strscan
#9 19.08 /usr/bin/ruby extconf.rb
#9 19.08 mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

-- https://github.com/martinthomson/i-d-template/actions/runs/9547354420/job/26312195940#step:7:437

This seems to be a common pattern. A consequence of the "batteries included" design philosophy.

(I'm tempted to ask: Is there any way to just get kramdown-rfc without the full suite of secondary tools? That's not necessarily a good question, but it might help here.)

@cabo
Copy link
Owner

cabo commented Jun 17, 2024

This problem was recently fixed.
Can you do this with a recent version of kramdown-rfc?

@cabo
Copy link
Owner

cabo commented Jun 17, 2024

(kramdown-rfc uses REXML in a number of places, which is the pure-ruby XML library.
REXML uses strscan, which is a default gem, but was misconfigured to require a build anyway.) This was worked around by the emergency fix in 1.7.15. I can't see which version of kramdown-rfc you are trying to install. Please install 1.7.17.

@cabo
Copy link
Owner

cabo commented Jun 17, 2024

Interesting. bundle does something that gem doesn't. Need to understand this some more.

@cabo
Copy link
Owner

cabo commented Jun 17, 2024

The sheer fact that REXML now declares its dependency on strscan seems to be the problem. This Gemfile works for me:

source 'https://rubygems.org'

gem 'kramdown-rfc'
gem 'rexml', '<= 3.2.6'

(The gem 'net-http-persistent' is no longer needed as kramdown-rfc now requires that; it no longer supports platforms old enough to not have gem 'net-http-persistent')

A simple "gem install kramdown-rfc" also works as it doesn't invoke the bundler functionality.

@kesara
Copy link

kesara commented Jun 17, 2024

With author tools (using bundle), it seems to install strscan as dependency for kramdown.

2.621 In Gemfile:
2.621   kramdown-rfc was resolved to 1.7.17, which depends on
2.621     kramdown-rfc2629 was resolved to 1.7.17, which depends on
2.621       kramdown-parser-gfm was resolved to 1.1.0, which depends on
2.621         kramdown was resolved to 2.4.0, which depends on
2.621           rexml was resolved to 3.3.0, which depends on
2.621             strscan

And fails to install strscan.

@cabo
Copy link
Owner

cabo commented Jun 17, 2024

I'm trying to avoid pinning rexml in the gem, as that makes it hard to install in some other environments. So until the rexml people can get their act together, can you do the above addition to the Gemfile instead?

@cabo
Copy link
Owner

cabo commented Jun 17, 2024

(In authortools, you could also simply add build-essentials.)

@kesara
Copy link

kesara commented Jun 18, 2024

I had to install ruby-dev in addition to build-essential on ubuntu:jammy.

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

No branches or pull requests

3 participants