Comments (5)
I think it needs to re-raise in the SystemExit
case too
from pyodide.
Thanks for the report. I think this bug has been present for the full three years I've been a maintainer of Pyodide and nobody has ever gotten around to fixing it... It is a bit confusing though.
from pyodide.
Any hint where to start to look to fix it?
from pyodide.
Looks to me that the problem is here:
https://github.com/pyodide/pyodide/blob/main/pyodide-build/pyodide_build/buildpkg.py?plain=1#L863-L873
success = True
try:
_build_package_inner(...)
except Exception:
success = False
raise
finally:
status = "Succeeded" if success else "Failed"
success
is being left as True
so the generic exception handler is not being executed. The ERROR message is printed here:
https://github.com/pyodide/pyodide/blob/main/pyodide-build/pyodide_build/buildpkg.py?plain=1#L124-L126
logger.error(f"ERROR: {script_name} failed")
logger.error(textwrap.indent(cmd, " "))
exit_with_stdio(result)
And exit_with_stdio
raises SystemExit
which is not caught by except Exception
. So we should add handling for KeyboardInterrupt
and SystemExit
on line 863. I think the following patch would probably be sufficient:
--- a/pyodide-build/pyodide_build/buildpkg.py
+++ b/pyodide-build/pyodide_build/buildpkg.py
@@ -860,9 +860,11 @@ def build_package(
continue_=continue_,
)
- except Exception:
+ except (Exception, KeyboardInterrupt):
success = False
raise
+ except SystemExit as e:
+ success = e.code == 0
finally:
t1 = datetime.now()
datestamp = "[{}]".format(t1.strftime("%Y-%m-%d %H:%M:%S"))
Though we might consider adding a distinct message for KeyboardInterrupt
and I'm not sure that anyone ever raises SystemExit(0)
so it's not clear how important that case is.
from pyodide.
I've put a working version in #4404
from pyodide.
Related Issues (20)
- mapbox-earcut
- Add option to prevent default type translations HOT 4
- Allow overriding compile parameters in pywasmcross HOT 1
- Debug pyodide release artifacts (and pyodide build debug support)
- "Building and testing Python packages out of tree" commands need some dev tools installed as prerequisites HOT 2
- Add esbuild-py HOT 4
- Add `PyMuPDF` package
- runPython return missing
- cmake -E capabilities is broken HOT 1
- Release 0.26.0 HOT 5
- datasets (huggingface) HOT 6
- Cannot create a WebGL2 context when using SDL HOT 3
- request to add pandasai HOT 1
- request to add llama-index
- request to add langchain HOT 1
- request to add Boto3 HOT 4
- fastobo
- loadPackage() not to access the file system if the cache already exists HOT 2
- cvxpy-base 1.4.3 HOT 2
- html5_canvas_backend no longer works. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyodide.