You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When executed on an enterprise windows runner. The first run with a version always fails, while the second and subsequent runs with this version succeeds.
Minimal setup:
jobs:
"test":
runs-on: [ Windows]steps:
- name: Set up Pythonuses: actions/setup-python@v4with:
python-version: 3.12.5
If the version is changed to 3.12.6, the first run will fail. Same if the version is changed the other way around.
Example: Previous version 3.12.5, new version 3.12.6
First the setup.ps1 is deleting everything in %TOOLS$/Python/3.12.5/x64 (as it should) (the empty folder is not deleted) (line 95ff in setup.ps1)
Line 119f copies "python-3.12.6-amd64.exe" into %TOOLS$/Python/3.12.6/x64 (correct)
Now the error happens:
Line 125 executes cmd.exe /c "cd $PythonArchPath && call $PythonExecName $ExecParams /quiet"
While everything looks correct this will install python3.12.6 into the folder %TOOLS$/Python/3.12.5/x64.
As now %TOOLS$/Python/3.12.6/x64/python.exe does not exist, the symlink creation in line 132 does not work.
When executed again it will install python3.12.6 into %TOOLS$/Python/3.12.6/x64 and everything works.
I am not sure why this happens, but my only possible explanation is, that $ExecParams evaluates to "DefaultAllUsersTargetDir=$PythonArchPath InstallAllUsers=1" and "DefaultAllUsersTargetDir" doesnt work. Instead it will fall back to another dir which is set by the first run. I dont know why TargetDir is not used for non msi installers.
Action version:
actions/setup-python@v4
Platform:
Ubuntu
macOS
[x ] Windows
Runner type:
Hosted
[x ] Self-hosted
Tools version:
Confirmed for 3.12.x, but i don't know if others are affected.
Expected behavior:
The first run should work and install python into the correct directory.
Actual behavior:
Python 3.12.6 is installed into the directory version of the old python 3.12.5
The text was updated successfully, but these errors were encountered:
Hello @OhioDschungel6 ,
We attempted to reproduce the issue but we are able to successfully install the Python 3.12.x on the first run. Please refer to the attached screenshot for details.
The DefaultAllUsersTargetDir parameter is part of the installation command for non-MSI installers. If the directory specified by this parameter is not accessible or has permission issues during the first run, it might cause the installer to fall back to a different directory. This could explain why the installation succeeds on the second attempt when the directory is available or permissions are resolved.
The Get-ExecParams function in the win-setup-template.ps1 script uses TARGETDIR for MSI installers and DefaultAllUsersTargetDir for non-MSI installers. The choice of parameters is based on the installation requirements:
1.MSI Installers: Use the TARGETDIR property to specify the installation directory.
2. Non-MSI Installers: Use the DefaultAllUsersTargetDir parameter as non-MSI installers may not support the TARGETDIR parameter. This ensures the installation path is set correctly for all users.
Make sure the directory specified by DefaultAllUsersTargetDir is accessible and has the correct permissions.
If you need any further assistance, please feel free to reach out.
Description:
When executed on an enterprise windows runner. The first run with a version always fails, while the second and subsequent runs with this version succeeds.
Minimal setup:
If the version is changed to 3.12.6, the first run will fail. Same if the version is changed the other way around.
Example: Previous version 3.12.5, new version 3.12.6
First the setup.ps1 is deleting everything in %TOOLS$/Python/3.12.5/x64 (as it should) (the empty folder is not deleted) (line 95ff in setup.ps1)
Line 119f copies "python-3.12.6-amd64.exe" into %TOOLS$/Python/3.12.6/x64 (correct)
Now the error happens:
Line 125 executes
cmd.exe /c "cd $PythonArchPath && call $PythonExecName $ExecParams /quiet"
While everything looks correct this will install python3.12.6 into the folder %TOOLS$/Python/3.12.5/x64.
As now %TOOLS$/Python/3.12.6/x64/python.exe does not exist, the symlink creation in line 132 does not work.
When executed again it will install python3.12.6 into %TOOLS$/Python/3.12.6/x64 and everything works.
I am not sure why this happens, but my only possible explanation is, that
$ExecParams
evaluates to "DefaultAllUsersTargetDir=$PythonArchPath InstallAllUsers=1" and "DefaultAllUsersTargetDir" doesnt work. Instead it will fall back to another dir which is set by the first run. I dont know why TargetDir is not used for non msi installers.Action version:
actions/setup-python@v4
Platform:
Runner type:
Tools version:
Confirmed for 3.12.x, but i don't know if others are affected.
Expected behavior:
The first run should work and install python into the correct directory.
Actual behavior:
Python 3.12.6 is installed into the directory version of the old python 3.12.5
The text was updated successfully, but these errors were encountered: