Use libffi-dg-prune to handle Emscripten INFO messages rather than patching emcc.py (#766)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
diff --git a/.circleci/config.yml b/.circleci/config.yml
index aaf6556..7da0eaf 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -103,7 +103,6 @@ jobs:
name: run tests
command: |
source ./emsdk/emsdk_env.sh
- python3 testsuite/emscripten/quiet_emcc_info.py
testsuite/emscripten/node-tests.sh << parameters.params >>
workflows:
diff --git a/testsuite/emscripten/quiet_emcc_info.py b/testsuite/emscripten/quiet_emcc_info.py
deleted file mode 100644
index b2b3f06..0000000
--- a/testsuite/emscripten/quiet_emcc_info.py
+++ /dev/null
@@ -1,36 +0,0 @@
-"""
-Prevent emcc from printing info level logging
-
-dejagnu will fail tests because of these log statements and the messages depend
-on emscripten cache state so xfailing the right tests is very hard.
-
-See emscripten issue:
-https://github.com/emscripten-core/emscripten/issues/18607
-"""
-
-from pathlib import Path
-from shutil import which
-from sys import exit
-from textwrap import dedent
-
-EMCC_PATH = Path(which("emcc") + ".py")
-
-emcc_text = EMCC_PATH.read_text()
-if "# quiet_emcc_info patch" in emcc_text:
- exit(0)
-
-emcc_lines = emcc_text.splitlines()
-emcc_lines.insert(
- 1,
- dedent(
- """
- # quiet_emcc_info patch
- import logging
- for name in ["cache", "system_libs", "shared"]:
- logger = logging.getLogger(name)
- logger.setLevel(logging.WARN)
- """
- ),
-)
-
-EMCC_PATH.write_text("\n".join(emcc_lines))
diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp
index a84e533..b5731db 100644
--- a/testsuite/lib/libffi.exp
+++ b/testsuite/lib/libffi.exp
@@ -278,6 +278,8 @@ proc libffi-dg-prune { target_triplet text } {
regsub -all "(^|\n)\[^\n\]*unable to perform all requested operations" $text "" text
# We get this from sparc64 linux systems
regsub -all "(^|\n)\[^\n\]*warning: .* has a LOAD segment with RWX permissions" $text "" text
+ # Ignore Emscripten INFO messages
+ regsub -all "(^|\n)(cache|shared):INFO:\[^\n\]*" $text "" text
return $text
}