-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
jruby: changes to make it possible to use in development environment #27273
Conversation
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.
In this case your changes seem trivial, but the consensus is that we want version bumps in separate PRs.
Ok, I'll follow that practice in the future. Sorry about that. |
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.
👍 for the direction
''; | ||
|
||
rubyEngine = "jruby"; | ||
gemPath = "lib/${rubyEngine}/gems/${version}"; |
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.
These need to be mover to the passthru as they are not used by the build but as attributes when passing the derivation around.
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.
It might also be a good idea to add the libPath
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.
I don't really understand passthru
very well, but my understanding was that variables go in there so that they can be changed without requiring a rebuild. However, the gemPath
(which depends on rubyEngine
) is used in the installPhase
, so it doesn't seem to fit that requirement. Happy to make this change though if you think it best.
Other executables all invoke jruby, and so don't need to be wrapped. In some cases wrapping breaks the executables because one file is a ruby script that directly loads the other (e.g. `gem` is a wrapper that loads `jgem`). In this case, if the latter script has been wrapped by nix, loading will fail.
- Adds the necessary passthru vars for bundler, bundix, etc. to accept the package as a ruby. - Adds the devEnv attribute, so that jruby.devEnv can be used to get an environment with bundler and bundix installed.
@zimbatm, I've just pushed up a revised set of changes. Differences are:
Happy to make any further changes as required. |
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.
LGTM. Nice work on this PR!
Awesome work, @asppsa! Let me know if you have any problems with |
Motivation for this change
When attempting to run JRuby (in Linux), I encountered a number of issues:
gem
errored out withsyntax error, unexpected tSTRING_BEG
;This pull request does the following:
JAVA_HOME
wrapping from some jruby executables, such asgem
;rubyEngine
andgemPath
attributes, required by gem packages (e.g. bundler);GEM_PATH
envvar magic from theruby
package;ruby -> jruby
symlink, so that/usr/bin/env ruby
hashbangs get resolved correctly;These changes make it possible for me to create a development environment for jruby as follows:
I haven't been able to run nox-review due to some errors to do with golang and GHC. I am presuming that these are not errors caused by my patch.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)