Skip to content

Support raw executables with platform-style file extensions#75

Merged
albertodebortoli merged 1 commit intomainfrom
feat/raw-executable-with-extension
Apr 19, 2026
Merged

Support raw executables with platform-style file extensions#75
albertodebortoli merged 1 commit intomainfrom
feat/raw-executable-with-extension

Conversation

@albertodebortoli
Copy link
Copy Markdown
Member

@albertodebortoli albertodebortoli commented Apr 19, 2026

Pull Request Title

Support raw executables with platform-style file extensions

Description

  • Some tools ship as raw executables with a platform-style extension (e.g. smartling.darwin, tool.linux) rather than as an archive or a bare file with no extension. The pre-download URL extension check in Downloader rejected these with an "unsupported file type" error before any download even occurred.
  • Removed the extension allowlist from Downloader. File type validation now happens entirely post-download via magic-byte detection in FileTypeDetector (Mach-O, ELF, PE), which already existed. ToolInstaller.unknownFileType covers truly unrecognisable files.
  • No downstream changes needed: FileType.executable, installExecutable(), and desiredBinaryName support were already in place.

Example Lucafile that now works:

tools:
  - name: Smartling
    version: "2.5"
    url: https://github.com/Smartling/smartling-cli/releases/download/2.5/smartling.darwin
    desiredBinaryName: smartling

Type of Change

  • Feature

How Has This Been Tested?

  • Added / updated unit tests
  • Tested on macOS (arch: arm64)

swift build and swift test (374 tests) pass locally.

New test: test_downloadRelease_executable_platformExtension_succeeds — asserts a .darwin-extension URL passes through without error.
Removed test: test_downloadRelease_unsupportedFileType_throws — behaviour no longer lives in Downloader.
Removed test: downloaderError_errorDescription in ErrorDescriptionTests — error type no longer exists.

Checklist

  • Swift code builds locally (swift build)
  • Tests pass locally (swift test)
  • Code style / formatting respected
  • Documentation updated (README / comments)

Breaking Changes?

  • No

Additional Notes

DownloaderError and SupportedFileTypes have been removed entirely from Downloader. Any truly unsupported file (e.g. a .dmg) will now fail later with ToolInstallerError.unknownFileType instead of the former DownloaderError.unsupportedFileType.

Remove pre-download URL extension validation from Downloader so that
raw executables with extensions like .darwin or .linux are no longer
rejected before downloading. File type detection now happens entirely
post-download via magic-byte inspection in FileTypeDetector, which
already handles Mach-O, ELF, and PE formats.
@albertodebortoli albertodebortoli added the feature New feature or enhancement label Apr 19, 2026
@albertodebortoli albertodebortoli added this to the 0.17.0 milestone Apr 19, 2026
@albertodebortoli albertodebortoli merged commit d424cfb into main Apr 19, 2026
3 checks passed
@albertodebortoli albertodebortoli deleted the feat/raw-executable-with-extension branch April 19, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant