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

introduce general musl support #442

Merged
merged 5 commits into from
Apr 16, 2024
Merged

Conversation

flavorjones
Copy link
Member

@flavorjones flavorjones commented Dec 19, 2023

This is a draft PR that will remain open while we work on a general fix for musl version issues.

Fixes #434
Fixes #372

@flavorjones flavorjones force-pushed the flavorjones-434-better-musl-support branch 2 times, most recently from 8d4534a to cbef831 Compare December 19, 2023 17:24
@flavorjones flavorjones changed the title fix: general musl support introduce general musl support Jan 19, 2024
@flavorjones flavorjones force-pushed the flavorjones-434-better-musl-support branch from cbef831 to c2eb62a Compare January 19, 2024 15:31
@flavorjones flavorjones force-pushed the flavorjones-434-better-musl-support branch 11 times, most recently from af4d7e5 to 3d5d795 Compare January 26, 2024 20:14
@flavorjones
Copy link
Member Author

This went green using rake-compiler-dock 1.5.0.rc1!

@flavorjones
Copy link
Member Author

Found a pretty significant blocker this weekend. We probably cannot release this unless rubygems/rubygems#7432 is addressed in bundler or rubygems.

And even then, we probably need additional documentation to help people resolve issues.

Putting this on hold until we know more.

kou pushed a commit to rake-compiler/rake-compiler that referenced this pull request Jan 30, 2024
…x libc (#236)

### Problem I'm trying to solve

Rubygems does not correctly recognize `-musl` or `-gnu` platform
suffixes until v3.3.22.

### Solution

If rake-compiler is building a linux native gem that specifies a libc in
its platform object, then add ">= 3.3.22" to the
required_rubygems_version requirement.


https://github.com/rubygems/rubygems/blob/master/CHANGELOG.md#3322--2022-09-07

### Context

While working on musl support in the precompilation toolchain:

- rake-compiler/rake-compiler-dock#111
- flavorjones/ruby-c-extensions-explained#27
- sparklemotion/sqlite3-ruby#442
- sparklemotion/nokogiri#3111

I noticed that Ruby 3.0 is still shipping with Rubygems 3.2.33, which
does not recognize these gem platforms.

Specifying the rubygems requirement changes the error experienced by
users during gem installation from:

> ERROR:  While executing gem ... (Gem::Exception)
> Unable to find spec for #<Gem::NameTuple rcee_precompiled,
0.6.test.2024.0128.1724, aarch64-linux>

to:

> ERROR: Error installing
rcee_precompiled-0.6.test.2024.0128.1735-x86_64-linux-musl.gem:
> rcee_precompiled-0.6.test.2024.0128.1735-x86_64-linux-musl requires
RubyGems version >= 3.3.22.
> The current RubyGems version is 3.2.33. Try 'gem update --system' to
update RubyGems itself.
@flavorjones flavorjones force-pushed the flavorjones-434-better-musl-support branch from 3d5d795 to a8f3f05 Compare February 7, 2024 16:52
@flavorjones
Copy link
Member Author

Picking this back up again since the fix to the rubygems issue mentioned above was released in bundler 2.5.6.

@flavorjones flavorjones force-pushed the flavorjones-434-better-musl-support branch from d6048e6 to 7bfc42c Compare February 7, 2024 18:39
@flavorjones flavorjones force-pushed the flavorjones-434-better-musl-support branch from 7bfc42c to 5325e98 Compare February 25, 2024 16:13
@flavorjones flavorjones force-pushed the flavorjones-434-better-musl-support branch 2 times, most recently from 4ebdd1d to 37e84d7 Compare March 24, 2024 18:08
@flavorjones
Copy link
Member Author

OK, proceeding carefully here after an exploration revealed some versions of rubygems and bundler aren't going to work well, see rake-compiler/rake-compiler-dock#117

Planning to cut a release candidate this week.

Rubygems 3.3.22 is the minimum needed to correctly detect and use
`-linux-musl` and `-linux-gnu` native gems.

rake-compiler/rake-compiler#236 introduced a
minimum rubygems version for these native platform gems to provide a
sensible error message.
@flavorjones flavorjones force-pushed the flavorjones-434-better-musl-support branch from 37e84d7 to 112e479 Compare April 15, 2024 21:10
updating to rake-compiler-dock 1.5.0
@flavorjones flavorjones force-pushed the flavorjones-434-better-musl-support branch from 112e479 to aba0c06 Compare April 15, 2024 23:08
@flavorjones flavorjones merged commit 055da73 into main Apr 16, 2024
125 checks passed
@flavorjones flavorjones deleted the flavorjones-434-better-musl-support branch April 16, 2024 01:58
@flavorjones
Copy link
Member Author

Shipped in v2.0.0 https://github.com/sparklemotion/sqlite3-ruby/releases/tag/v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"symbol not found" on alpine 3.19 Support musl platforms: LoadError on aarch64-linux-musl
1 participant