Project

General

Profile

Bug #12643

When generating exts.mk need to escape newlines for @echo

Added by davispuh (Dāvis Mosāns) about 3 years ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-08-01 trunk 55789) [x64-mingw32]
[ruby-core:76641]

Description

Currently if some extension fails to compile then whole build will break because of syntax error in exts.mk

With MinGW

exts.mk:1526: *** missing separator.  Stop.
make: *** [uncommon.mk:217: build-ext] Error 2

With nmake (MSVC)

exts.mk(1528) : fatal error U1034: syntax error : separator missing
Stop.
NMAKE : fatal error U1077: '"D:\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.EXE"' : return code '0x2'
Stop.

This happens because newline isn't escaped for @echo in generated exts.mk

note:
        @echo "*** Following extensions failed to configure:"
        @echo "../../../../ext/-test-/file/extconf.rb:458: The compiler failed to generate an executable file.
You have to install development tools first.
"

I've attached a patch which fixes this.


Files

History

Updated by jeremyevans0 (Jeremy Evans) about 2 months ago

  • Status changed from Open to Closed

This appears to be fixed in the master branch, which currently does:

          err and err.scan(/.+/) do |ee|
            mf.puts %Q<\t@echo "\t#{ee.gsub(/["`$^]/, '\\\\\\&')}">
          end

Since /.+/ is not a multiline regular expression, newlines should not be included in ee.

Also available in: Atom PDF