-
Notifications
You must be signed in to change notification settings - Fork 10
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
rake eating ARGV #277
Comments
This line is doing it, but has been doing that since 2009 (maybe earlier as that commit moves things around). This should be easy to fix. |
Thanks for fixing this, @drbrain. That's a great way to fix it, too -- not using |
No problem! |
I had to revert this fix as it causes problems such as rails/spring#366 and there doesn't seem to be two ways to do this. I'm not sure there is an easy alternative that won't involve some manual work by you to re-exec rake. |
Aaaah, bummer. I don't entirely understand the referenced bug report -- it sounds like spring is manually futzing with Unfortunately, I can't see any way of getting around this problem without a change in rake. By the time the first line of my code gets executed (in my I can think of a couple of ways forward:
If 1 or 3 sound like the best way forward to you, I'm happy to put together a PR for consideration, just let me know and I'll break out the text editor. |
It's not necessarily spring by itself, but spring + new relic or something else that calls With Ruby 2.2 coming soon releasing a Rake 11 now is a difficult thing to support. I prefer something along the lines of option 3 but don't yet have an idea that's easy for future generations to understand. I gave some thought to this before reverting it but wasn't coming up with any good names or any way to explain it without several paragraphs. |
Well... we might just need several paragraphs then. I'll put together a PR for option 3 and see what I can come up with. |
Bah, I've just done a bit more digging, and it looks like just passing |
ah i see this thread now. maybe its my own doing .... but 10.4.2 has really blown up my world because of this [probably how our tool was built; we really depending on knowing which command line args rake cared about via the edited ARGV]. But its a weird thing .... I just seem to get 10.4.2 off a prod box .... its like some kind of sticky. Gem list doesn't show it but ARGV non-eating cannot be removed..... server down. Not your fault really. Don't code to undoc-ed features.... |
rvm implode-d # seems to work |
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.
Sorry that my change broke your application, @bretweinraub. Would an instance method on If such an instance method would suit you, let me know and I'll whip up a PR for @drbrain to merge. If that wouldn't suit for some reason, we can discuss what it is you do need, exactly, and I'll come up with a proposed fix one way or another. |
Somewhere in the last few years, since 41a334b (which came from this mailing list post, I believe),
ARGV
has once again started getting mangled by option parsing. Since I've recently started avoiding the need tobundle exec rake
everywhere (by re-execing rake if it isn't already running inside bundler) I need access to the entireARGV
to pass back toexec
.I haven't attached a patch, because the only solution I've got so far is
dup
ingARGV
into a temporary variable before callinginit
inRake::Application#run
, then restoringARGV
(withARGV.replace(orig_argv)
) afterwards -- and I'm not sure that's particularly kosher. If, on the other hand, you'd be happy to merge such a patch, let me know and I'll put it together and whack in some test cases.The text was updated successfully, but these errors were encountered: