Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-127503: Emscripten make Python.sh function as proper Python CLI #127506

Merged
merged 15 commits into from
Dec 5, 2024

Conversation

hoodmane
Copy link
Contributor

@hoodmane hoodmane commented Dec 2, 2024

  • The first commit fixes (I hope) the problems with bsd realpath.
  • The second commit adjusts python.sh to mount all directories from the native file system except /dev, /lib and /proc.
  • The third commit makes native environment variables visible in Emscripten.
  • The fourth commit changes the make target to all so that we can run tests in-tree. Now that Python can see pybuilddir.txt all of the paths work correctly running in-tree.
  • The fifth commit adds a NODEFLAGS environment variable that allows us to change the way we invoke node (for example to enable experimental features or debugging)

Fixes #127503
Fixes #127111

Useful for: --experimental flags, --inspect flags, etc.
Tools/wasm/emscripten/__main__.py Outdated Show resolved Hide resolved
Tools/wasm/emscripten/__main__.py Outdated Show resolved Hide resolved
@hoodmane
Copy link
Contributor Author

hoodmane commented Dec 2, 2024

Thanks for the review @mdboom!

@erlend-aasland erlend-aasland removed their request for review December 2, 2024 21:42
Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me once I've made the couple of tweaks suggested inline; plus one question for my own edification.

Tools/wasm/emscripten/__main__.py Outdated Show resolved Hide resolved
Tools/wasm/emscripten/__main__.py Outdated Show resolved Hide resolved
Tools/wasm/emscripten/node_entry.mjs Show resolved Hide resolved
@bedevere-app
Copy link

bedevere-app bot commented Dec 2, 2024

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Previous version only worked if the name was python.sh. If we symlink something
else to it (say `python`) it would fail. This update makes it not depend on the
name of the link.
Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@freakboy3742 freakboy3742 merged commit 87faf0a into python:main Dec 5, 2024
50 of 51 checks passed
@hoodmane hoodmane deleted the emscripten-cli-fixes branch December 9, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emscripten: Make python.sh function as proper Python CLI Emscripten: Make the web example work again
3 participants