-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Error executing elm-install
from elm_install
gem
#4732
Comments
Confirmed on JRuby 9.2. |
I have not sorted out exactly where this is failing, but there are multiple levels of Enumerable calls in e.g. ElmInstall::Utils::transform_constraint, which appears to be the location where the Solve::Constraint instances come from. This logic appears to process an array of constraints, producing an array of Constraint instances that is presumably broken apart somewhere else. That breaking apart is what I suspect of having a bug, but I'm not sure where it is yet. |
I have found a clue in this. mri will call Utils::transform_constraint but JRuby will call that method redefined via methodhandler.redefine_method which will blow up. So either a) MRI is not redefining this but we are or b) it should be redefining this method but not on Utils. |
So I believe our problem is that contracts replaces the module_function of Utils::transform_constraint and not the instance version. If I remove Utils. and then include into Utils ElmInstall::Identifier everything works. Also if I alias the transform_constraint and make it a module_function and change Identifier to call it then it also works. So definitely, somewhere the wrong version of transform_constraint is being removed. |
Wow! So order of when method_added and singleton_method_added matter for some gems (in this case contracts).
It was the best of times and it was the hinkiest of times...So this is one of the most brittle behavioral incompatibilities I have run into in a while. The basic gist is that contracts gem replaces the wrong verion of a module_method in a Module if the hook methods method_added or method_singleton_added are executed in a different order than MRI does it. I swapped the order and added a regression. It to me is not harmful to fix this but I really don't think this order is Ruby semantics. Is it? If so then someone can add this to ruby/spec. |
Referenced here:
https://github.com/gdotdesign/elm-github-install/issues/32
Environment
jruby-9.1.12.0
installed viarbenv
Linux megapadd 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
elm-install 1.1.1
.elm-package.json
:Expected Behavior
elm-package.json
, you should be able to runelm-install
and it should install cleanly.Actual Behavior
The text was updated successfully, but these errors were encountered: