Problem installing swift on AWS linux instances

I'm relatively new to Swift. Today I was trying to install swift as described at Swift.org - Install Swift

on AWS instances. I tried Amazon Linux and Ubuntu 22.04 and 24.04. On all 3 instances, I got this ominous warning running swift after completing installation steps:

**ubuntu@ip-172-31-16-213**:**~**$ swift -version

**<unknown>:0:** **warning:** **libc not found for 'x86_64-unknown-linux-gnu'; C stdlib may be unavailable**
Swift version 6.0.3 (swift-6.0.3-RELEASE)
Target: x86_64-unknown-linux-gnu

Interestingly, I did not see this issue on my laptop running Ubuntu 22.04

Any guidance is appreciated!

This appears to be a spurious warning that is sometimes spit out by the libclang importer that looks for libc headers in your platform's C sysroot. While it is good that we're now producing a warning, unlike before when it might silently fail, that probably needs to be fine-tuned to only warn for situations where it's a real problem.

Feel free to file an issue and somebody may get to it.

2 Likes

Thank you! Issue filed: Spurious warning about missing libc on AWS EC2 Linux instances · Issue #79865 · swiftlang/swift · GitHub

1 Like