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

Make Linux build python version agnostic #6732

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

rhuanjl
Copy link
Collaborator

@rhuanjl rhuanjl commented Jul 11, 2021

Ubuntu 20.04 comes with python3 only AND its shell python command is python3 not python.

Older linux distros come with python 2 only.

Two changes to handle this

  1. Our build.sh script was dependent on finding python2, this change should cause it to function with python3 or python2
  2. the jstoc.py script run as part of building ch required a command line python command, this change asks CMake to locate a python executable and use it rather than relying on the existence of a command line python command

Note this was not an issue in CI because:
a) we don't use build.sh in the CI AND
b) the CI machines have a symlink between python and python3 - but this is something in azure CI, it's not default on a blank Ubuntu 20.04 distro

CC @fatcerberus

Fix #6731

Copy link
Member

@ppenzin ppenzin left a comment

Choose a reason for hiding this comment

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

Looks good, this is a much cleaner way to handle it.

@ppenzin ppenzin merged commit 6800c46 into chakra-core:master Jul 13, 2021
@@ -127,7 +128,7 @@ CMAKE_EXPORT_COMPILE_COMMANDS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
LIBS_ONLY_BUILD=
ALWAYS_YES=
CCACHE_NAME=
PYTHON2_BINARY=$(which python2.7 || which python2 || which python 2> /dev/null)
PYTHON_BINARY=$(which python3 || which python || which python2.7 || which python2 || which python 2> /dev/null)
Copy link
Contributor

Choose a reason for hiding this comment

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

which python is called twice - is that intentional? It seems if the first one fails, the second will also.

@rhuanjl rhuanjl deleted the python_adj branch February 15, 2023 10:14
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.

Build.sh may be broken on latest Ubuntu
4 participants