Support raw executables with platform-style file extensions#75
Merged
albertodebortoli merged 1 commit intomainfrom Apr 19, 2026
Merged
Support raw executables with platform-style file extensions#75albertodebortoli merged 1 commit intomainfrom
albertodebortoli merged 1 commit intomainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Title
Support raw executables with platform-style file extensions
Description
smartling.darwin,tool.linux) rather than as an archive or a bare file with no extension. The pre-download URL extension check inDownloaderrejected these with an "unsupported file type" error before any download even occurred.Downloader. File type validation now happens entirely post-download via magic-byte detection inFileTypeDetector(Mach-O, ELF, PE), which already existed.ToolInstaller.unknownFileTypecovers truly unrecognisable files.FileType.executable,installExecutable(), anddesiredBinaryNamesupport were already in place.Example Lucafile that now works:
Type of Change
How Has This Been Tested?
swift buildandswift 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 inDownloader.Removed test:
downloaderError_errorDescriptioninErrorDescriptionTests— error type no longer exists.Checklist
Breaking Changes?
Additional Notes
DownloaderErrorandSupportedFileTypeshave been removed entirely fromDownloader. Any truly unsupported file (e.g. a.dmg) will now fail later withToolInstallerError.unknownFileTypeinstead of the formerDownloaderError.unsupportedFileType.