Skip to content

Commit 78c7d66

Browse files
refacktargos
authored andcommitted
build: don't change locale on smartos
PR-URL: #21220 Fixes: nodejs/build#1327 Refs: #20394 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 2655c7b commit 78c7d66

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

configure

+7-3
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,10 @@ def get_xcode_version(cc):
672672
def get_gas_version(cc):
673673
try:
674674
custom_env = os.environ.copy()
675-
custom_env["LC_ALL"] = "en_US"
675+
# smartos (a.k.a. sunos5) does not have the en_US locale, and will give:
676+
# `setlocale: LC_ALL: cannot change locale (en_US): Invalid argument`
677+
if 'sunos' not in sys.platform:
678+
custom_env["LC_ALL"] = "en_US"
676679
proc = subprocess.Popen(shlex.split(cc) + ['-Wa,-v', '-c', '-o',
677680
'/dev/null', '-x',
678681
'assembler', '/dev/null'],
@@ -685,12 +688,13 @@ def get_gas_version(cc):
685688
consider adjusting the CC environment variable if you installed
686689
it in a non-standard prefix.''')
687690

688-
match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)",
689-
proc.communicate()[1])
691+
gas_ret = proc.communicate()[1]
692+
match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)", gas_ret)
690693

691694
if match:
692695
return match.group(1)
693696
else:
697+
warn('Could not recognize `gas`: ' + gas_ret)
694698
return '0'
695699

696700
# Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes

0 commit comments

Comments
 (0)