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

Set EMSDK_PYTHON=../python3 to match what emsdk_env.sh does #19

Merged
merged 2 commits into from
May 21, 2021

Conversation

radical
Copy link
Member

@radical radical commented May 19, 2021

We add the path containing the python binaries from the packages to
PATH, but that contains python3, and not python. When we run
emcc --version on a machine without a system python, it fails with

`unable to find python in $PATH`

This was not caught with our regular testing, possibly because a system
python was available on those machines.

emsdk_env.sh sets EMSDK_PYTHON = /Users/radical/dev/r3/src/mono/wasm/emsdk/python/3.7.4-2_64bit/bin/python3

.. so, this commit adds the same for running emcc, and sets that to
python3 from the package.

This was tested on macOS.

We add the path containing the python binaries from the packages to
`PATH`, but that contains `python3`, and not `python`. When we run
`emcc --version` on a machine without a system python, it fails with

    `unable to find python in $PATH`

This was not caught with our regular testing, possibly because a system
`python` was available on those machines.

`emsdk_env.sh` sets `EMSDK_PYTHON = /Users/radical/dev/r3/src/mono/wasm/emsdk/python/3.7.4-2_64bit/bin/python3`

.. so, this commit adds the same for running `emcc`, and sets that to
`python3` from the package.

This was tested on macOS.
Copy link
Member

@lewing lewing left a comment

Choose a reason for hiding this comment

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

do we need add python to the normal path and set EMSDK_PYTHON or can we just set EMSDK_PYTHON (or is it helpful to set both for the offsets tool?)

@radical
Copy link
Member Author

radical commented May 19, 2021

do we need add python to the normal path and set EMSDK_PYTHON or can we just set EMSDK_PYTHON (or is it helpful to set both for the offsets tool?)

Only setting EMSDK_PYTHON seems to build fine with simple AOT projects.

re:offsets tool, what's that?

@radical
Copy link
Member Author

radical commented May 19, 2021

btw, emsdk_env.sh does add it to PATH: PATH += /Users/radical/dev/r3/src/mono/wasm/emsdk/python/3.7.4-2_64bit/bin

@radical radical merged commit 80b4baa into dotnet:main May 21, 2021
@radical radical deleted the python-add-envvar branch May 21, 2021 02:46
@akoeplinger
Copy link
Member

@radical @lewing do we need to backport this to preview5?

@radical
Copy link
Member Author

radical commented May 21, 2021

@radical @lewing do we need to backport this to preview5?

Yeah, we should do that.

@akoeplinger
Copy link
Member

Ok, please open a PR for the branch then (we don't have a bot here so you'll need to do it manually).

radical added a commit to radical/emsdk that referenced this pull request May 21, 2021
akoeplinger pushed a commit that referenced this pull request May 21, 2021
radical added a commit to radical/emsdk that referenced this pull request May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants