apple / apple/swift-container-plugin
containertool should warn if the user attempts to stack a mach-O executable on top of a Linux base image
- Dominant language
- Swift
- Stars
- 390
- Forks
- 26
- Avg merge
- 8m
- Merged PRs (30d)
- 1
Description
When using `containertool` directly, or if accidentally using the plugin without a `--swift-sdk`, it is possible to end up layering a mach-O (macOS) executable on top of a Linux container image. This will not run, but the error messages which are printed when trying to run such an image can be difficult to understand.
`containertool` already tries to read an ELF header from the executable, in order to choose the correct base image architecture. It could also detect that the executable is a mach-O binary and warn the user.
Contributor guide
Research direction
Start by reading the containertool path that currently reads the executable's ELF header to choose the base-image architecture. Determine how it can identify a mach-O executable and where a warning should be emitted when it is layered onto a Linux container image; done means the invalid combination produces a clear warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100