Real newbie here, since I haven't even successfully built Swift. After executing the build script for about 9 hours, it fails because it can't find
stdalign.h I am trying to build swift on the following. Any help would be greatly appreciated.
Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-47-generic x86_64)
Checked out from
> git clone https://github.com/apple/swift.git
> ./swift/utils/update-checkout --clone
> ./swift/utils/build-script -- \ preset=buildbot_swiftpm_linux_platform,tools=RA,stdlib=RA
.....Building for production...
In file included from /home/mtennes/swift-source/swift-crypto/Sources/CCryptoBoringSSL/crypto/fipsmodule/bn/exponentiation.c:119:
In file included from /home/mtennes/swift-source/swift-crypto/Sources/CCryptoBoringSSL/crypto/fipsmodule/bn/internal.h:135:
/home/mtennes/swift-source/swift-crypto/Sources/CCryptoBoringSSL/crypto/fipsmodule/bn/../../internal.h:128:10: fatal error: 'stdalign.h' file not found
1 error generated.
and yet the file exists
Any particular reason you're building this SPM preset and not simply the main linux preset?
That error doesn't tell us much, you'd need to include the compiler invocation and other lines above that.
It should be using the second of your list of locations for that header, so something has gone wrong. What does this command show?
ls -l build/buildbot_incremental/toolchain-linux-x86_64/usr/lib/swift/clang
That should point at the second directory, you can download a prebuilt trunk snapshot toolchain here and compare.
It's what the book said.
Before you begin building Swift, you will need to understand that this will take hours to build depending on your system or virtual machine setup. If you are using a virtual machine, like VirtualBox, I would strongly recommend that you allocate multiple cores to your virtual machine; it will dramatically shorten the build time. The following command will build Swift, its toolchain, and the package manager:
Once this has built everything, we need to install it somewhere and put the binaries in our path.”
Mastering Swift 5.3