KhronosGroup / KhronosGroup/OpenXR-Hpp

Generator script expects python3 on Windows

Open
#40 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
50
Forks
23
PR merge metrics
No merged PRs in 30d

Description

`generate-openxr-hpp.ps1` currently expects the Python executable to be named `python3`. However, that's not always the case. If you install Python via https://www.python.org/downloads/, the executable is called `python`, even though it's v3 and not v2. Not sure if that has changed with any particular minor version of Python. Maybe the executable downloaded from the Microsoft store is still called `python3` (as alluded to in the error message below).

```
PS C:\dev\OpenXR-1.0.26\OpenXR-Hpp> .\generate-openxr-hpp.ps1
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Generation failed while generating openxr_atoms.hpp :
At C:\dev\OpenXR-1.0.26\OpenXR-Hpp\generate-openxr-hpp.ps1:58 char:9
+ throw "Generation failed while generating ${header} : ${proce ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Generation fail...xr_atoms.hpp : :String) [], RuntimeException
+ FullyQualifiedErrorId : Generation failed while generating openxr_atoms.hpp :

PS C:\dev\OpenXR-1.0.26\OpenXR-Hpp> python
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
```

Bottom line is that the script should be more lenient towards the name of the executable and potentially try both?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with generate-openxr-hpp.ps1, especially the Python invocation that produces the Windows error. Reproduce the generator on Windows with the shown `python` executable, then verify generation completes successfully when the available Python executable uses either supported name.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.