oss-fuzz icon indicating copy to clipboard operation
oss-fuzz copied to clipboard

How do you pick Swift base OS image and what is the status of the multiple images?

Open thomasvl opened this issue 3 months ago • 2 comments

A few questions on the status of Swift and how to correctly use it:

  • Looking at https://github.com/google/oss-fuzz/tree/master/infra/base-images/base-builder-swift, it seems there are three *Docker files, but https://google.github.io/oss-fuzz/getting-started/new-project-guide/swift-lang/ doesn't actually mention how to pick between them. It's also not clear the differences. What are the differences, and how should one configure a project to pick a specific one?

  • Looking at https://github.com/google/oss-fuzz/tree/master/infra/base-images/base-builder, there are three different install_swift*.sh scripts, but looking back at the base-builder-swift/ directory; two of the *Docker files refer to the install_swift.sh, so one of the scripts appears not to be used? Is that also by design?

  • But looking at the install scripts closer, install_swift_ubuntu_24_04.sh seems to different in that it might be trying to support both versions, which cycles me back to should there just be one version of the script with the conditional code or should they all exist with minor edits in each?

thomasvl avatar Sep 18 '25 17:09 thomasvl

Hey @DavidKorczynski,

Could you please take a look at the questions raised in this issue? There appears to be some confusion regarding the current setup of the Swift base images, particularly with the multiple Dockerfile versions (legacy, Ubuntu 20.04, Ubuntu 24.04) and the different install_swift*.sh scripts.

Any clarification you can provide on how these are intended to work together, especially in light of the Ubuntu 24.04 migration, would be greatly appreciated.

Thanks!

hunsche avatar Nov 19 '25 16:11 hunsche

tldr: focus on Dockerfile, with the rest being WIP for updating OSS-Fuzz to newer Ubuntu versions. Making changes in Dockerfile will impact the projects as is now. But, since we're working on Ubuntu updtes we should either (1) update the Ubuntu* files as well, or (2) track the changes needed in an issue so we know what to do.

A few questions on the status of Swift and how to correctly use it:

  • Looking at https://github.com/google/oss-fuzz/tree/master/infra/base-images/base-builder-swift, it seems there are three *Docker files, but https://google.github.io/oss-fuzz/getting-started/new-project-guide/swift-lang/ doesn't actually mention how to pick between them. It's also not clear the differences. What are the differences, and how should one configure a project to pick a specific one?

For now, focus on the Dockerfile and not the ubunu* files. The ubuntu* files are part of a current effort of migrating OSS-Fuzz to newer versions of Ubuntu. This is, however, ongoing work and this is not what is currently being run on for the projects. We are doing it this way to reduce friction on projects while migrating.

To this end, if we're updating the swift version in Dockerfile we either (1) try to do the same things for the ubuntu* images in preparation for the migration; (2) track in an issue that this has been updated and when migrating to the new Ubuntu versions we should upgrade swift versions as well.

  • Looking at https://github.com/google/oss-fuzz/tree/master/infra/base-images/base-builder, there are three different install_swift*.sh scripts, but looking back at the base-builder-swift/ directory; two of the *Docker files refer to the install_swift.sh, so one of the scripts appears not to be used? Is that also by design?

Answer follows above more or less. Focus on Dockerfile and then either apply similar changes to the other in-process Ubuntu migrations or track in an issue.

  • But looking at the install scripts closer, install_swift_ubuntu_24_04.sh seems to different in that it might be trying to support both versions, which cycles me back to should there just be one version of the script with the conditional code or should they all exist with minor edits in each?

I would say the stuff in install_swift_ubuntu_24_04.sh is probably WIP at this point. I suspect Ubuntu 24 supports multiple versions to avoid breaking some projects during migration. However, if we can migrate all projects to a newer version in the Ubuntu upgrade, then we should just support the latest swift version.

DavidKorczynski avatar Nov 25 '25 14:11 DavidKorczynski

Closing this since I think I have https://github.com/google/oss-fuzz/pull/14486 read to go based on the information here.

thomasvl avatar Dec 16 '25 13:12 thomasvl