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

build: remove dependency on distutils.spawn #38600

Merged
merged 1 commit into from
May 10, 2021

Conversation

richardlau
Copy link
Member

Debian based packages of Python 3 do not include distutils.spawn and
require an additional apt package to be installed (python3-distutils).
Replace use of distutils.spawn with shutil.which, available in all
versions of Python currently allowed by our configure scripts.

For the configure script only, fall back to distutils.spawn to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

configure.py also uses distutils.version -- this appears to be
available in Debian packaged Python 3 without installing
python3-distutils so has been left as-is.

Refs: #30189

@github-actions github-actions bot added build Issues and PRs related to build files or the CI. doc Issues and PRs related to the documentations. needs-ci PRs that need a full CI run. labels May 8, 2021
@richardlau
Copy link
Member Author

cc @nodejs/python

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for doing this.

@richardlau richardlau added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 8, 2021
Debian based packages of Python 3 do not include `distutils.spawn` and
require an additional apt package to be installed (`python3-distutils`).
Replace use of `distutils.spawn` with `shutil.which`, available in all
versions of Python currently allowed by our configure scripts.

For the `configure` script only, fall back to `distutils.spawn` to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

`configure.py` also uses `distutils.version` -- this appears to be
available in Debian packaged Python 3 without installing
`python3-distutils` so has been left as-is.

PR-URL: nodejs#38600
Refs: nodejs#30189
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@richardlau
Copy link
Member Author

Landed in 16982b6.

@richardlau richardlau merged commit 16982b6 into nodejs:master May 10, 2021
@richardlau richardlau deleted the nodistutils branch May 10, 2021 14:38
moander pushed a commit to moander/node that referenced this pull request May 11, 2021
Debian based packages of Python 3 do not include `distutils.spawn` and
require an additional apt package to be installed (`python3-distutils`).
Replace use of `distutils.spawn` with `shutil.which`, available in all
versions of Python currently allowed by our configure scripts.

For the `configure` script only, fall back to `distutils.spawn` to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

`configure.py` also uses `distutils.version` -- this appears to be
available in Debian packaged Python 3 without installing
`python3-distutils` so has been left as-is.

PR-URL: nodejs#38600
Refs: nodejs#30189
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
moander pushed a commit to moander/node that referenced this pull request May 11, 2021
Debian based packages of Python 3 do not include `distutils.spawn` and
require an additional apt package to be installed (`python3-distutils`).
Replace use of `distutils.spawn` with `shutil.which`, available in all
versions of Python currently allowed by our configure scripts.

For the `configure` script only, fall back to `distutils.spawn` to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

`configure.py` also uses `distutils.version` -- this appears to be
available in Debian packaged Python 3 without installing
`python3-distutils` so has been left as-is.

PR-URL: nodejs#38600
Refs: nodejs#30189
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos
Copy link
Member

targos commented May 11, 2021

This broke V8 CI: https://ci.nodejs.org/job/node-test-commit-v8-linux/3984/nodes=benchmark-ubuntu1604-intel-64,v8test=v8test/console

18:23:00   File "./configure.py", line 17, in <module>
18:23:00     from shutil import which
18:23:00 ImportError: cannot import name which

@cclauss
Copy link
Contributor

cclauss commented May 11, 2021

https://docs.python.org/3/library/shutil.html#shutil.which has been around since Python 3.3

@targos
Copy link
Member

targos commented May 11, 2021

Yeah, but V8 build system doesn't support Python 3, so this job still has to use Python 2

@richardlau
Copy link
Member Author

😞. #38632 implements the fallback to find_executable from distutils.spawn to get the V8 CI job working again.

@richardlau
Copy link
Member Author

This should be landable on earlier releases as long as it is accompanied by #38632.

@cclauss
Copy link
Contributor

cclauss commented May 11, 2021

Yeah, but V8 build system doesn't support Python 3

Python 2 died 500 daze ago... Did they not get the memo?

targos pushed a commit that referenced this pull request May 17, 2021
Debian based packages of Python 3 do not include `distutils.spawn` and
require an additional apt package to be installed (`python3-distutils`).
Replace use of `distutils.spawn` with `shutil.which`, available in all
versions of Python currently allowed by our configure scripts.

For the `configure` script only, fall back to `distutils.spawn` to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

`configure.py` also uses `distutils.version` -- this appears to be
available in Debian packaged Python 3 without installing
`python3-distutils` so has been left as-is.

PR-URL: #38600
Refs: #30189
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request May 30, 2021
Debian based packages of Python 3 do not include `distutils.spawn` and
require an additional apt package to be installed (`python3-distutils`).
Replace use of `distutils.spawn` with `shutil.which`, available in all
versions of Python currently allowed by our configure scripts.

For the `configure` script only, fall back to `distutils.spawn` to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

`configure.py` also uses `distutils.version` -- this appears to be
available in Debian packaged Python 3 without installing
`python3-distutils` so has been left as-is.

PR-URL: #38600
Refs: #30189
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
Debian based packages of Python 3 do not include `distutils.spawn` and
require an additional apt package to be installed (`python3-distutils`).
Replace use of `distutils.spawn` with `shutil.which`, available in all
versions of Python currently allowed by our configure scripts.

For the `configure` script only, fall back to `distutils.spawn` to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

`configure.py` also uses `distutils.version` -- this appears to be
available in Debian packaged Python 3 without installing
`python3-distutils` so has been left as-is.

PR-URL: #38600
Refs: #30189
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
Debian based packages of Python 3 do not include `distutils.spawn` and
require an additional apt package to be installed (`python3-distutils`).
Replace use of `distutils.spawn` with `shutil.which`, available in all
versions of Python currently allowed by our configure scripts.

For the `configure` script only, fall back to `distutils.spawn` to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

`configure.py` also uses `distutils.version` -- this appears to be
available in Debian packaged Python 3 without installing
`python3-distutils` so has been left as-is.

PR-URL: #38600
Refs: #30189
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
Debian based packages of Python 3 do not include `distutils.spawn` and
require an additional apt package to be installed (`python3-distutils`).
Replace use of `distutils.spawn` with `shutil.which`, available in all
versions of Python currently allowed by our configure scripts.

For the `configure` script only, fall back to `distutils.spawn` to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

`configure.py` also uses `distutils.version` -- this appears to be
available in Debian packaged Python 3 without installing
`python3-distutils` so has been left as-is.

PR-URL: #38600
Refs: #30189
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. build Issues and PRs related to build files or the CI. doc Issues and PRs related to the documentations. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants