-
Notifications
You must be signed in to change notification settings - Fork 337
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
spring doesn't pass command line args to rake 10.4.0 #366
Comments
Confirm! I changed the line https://github.com/ruby/rake/blob/55e43d3da2e0c48ccc4dc5d09b999b0afb2467a5/lib/rake/application.rb#L80 to |
Assigning |
I have configured this plugin to run RSpec specs for the currently opened RSpec file when running `:Dispatch` and to run all Jasmine specs when in a Jasmine file. I would like to have Jasmine scoped to the currently opened file, but that is currently not a feature that the Jasmine rake task supports. I have submitted a feature request to the jasmine-gem project to add filename scoping: jasmine/jasmine-gem#234 In the meantime, I will have to settle for scoping manually by using the `fdescribe` and `fit` features in Jasmine 2.1.0. Additionally, there is currently a problem affecting the combination of Spring and Rake versions that I am using that breaks Rake with Spring. To get around this, I am not using Spring for my Jasmine runs at this time. More info: rails/spring#366
I think that line needs to be deleted, I will fix it. |
How do I reproduce this issue so I can confirm a fix? |
@drbrain all you need is a Rakefile with a default task. then bin/rake -T should print a task list instead of running the default task. |
What should happen when it is broken/fixed? I don't understand, this seems to work as expected:
|
Hold on, I seem to have messed up my |
With the useless |
right now rake -T runs the default task because it's not parsing the command line options (this is the same thing as calling rake without any arguments). so if running rake -T via spring does what it's supposed to do then i expect you've fixed it. |
I don't have enough information to reproduce this. I tried the steps in the readme from my rake checkout:
So it seems to work fine, but then I don't have a rails app so I'm unsure. Can you give me a list of commands to run to reproduce this? |
There is something weird about it. I tried to bootstrap a new rails app (spring 1.2.0 and rake 10.4.0) and it does not happen. But, upgrading my existing rails app, rake 10.4.0 fails even with spring 1.1.3. So the problem might be in the |
I think ruby/rake#4 might be related |
I'm seeing this too. I am also unable to create a clean reproduction. I will dig in more and let you know if I can reproduce. Maybe a third gem is involved? There are differences in my binstubs with a fresh rails project, but when I make my binstubs the same I still see the error. |
If I remove rake from my gemfile but still use rake 10.4.0 and spring 1.2.0 then the problem is gone and I can rake -T normally. |
I have no particular information about this bug, but my guess is that:
So I'd look for something calling |
changing:
to
fixes the problem. Gonna pinpoint a version and open an issue over there. |
Also, generating a fresh rails app with spring, rake, and newrelic_rpm (all updated) reproduces the problem cleanly. |
I think this should either be fixed in Spring or Rake, rather than newrelic_rpm. Otherwise some other gem which inadvertantly happens to call Rake.application (assuming that is indeed what newrelic_rpm is doing) will also bring back the problem and we'll be playing whack-a-mole. |
Yeah sure. But if I can isolate the changes in newrelic_rpm I can confirm your theory on Rake.application. |
Plus opening an issue over there just to link to this could be helpful. |
Sounds good |
Confirmed: newrelic/newrelic-ruby-agent@466d621#diff-7ff14b640b9a1091a7870773cf8cbc0eR47 Is the breaking change. Thank Linus for git bisect! |
@drbrain Do you propose to fix this in Rake? Or perhaps Spring should call |
Example app: https://github.com/ngauthier/spring-issue-366-example If you bring that down and run:
The Hope this helps. |
@ngauthier thanks! I'll check it out tonight @jonleighton I consider this a regression in rake, I'll see if I can find a better way to fix the original bug. |
Cool thanks. For other readers, the TLDR; quick fix is to lock rake at '~> 10.3.0'. |
This reverts commit a36505d. This caused issues with tools that used rake across fork boundaries. Fixes rails/spring#366 Possibly also #4
rake 10.4.1 released so this can be closed once someone confirms. Thanks @ngauthier for the sample app. |
Confirmed to fix, thanks for the quick turn around! |
@drbrain ❤️ 💚 💙 💛 💜 |
Change the way that OptionParser.parse! is called, so that it doesn't directly sink its teeth into ARGV. This necessitated changing the way that collect_command_line_tasks get the list of command-line arguments to examine to get tasks and environment variable definitions, but that's a relatively minor thing.
we're using
spring-1.2.0
and we recently upgraded fromrake-10.3.2
torake-10.4.0
. once this happenedrake
no longer recognized any command line arguments when called throughspring
(eitherspring rake -T
or through the binstubsbin/rake -T
). calling rake directly viabundle exec rake -T
worked fine.it looks like the newer version of
rake
altered the way it parsesARGV
- i didn't spend a lot of time on this but perhaps that's where the problem lies?ruby/rake@v10.3.2...v10.4.0#diff-09f3b4d91b5882a83d922ff0e061945dL730
The text was updated successfully, but these errors were encountered: