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
rubygems-update 3.2.13 breaks sorbet installation on alpine #4425
Comments
Hi @garybethea, thanks for the report. It definitely looks related to #4082. My guess is that Now I'm rereading the description of the PR and I think it states that this is expected:
I totally missed this when considering this PR, I thought this would be backwards compatible in the sense that generic linux versions would still be chosen on alpine if there's not an alpine specific variant. I don't think assuming that non of the linux specific variants of a gem won't work on alpine. For example, I believe @lloeki Can you have a look at this? Assuming what I explained is the culprit of this issue, and that it is expected from the implementation of #4082, I'm afraid we need a better solution to support |
Also @garybethea, I don't think it will fix this issue, but could you upgrade to bundler 2.2.13? It should have a better behaviour regarding platforms. For example, the error message on this issue ("Could not find sorbet-static-0.5.6317-universal-darwin-14 in any of the sources") should be less confusing with the latest bundler. Assuming you regenerate the lockfile and lock both platforms you're using (alpine and darwin), I believe it should at least give you a better error message saying that it couldn't find a |
Thanks @deivid-rodriguez I'll give upgrading bundler a try.
I can confirm that on Alpine, the |
Yeah, I can confirm the culprit. I don't know how I missed this since it was stated clearly on the PR body and I knew linux specific variants that work just fine on alpine 😞. The issue is clearly not good for |
@deivid-rodriguez I believe you are correct, as as of the PR linux and linux-musl are different things, which means e.g sorbet-static would need to be republished as is under a linux-musl platform. Sadly I thought that was understood given the description and the tests. Let me apologise for the miscommunication. I think sorbet-static works on all platforms because it’s (as the name says) statically built, and doesn’t call anything that behaves differently on musl than on glibc. IIUC the proposal you’re making is:
The counterpart is that binary gems that are built and published on linux only, especially if they depend on gnuisms or C++/non-static ones, have a good chance of being broken on musl. This was the case that I encountered (and the reason why upstream Alpine patches out binary platforms, ensuring only ruby remains) and wanted to solve. So, IIUC a more complete solution would be about adding the following:
IOW the presence of a linux-musl gem hints at the linux gem being incompatible, while the presence of a ruby gem along a linux one but no musl gives a chance to a musl platform to have a working gem (pending proper build dependency installation), and finally a lone linux gem would mean attempt to install no matter the platform (but may still break if it depends on gnuisms). This introduces quite an asymmetry between the published gem platform and the querying Ruby platform, as well as being much more complex to implement. This is why I went the symmetric route, which although it requires republishing some gems if there’s no ruby platform gem, would end up always working in the long run, with a temporary breakage for an already broken platform (although on different packages). Again I apologise for the miscommunication on that point as I erroneously thought this consequence was clarified enough (which it obviously was not). So, WDYT would be the best course from here on? |
From an implementation point of view, I’m not sure this can be solved solely with comparisons as knowledge of availability of other gem platforms needs to be taken care of. |
I also had a wild crazy thought that maybe binary gems could claim to support multiple platforms, so a gem such as sorbet-static could claim support for linux and linux-musl, and similarly darwin gems could claim to support e.g darwin17 through darwin20 (a range whose start is known via -mmacos-min-version flag value) without having to publish an identical one for each. |
Well, I don't think you miscommunicated anything, it was all cristal clear, I just missed it. I think I read it the first time and didn't raise any flags, and then this second time I was not careful enough to go through everything again :(. I think we should go back to the previous state of things, with the exception that if there's a musl variant, it should always be preferred on alpine. For the cases where the linux version doesn't work on musl, and the gem author hasn't provided a working musl variant, I think the feature in #4049 should allow users to manually opt-into the generic version, so I'll commit to shipping that soon. |
That's amazing, thanks for the support @deivid-rodriguez! |
Oh, I was not aware that was a planned thing. IIUC that's the equivalent of this
Am I correct to assume this flag would be persisted in the lockfile in some way? Is the information persistable/persisted per-platform? Otherwise while it would work, it would mean that
I would also add as a mirror constraint that on a From a user experience point of view this puts the burden on the developer (as opposed to the gem maintainer) to know which @deivid-rodriguez WDYT? Should we revert #4082 and reopen #3174? Also, would you need help in implementing that while you work on #4049? |
This new The rubygems
That's is a fair concern, yeah the flag is currently per gem, but not per gem+platform. An improvement over the current situation but definitely not perfect.
Absolutely 👍.
Yes, I agree with you. Both on a the need for better tools for gem authors to be able to inform users about what works and what not, and on the fact that improving what has been proposed would still be a good move forward.
I'd say, yes, and yes. I have a lot on my plate so any help is appreciated. |
Great. Same here, but I'll do my best to give a hand. |
For now I'll be reverting the change (#4434) and release the revert as 3.2.14. |
@deivid-rodriguez well apparently it doesn't always work (my hunch is it appears to often work because it falls back to source build) |
I think |
This issue has been torturing me for a while as I could not see how Indeed:
So the following is entirely expected (the "thing"
Unless I'missing some critical piece (which I would be glad to hear), there's no way
|
My current problem is that using
rubygems-update 3.2.13
, runningbundle install
on Alpine fails with the error,Could not find sorbet-static-0.5.6317-universal-darwin-14 in any of the sources
even though it is present inGemfile.lock
.This issue is related to:
gem
Here are my current environment details:
Output
Gemfile
Gemfile.lock
Notes
This works fine when I pin the
rubygems-update
version to 3.2.12. Of course I'm installing onto Linux in this environment, while my Gemfile.lock specifiesdarwin
since I'm developing on OSX locally. I'm guessing that's confusing things in the new version? Using 3.2.12, bundler correctly installssorbet-static 0.5.6317 (x86_64-linux)
instead. It might be that this is a feature and not a bug, but it makes it hard to develop on a different platform than your production one.I will abide by the code of conduct.
The text was updated successfully, but these errors were encountered: