Skip to content

Commit 6ad236c

Browse files
silverwindbnoordhuis
authored andcommitted
build: configure formatting, add final message
This restores the pretty-printed options output for improved readability and adds a final warning message to inform on possibly scrolled-off warnings. PR-URL: #638 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent dd47a8c commit 6ad236c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

configure

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import subprocess
88
import sys
99
import shutil
1010
import string
11-
import textwrap
1211

1312
CC = os.environ.get('CC', 'cc')
1413
CXX = os.environ.get('CXX', 'c++')
@@ -297,9 +296,12 @@ auto_downloads = nodedownload.parse(options.download_list)
297296

298297

299298
def warn(msg):
300-
prefix = '\033[1m\033[91mWARNING\033[0m' if os.isatty(1) else 'WARNING'
299+
warn.warned = True
300+
prefix = '\033[1m\033[93mWARNING\033[0m' if os.isatty(1) else 'WARNING'
301301
print('%s: %s' % (prefix, msg))
302302

303+
# track if warnings occured
304+
warn.warned = False
303305

304306
def b(value):
305307
"""Returns the string 'true' if value is truthy, 'false' otherwise."""
@@ -960,7 +962,7 @@ output = {
960962
'variables': variables,
961963
'target_defaults': output
962964
}
963-
print textwrap.fill(str(output), 78)
965+
pprint.pprint(output, indent=2)
964966

965967
write('config.gypi', do_not_edit +
966968
pprint.pformat(output, indent=2) + '\n')
@@ -990,4 +992,7 @@ else:
990992

991993
gyp_args += args
992994

995+
if warn.warned:
996+
warn('warnings were emitted in the configure phase')
997+
993998
sys.exit(subprocess.call(gyp_args))

0 commit comments

Comments
 (0)