gha-setup-swift icon indicating copy to clipboard operation
gha-setup-swift copied to clipboard

Broken %PATH% for the regular cmd environment

Open grzegorzkrukowski opened this issue 1 year ago • 3 comments

After running the installation all the %PATH% values are gone on the regular cmd shell.

- name: Debug PATH before Swift installation
  shell: pwsh
  run: |
    Write-Host "PATH before Swift installation:"
    Write-Host $env:PATH
- name: Debug PATH in cmd shell
  shell: cmd
  run: |
    echo %PATH%
- name: Install Swift toolchain
  uses: compnerd/gha-setup-swift@main
  with:
    branch: swift-${{ env.SWIFT_VERSOIN }}-release
    tag: ${{ env.SWIFT_VERSOIN }}-RELEASE
- name: Debug PATH after Swift installation
  shell: pwsh
  run: |
    Write-Host "PATH after Swift installation:"
    Write-Host $env:PATH
- name: Debug PATH in cmd shell
  shell: cmd
  run: |
    echo %PATH%

The pwsh works as expected, but the cmd %PATH% is empty after running the swift installation.

grzegorzkrukowski avatar Dec 04 '24 00:12 grzegorzkrukowski

Interesting. Would you be able to run a quick test of set and path instead of echo %Path%?

compnerd avatar Dec 04 '24 05:12 compnerd

Sure - after the installation:

echo %PATH% //shows empty
set PATH //shows correct paths
path //shows empty path=

before running this action - all works fine.

My problem is that without "path" none of the commands are executable and cannot be found in regular cmd - which breaks our build process completely after using this action.

grzegorzkrukowski avatar Dec 04 '24 08:12 grzegorzkrukowski

set PATH working properly indicates that the environment is properly configured. echo %PATH% not matching is really odd.

compnerd avatar Dec 16 '24 05:12 compnerd