Skip to content

CMake Use python instead of python3 when in a (non-base) conda environment #2687

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

Conversation

GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Mar 26, 2024

When building inside a conda environment (the recommended configuration), we should use 'python' instead of 'python3'. In some environments (mac), 'python3' may resolve to the incorrect python binary. This change maintains backwards compatibility for non-conda users by still defaulting to python3.

Note that pytorch core appears to default to 'python', instead of 'python3', so we may want to look at doing so in the future.

Test Plan:
On both Linux and Mac, I performed the following:
Built in non-base conda environment, Checked build log to ensure it uses 'python'.
Built in base conda environment. Checked build log to ensure it uses 'python3'.
Built in non-conda environment. Checked build log to ensure it uses 'python3'.

Copy link

pytorch-bot bot commented Mar 26, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/2687

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 1 Unrelated Failure

As of commit b8ad04d with merge base ccecd3a (image):

NEW FAILURE - The following job has failed:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 26, 2024
@facebook-github-bot
Copy link
Contributor

@GregoryComer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@GregoryComer GregoryComer force-pushed the conda-python-cmake-fix branch 2 times, most recently from 0c5f583 to c25e31b Compare March 26, 2024 19:57
@GregoryComer GregoryComer force-pushed the conda-python-cmake-fix branch 2 times, most recently from 4dd3814 to 65c1b2a Compare March 27, 2024 16:26
@facebook-github-bot
Copy link
Contributor

@GregoryComer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@GregoryComer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@GregoryComer GregoryComer force-pushed the conda-python-cmake-fix branch from 65c1b2a to b8ad04d Compare March 27, 2024 17:04
@facebook-github-bot
Copy link
Contributor

@GregoryComer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@GregoryComer merged this pull request in cf83964.

@GregoryComer
Copy link
Member Author

@pytorchbot cherry-pick --onto release/0.2 -c fixnewfeature

@GregoryComer
Copy link
Member Author

Trying again, since the bot seemed to have an issue which was fixed since yesterday.

@pytorchbot cherry-pick --onto release/0.2 -c critical

pytorchbot pushed a commit that referenced this pull request Mar 28, 2024
…nment (#2687)

Summary:
When building inside a conda environment (the recommended configuration), we should use 'python' instead of 'python3'. In some environments (mac), 'python3' may resolve to the incorrect python binary. This change maintains backwards compatibility for non-conda users by still defaulting to python3.

Note that pytorch core appears to default to 'python', instead of 'python3', so we may want to look at doing so in the future.

Bypassing unrelated lint (fix already in progress).
bypass-github-export-checks
bypass-github-executorch-ci-checks

Pull Request resolved: #2687

Test Plan:
On both Linux and Mac, I performed the following:
Built in non-base conda environment, Checked build log to ensure it uses 'python'.
Built in base conda environment. Checked build log to ensure it uses 'python3'.
Built in non-conda environment. Checked build log to ensure it uses 'python3'.

Reviewed By: mcr229

Differential Revision: D55370314

Pulled By: GregoryComer

fbshipit-source-id: 281bafa78f6523d7c03b8a736134f18bd6cea45b
(cherry picked from commit cf83964)
@pytorchbot
Copy link
Collaborator

Cherry picking #2687

The cherry pick PR is at #2745 and it is recommended to link a critical cherry pick PR with an issue

Details for Dev Infra team Raised by workflow job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants