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

All tests fail with "ERROR: Can't find header dir for ruby" message #178

Closed
maxirmx opened this issue Sep 7, 2022 · 10 comments
Closed

All tests fail with "ERROR: Can't find header dir for ruby" message #178

maxirmx opened this issue Sep 7, 2022 · 10 comments

Comments

@maxirmx
Copy link
Contributor

maxirmx commented Sep 7, 2022

  • This happens on all platforms including Windows (so it is not related to tebako)
  • The message is generated by RubyInline gem attempting to recompile embedded C code
  • RubiInline is called by png
@ronaldtse
Copy link
Contributor

Thanks @maxirmx for investigating. @opoudjis do we need the png gem?

@maxirmx
Copy link
Contributor Author

maxirmx commented Sep 7, 2022

RubyInline creates a kind of binary extension for a gem (png in our case)
But the extension is created on require not on gem/bundle install.
Tebako does bundle install into pristine environment and packages whatever is created there. So there is no binary for inlined code

@maxirmx
Copy link
Contributor Author

maxirmx commented Sep 7, 2022

I can add a custom step to tebako so that some Ruby code is executed before packaging
I guess if we call require png there it will solve the problem

@ronaldtse
Copy link
Contributor

I actually wonder if we need the png gem at all in Metanorma. If not then we don't need rubyinline. However, I'm also not sure if there is a generic way of solving this.

@maxirmx
Copy link
Contributor Author

maxirmx commented Sep 7, 2022

We can have bundler plugin that implements post install hook that calls require for all gems, referencing RubyInline

@ronaldtse
Copy link
Contributor

Calling "require" on all bundled gems is a reasonable requirement, for example, Opal also does that.

As a side note, I wonder if we should also consider the bundler "vendor" mode which places all the gems in one directory that allows easy packaging.

@maxirmx
Copy link
Contributor Author

maxirmx commented Sep 7, 2022

png is outdated (2015). I use the newer gem: https://rubygems.org/gems/libpng-ruby
Sorry, I did not notice it earlier

@opoudjis
Copy link

And I have removed the png gem from standoc; it turns out we didn't need it after all.

@ronaldtse
Copy link
Contributor

Great, let's get that gem removed.

@maxirmx
Copy link
Contributor Author

maxirmx commented May 13, 2023

I think this issue can be closed
Keeping possible improvement in #179

@maxirmx maxirmx closed this as completed May 13, 2023
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