#322 which was released as part of 1.0.2 today seems to introduce a breaking change. I don't have more information right now as I'm trying to rescue a bunch of production machines which are failing.
Will update later with more information if needed.
Let me know what the issue is.
So it appears that previously, you could supply a string as a command, e.g. EM.system("which foo") and it would just work. Ideally the command would be supplied separately from arguments but due to the command and arguments being merged together in lib/em/processes.rb anyway, this did not make any difference to the invocation of Shellwords::shellwords( cmd ).
Shellwords::shellwords( cmd )
Now that the command and arguments are explicitly split, the case statement here will never see a String anyway, and the first element of the array is assumed to be the command name. Unfortunately, if a string was supplied, the entire string is taken to be the command name e.g. which foo, which is not a command, thus the EM.system call fails.
Ah, that makes sense. Does this fix the issue?
diff --git a/lib/em/processes.rb b/lib/em/processes.rb
index db95982..4bbc14f 100644
@@ -114,7 +114,7 @@ module EventMachine
init = args.pop if args.last.is_a? Proc
# merge remaining arguments into the command
- cmd = [cmd, *args]
+ cmd = [cmd, *args] if args.any?
EM.get_subprocess_pid(EM.popen(cmd, SystemCmd, cb) do |c|
init[c] if init
Yes, that fixes the problem. Worth adding a unit test? ;)
fix EM.system (cc #322) (closes #413)
Do you think you'll make a new release for this regression fix?
Or rather, when do you think you'll release it?
Awesome! Thanks for the quick turnaround :)