Skip to content

Commit f1991bd

Browse files
committed
tools: update mac_tool warning regex matcher
1 parent f48ba24 commit f1991bd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tools/gyp/pylib/gyp/mac_tool.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,14 @@ def ExecFlock(self, lockfile, *cmd_list):
254254
def ExecFilterLibtool(self, *cmd_list):
255255
"""Calls libtool and filters out '/path/to/libtool: file: foo.o has no
256256
symbols'."""
257-
libtool_re = re.compile(
257+
libtool_no_symbols_re = re.compile(
258258
r"^.*libtool: (?:for architecture: \S* )?file: .* has no symbols$"
259259
)
260+
# Newer Apple cctools emits the same warning as:
261+
# libtool: warning: 'foo.o' has no symbols
262+
libtool_no_symbols_warning_re = re.compile(
263+
r"^.*libtool: warning: '.*' has no symbols$"
264+
)
260265
libtool_re5 = re.compile(
261266
r"^.*libtool: warning for library: "
262267
+ r".* the table of contents is empty "
@@ -271,7 +276,11 @@ def ExecFilterLibtool(self, *cmd_list):
271276
libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env)
272277
err = libtoolout.communicate()[1].decode("utf-8")
273278
for line in err.splitlines():
274-
if not libtool_re.match(line) and not libtool_re5.match(line):
279+
if (
280+
not libtool_no_symbols_re.match(line)
281+
and not libtool_no_symbols_warning_re.match(line)
282+
and not libtool_re5.match(line)
283+
):
275284
print(line, file=sys.stderr)
276285
# Unconditionally touch the output .a file on the command line if present
277286
# and the command succeeded. A bit hacky.

0 commit comments

Comments
 (0)