mirror of https://github.com/pyodide/pyodide.git
ENH Print helpful error if ccache was linked against too new glibc (#4127)
Resolves pyodide#4126. If someone builds emsdk outside of the docker image and then attempts to use it inside, there will be an error. This detects it and tells people to clean emsdk.
This commit is contained in:
parent
4c67f2929d
commit
9042e6cb1b
5
Makefile
5
Makefile
|
@ -9,6 +9,7 @@ CXX=em++
|
|||
|
||||
|
||||
all: check \
|
||||
check-emcc \
|
||||
dist/pyodide.asm.js \
|
||||
dist/pyodide.js \
|
||||
dist/pyodide.d.ts \
|
||||
|
@ -269,6 +270,10 @@ check:
|
|||
./tools/dependency-check.sh
|
||||
|
||||
|
||||
check-emcc: emsdk/emsdk/.complete
|
||||
python3 tools/check_ccache.py
|
||||
|
||||
|
||||
debug :
|
||||
EXTRA_CFLAGS+=" -D DEBUG_F" \
|
||||
make
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
result = subprocess.run(["emcc", "--version"], capture_output=True, encoding="utf8")
|
||||
if result.returncode == 0:
|
||||
return 0
|
||||
if re.search("GLIBC.*not found.*ccache", result.stderr):
|
||||
print(
|
||||
"Emscripten ccache was linked against an incompatible version of glibc.\n"
|
||||
"Run `make -C emsdk clean` and try again.\n"
|
||||
"If this error persists, please open an issue to ask for help."
|
||||
)
|
||||
else:
|
||||
print("Something is wrong but I'm not sure what.")
|
||||
print("Info:")
|
||||
print(result)
|
||||
return 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
Loading…
Reference in New Issue