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
ruby: fix cross-build #51842
ruby: fix cross-build #51842
Conversation
Enable autoreconfHook by default: The build tried to execute autoconf, which was in the wrong build input. Regenerating autotools configure files is always a good idea since it delivers fixes. Also move groff to the native since it is only used at build-time
@@ -149,7 +145,7 @@ let | |||
postInstall = '' | |||
# Update rubygems | |||
pushd rubygems | |||
${buildRuby} setup.rb | |||
${buildRuby} setup.rb --destdir $GEM_HOME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without --destdir
it tries to install gemspec files in buildRuby
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! I was bracing myself for a big patch but it's surprisingly simple.
The cross-build existed already before but was just broken. |
After a very long git bisect session, I found that this commit, more specifically the The error only happens at runtime (in the systemd service, defined in default.nix in my example), while similar commands at build time (for instance Before reporting it as a regression issue, I’d appreciate a confirmation that it is actually a regression and not just me misusing |
I'm hitting an issue relating to this change. Before this change, Though, I'm unsure whether this is really an issue or not, but it breaks what was previousy working, and (while quite late) the backport to 18.09 changes its behaviour compared to the branch off point. Should Though, one thing is clear, this breaks assumptions between 18.03 and 18.09 and apparently broke an assumption between the release of 18.09 and now :/. |
@samueldr the symptom is the same for me, but I think it comes from hardcoded paths somewhere (see my comment above your). Does it appear only when you use a version of bundler that is different from the latest (currently 2.6) one? If so, you should try the "patch" that I quote there: #54303 (comment) |
@immae I'm not using it with |
I actually jumped the gun here. I wasn't done with the complete testing and assumed that bundler + bundler deps installing would be fine. With this merged, and a
Installing using
While with this reverted locally it works fine. Ruby 2.6 (without this reverted) works fine too. This makes me think there really is a regression here. |
Tried a build without diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index e7aedfc0750..4d1775db8c7 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -146,7 +146,7 @@ let
postInstall = ''
# Update rubygems
pushd rubygems
- ${buildRuby} setup.rb --destdir $GEM_HOME
+ ${buildRuby} setup.rb
popd
# Remove unnecessary groff reference from runtime closure, since it's big @immae if you're interested in trying.
It is an issue, it won't build without Here's where I'm at: making |
Sorry to bump this, but wondering if anyone took a look and see what's going on. |
Sorry to bump this, but wondering if anyone took a look and see what's going on.
@samueldr could you summarise what isn't working as expected? I'd be happy to take a look, but it's difficult for me to understand from the thread what the issue has been determined to be.
|
What seems to happen, is that since this patch added This seems to have been caused by how gems are installed into what looks like an incorrectly nested absolute path: -result/lib/ruby/gems/2.5.0/gems/bundler-1.16.2
+result/lib/ruby/gems/2.5.0/nix/store/rwp5fpzqssf5m9dzbgbwsfgdzw8xajra-ruby-2.5.5/lib/ruby/gems/2.5.0/nix/store/rwp5fpzqssf5m9dzbgbwsfgdzw8xajra-ruby-2.5.5/lib/ruby/gems/2.5.0/specifications/gems/bundler-1.16.2 |
Thanks very much — that gives me a much better place to start. I’ll look into this when I have a chance. |
This works just fine, and means we don't run into an issue with RubyGems trying to install into a different Ruby's prefix when cross-compiling. See NixOS#51842 (comment).
This works just fine, and means we don't run into an issue with RubyGems trying to install into a different Ruby's prefix when cross-compiling. See NixOS#51842 (comment).
This works just fine, and means we don't run into an issue with RubyGems trying to install into a different Ruby's prefix when cross-compiling. See #51842 (comment).
Enable autoreconfHook by default: The build tried to execute autoconf, which was
in the wrong build input. Regenerating autotools configure files is always a good
idea since it delivers fixes.
Also move groff to the native since it is only used at build-time
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)