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

Improve error for missing Python #81202

Merged
merged 4 commits into from
Jan 27, 2023
Merged

Conversation

danmoseley
Copy link
Member

Fix #59724

  1. Remove quotes from $(PYTHON) that were defeating conditions checking for an empty value, move to point of use.
  2. Add error message for missing Python.
  3. Also add error for missing C++ components at a location I encountered.

Tested clr and mono on Windows and Linux with and without Python.
Tested clr with Windows before and after adding missing C++ bits.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost assigned danmoseley Jan 26, 2023
@danmoseley danmoseley changed the title Fixmissingpython Improve error for missing Python Jan 26, 2023
@ghost
Copy link

ghost commented Jan 26, 2023

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix #59724

  1. Remove quotes from $(PYTHON) that were defeating conditions checking for an empty value, move to point of use.
  2. Add error message for missing Python.
  3. Also add error for missing C++ components at a location I encountered.

Tested clr and mono on Windows and Linux with and without Python.
Tested clr with Windows before and after adding missing C++ bits.

Author: danmoseley
Assignees: danmoseley
Labels:

area-Infrastructure

Milestone: -

@danmoseley
Copy link
Member Author

Before

/home/dan/git/runtime/eng/python.targets(22,5): error MSB3073: The command "..." exited with code 127. [/home/dan/git/runtime/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]

After

/home/dan/git/runtime/eng/python.targets(22,5): error MSB3073: The command "..." exited with code 127. [/home/dan/git/runtime/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]
/home/dan/git/runtime/eng/python.targets(34,7): error : Python not found. Please add Python 3 to your path and try again. [/home/dan/git/runtime/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj]

I could suppress the first error, but then it wouldn't handle the case where Python was found, failed, and wrote to stdout. I can't find a way to make that happen but this way you'd still get the first error in such a situation.

eng/python.targets Outdated Show resolved Hide resolved
@danmoseley
Copy link
Member Author

failure was #81249. this is a test failure, so it's downstream of build and this change is validated.

@danmoseley danmoseley merged commit d021235 into dotnet:main Jan 27, 2023
@danmoseley danmoseley deleted the fixmissingpython branch January 27, 2023 00:44
@ghost ghost locked as resolved and limited conversation to collaborators Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FindPythonWindows does not error gracefully
3 participants