diff options
| author | Kouhei Sutou <[email protected]> | 2019-05-17 17:59:24 +0900 |
|---|---|---|
| committer | Kouhei Sutou <[email protected]> | 2019-05-17 17:59:24 +0900 |
| commit | d5c8868346b49e2b2228cb8733398d88f744985b (patch) | |
| tree | 6838b80d129fb2e6d1c95a62a299dbd0af577b44 /lib | |
| parent | b6e9fab64949b91f00d07c890935642f44147615 (diff) | |
| download | mruby-d5c8868346b49e2b2228cb8733398d88f744985b.tar.gz mruby-d5c8868346b49e2b2228cb8733398d88f744985b.zip | |
Add support for CC="gcc --option ..." again
If $rake_root_fiber is used, sh runs command in another Fiber. If
command is ran in another Fiber, "rescue RuntimEerror" can't rescue
exception for system(...) failure.
How to reproduce:
$ CC="gcc -std=gnu99" ./minirake
(in /home/kou/work/ruby/mruby.kou)
CC mrbgems/mruby-compiler/core/codegen.c -> build/test/mrbgems/mruby-compiler/core/codegen.o
sh: 1: gcc -std=gnu99: not found
rake aborted!
Command Failed: ["gcc -std=gnu99" -g -std=gnu99 ...]
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mruby/build/command.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb index 0f18e0e62..0fa4746da 100644 --- a/lib/mruby/build/command.rb +++ b/lib/mruby/build/command.rb @@ -30,10 +30,13 @@ module MRuby def _run(options, params={}) return sh command + ' ' + ( options % params ) if NotFoundCommands.key? @command begin + fiber, $rake_root_fiber = $rake_root_fiber, nil sh build.filename(command) + ' ' + ( options % params ) rescue RuntimeError NotFoundCommands[@command] = true _run options, params + ensure + $rake_root_fiber = fiber end end end |
