Exec format error when running swiftly post-install package installation
Describe the bug When I use the VSCode extension to install a toolchain with swiftly and there are extra system packages that need to be installed I get an "exec format error".
To Reproduce Steps to reproduce the behavior:
- Install swiftly on Ubuntu 24.04 desktop
- Be sure to "forget" to install one of the required system packages (e.g. pkg-config)
- Install VSCode and the VSCode Swift extension
- Run VSCode from the command-line
- Using the trim on the bottom right, select a new nightly toolchain to install
- When it finishes installing there is a dialog that pops up indicating that there are some missing system dependencies, choose to execute the script to install them
Expected behavior It is expected that the system package installs correctly.
Actual behavior Instead, there is an error in the log about "exec format error" attempting to run pkexec with the generated shell script.
Environment
- Ubuntu 24.04 desktop (ARM64)
- Swift version: 6.2.0
- Swiftly version: 1.1.0
- Visual Studio Code version:
- vscode-swift version:
Additional context
The shell script is cleaned up afterwards, so it's hard to know the exact state of the script. An educated guess is that the script has the execute bit set on it, but lacks the #!/bin/bash at the top necessary for the OS to run the script with the correct interpreter.