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

Why does the linux-musl platform cross compile have a dependency on rubygems 3.3.22? #400

Open
kingsleyh opened this issue Jul 18, 2024 · 4 comments

Comments

@kingsleyh
Copy link

Hi,

In my Github actions workflow when I cross compile with x86_64-linux-musl platform specified in my matrix using oxidize-rb/cross-gem-action@main it produces a gem that has a dependency on ruby gems 3.3.22

None of the other platform gems that are built have this dependency. In my app it uses ruby 2.7.8 with rubygems 3.1.6 - so the bundle install fails on the remote server with:

dedup_csv-0.1.8-x86_64-linux-musl requires rubygems version >= 3.3.22, which is
incompatible with the current version, 3.1.6

Is there a way to not have this dependency on rubygems 3.3.22?

my gihtub actions workflow:

https://github.com/kingsleyh/dedup_csv/blob/main/.github/workflows/gem.yml

@ianks
Copy link
Collaborator

ianks commented Jul 18, 2024

You should use modify your gemspec to use ext/mygem/extconf.rb instead of Cargo.toml (and add rb_sys ~> 0.9 as a gemspec dep. Then you can remove any required_rubygems_version constraint.

https://github.com/kingsleyh/dedup_csv/blob/7dd6bd321af62a0e00e4cc7e6526a05c8a59aaaf/dedup_csv.gemspec#L28C2-L28C49

@kingsleyh
Copy link
Author

Ah thanks - I will try that

@kingsleyh
Copy link
Author

kingsleyh commented Jul 18, 2024

hmm even though I have no required_rubygems_version in my gemspec even after changing to use extconf.rb and adding rb_sys as a gemspec dependency - the musl gem produced now has a runtime dependency on rb_sys but it still has a rubygems dependency of 3.3.22 - if I don't build the musl gem at all then the remote server picks the linux one instead of the musl and it works. It's only the musl gem that has this rubygems dependency - maybe its related to the way it's built in docker?

https://rubygems.org/gems/dedup_csv/versions/0.1.12-x86_64-linux-musl

@ianks
Copy link
Collaborator

ianks commented Jul 25, 2024

Use RbSys::ExtensionTask instead of Rake::ExtensionTask, that should do it

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

2 participants