GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — gh-144533: Use pybuilddir.txt to find _sysconfigdata for WASI by therohityadav · Pull Request #144535 · python/cpython ConversationUse The previous implementation hardcoded the path pattern to
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
therohityadav
requested review from
brettcannon,
emmatyping and
savannahostrowski
as code owners
|
There was an error while loading. Please reload this page.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
035c77e to
b64935a
Compare
There was an error while loading. Please reload this page.
|
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| with pybuilddir.open("r", encoding="utf-8") as f: | ||
| sysconfig_data_dir = f"{wasi_build_dir}/{f.read().strip()}" | ||
| else: | ||
| # Fallback if the build hasn't generated the file yet |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Something feels off. Why did I ever care about setting this when configuring the host? If I remember correctly it was because tests failed using the host runner if I didn't via make test. But that doesn't seem right since that would mean a WASI build was somehow special in regards to paths compared to any other build which it shouldn't be. Plus if the python.sh shell script works which doesn't make the change to PYTHONPATH then it really feels weird that this is even here.
Can someone test what happens if you just take out the environment updates?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's right. I tested removing the environment updates. Without PYTHONPATH, tests fail with ModuleNotFoundError: No module named '_sysconfigdata__wasi_wasm32-wasi' (because this lives in the build dir and not in Lib/, I think).
python.sh does include PYTHONPATH. It's just passed in via --env in the wasmtime command.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is this an out-of-tree build issue? I never bothered to figure out why this is an issue since you would think all builds have the same situation and yet none of us set it when we run the test suite from a checkout.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is the case. However, after looking into this more, I think we can delete this entirely in favour of passing --argv0 to wasmtime. getpath.py reads pybuilddir.txt from the directory of the binary to auto-discover the sysconfig data directory, but without --argv0 the WASI guest receives the host path for argv[0] which doesn't resolve inside the guest filesystem. I tested this locally and everything built correctly/tests passed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@therohityadav Did you want to try applying the approach I mentioned above? We should just be able to replace PYTHONPATH with ARGV0 here and the plumb it through in default_host_runner
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I've opened a PR with this approach here: #145328
Sorry, something went wrong.
There was an error while loading. Please reload this page.
b64935a to
0ecc19e
Compare
|
Hey there - thanks so much for working on this. However, based on the earlier discussion (#144535 (comment)), I've just merged a PR with a different approach so I'll close this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.