Skip to content

Wasm build instructions are confusing to this wasm newbie #95205

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

Closed
smontanaro opened this issue Jul 24, 2022 · 5 comments
Closed

Wasm build instructions are confusing to this wasm newbie #95205

smontanaro opened this issue Jul 24, 2022 · 5 comments
Assignees
Labels
docs Documentation in the Doc dir triaged The issue has been accepted as valid by a triager.

Comments

@smontanaro
Copy link
Contributor

Documentation

I know nothing about wasm or emscripten, but am curious. I know next-to-nothing (anymore) about Docker. So, naively working my way through Tools/wasm/README.md I see:

docker run --rm -ti -v $(pwd):/python-wasm/cpython quay.io/tiran/cpythonbuild:emsdk3

followed immediately by

mkdir -p builddir/build
pushd builddir/build
../../configure -C
make -j$(nproc)
popd

The docker run command puts me in a docker shell, from which the configure command is pretty worthless. It seems I am supposed to be back at my computer's prompt, but what good is the docker run command at that point? Am I supposed to check out .../python/cpython inside the docker env? I'm clearly missing something and suspect other people new to wasm probably are as well.

@smontanaro smontanaro added the docs Documentation in the Doc dir label Jul 24, 2022
@erlend-aasland
Copy link
Contributor

erlend-aasland commented Jul 24, 2022

  • The docker command should be executed from your local CPython repo clone (pwd == CPython repo).
  • ../../configure -C should be ../../cpython/configure -C

The docker run command puts me in a docker shell, from which the configure command is pretty worthless. It seems I am supposed to be back at my computer's prompt, but what good is the docker run command at that point?

No, it is not worthless; the -v option to docker run maps $(pwd) to /python-wasm/cpython inside the Docker container. You're supposed to run configure and make from within the container.

Am I supposed to check out .../python/cpython inside the docker env

No need. It is already mapped via the -v option.

@erlend-aasland erlend-aasland self-assigned this Jul 24, 2022
erlend-aasland added a commit to erlend-aasland/cpython that referenced this issue Jul 24, 2022
@smontanaro
Copy link
Contributor Author

Thanks. the incorrect configure reference was the problem. make is now making.

@tiran
Copy link
Member

tiran commented Jul 24, 2022

The documentation assumes that you run all commands from a CPython checkout inside and outside the container. Depending on how you run the container, you may /python-wasm as working directory. You need to run the commands from /python-wasm/cpython -- or better use the shell scripts in /python-wasm.

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 25, 2022
Co-authored-by: Christian Heimes <[email protected]>
(cherry picked from commit 310f948)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
erlend-aasland pushed a commit that referenced this issue Jul 25, 2022
miss-islington added a commit that referenced this issue Jul 25, 2022
Co-authored-by: Christian Heimes <[email protected]>
(cherry picked from commit 310f948)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
@smontanaro
Copy link
Contributor Author

Latest changes worked for me until I got here:

emrun builddir/emscripten-browser/python.html

This failed from inside the running Docker image with this error:

Unable to find browser "firefox"! Check the correctness of the passed --browser=xxx parameter!

I don't know where browser firefox is specified. Must be a default.

The second option (running wasm_webserver.py) worked for me outside the running image. Assuming it's less picky about available web browsers, maybe it should be the first option.

@erlend-aasland erlend-aasland added the triaged The issue has been accepted as valid by a triager. label Jul 25, 2022
tiran added a commit to tiran/cpython that referenced this issue Jul 26, 2022
- drop ``emrun``
- add build and debug instructions for WASI
- add wasi-env helper script
tiran added a commit that referenced this issue Jul 26, 2022
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 26, 2022
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
(cherry picked from commit e8f3e8f)

Co-authored-by: Christian Heimes <[email protected]>
ambv pushed a commit that referenced this issue Jul 26, 2022
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
(cherry picked from commit e8f3e8f)

Co-authored-by: Christian Heimes <[email protected]>
@erlend-aasland
Copy link
Contributor

How's the last changes working out for you, Skip?

@erlend-aasland erlend-aasland added the pending The issue will be closed if no feedback is provided label Jul 28, 2022
@erlend-aasland erlend-aasland removed the pending The issue will be closed if no feedback is provided label Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir triaged The issue has been accepted as valid by a triager.
Projects
None yet
Development

No branches or pull requests

4 participants