Built the compiler but final tgz is 6GB?

I built the Swift compiler for release 6.2.4 on x86, which took many hours, and the final result was a compressed tarball that is 6 gigabytes. The last time that did this, for 5.9, the tgz file was one tenth of that. Can someone explain why the tarball size has increased by an order of magnitude? I observe that 6.2.4 contains many files that are over 2GB each such as these:

-rwxr-xr-x root/root 2097469712 2026-03-18 23:03 usr/bin/swift-ast-script
-rwxr-xr-x root/root 2119675992 2026-03-18 22:09 usr/bin/swift-frontend
-rwxr-xr-x root/root 2030316384 2026-03-18 23:03 usr/bin/swift-refactor
-rw-r--r-- root/root 2109457016 2026-03-18 22:09 usr/lib/swift/host/compiler/lib_InternalSwiftScan.so
-rw-r--r-- root/root 2150594112 2026-03-18 23:01 usr/lib/libsourcekitdInProc.so

This feels like object files are no longer stripped by default, but if so why not?

You'll have to tell us what command you are using to build, before we can answer your question.

I'd guess you built for debug mode, not release mode.

This is also posted in the wrong forum section.

Actually it turns out I built with --release-debuginfo which is what ChatGPT suggested.

But I’m wondering why does an option exist to release with debug info?

It seemed like a devolution at the time.

Because --release and --release-debuginfo do different things.

What do you want to do?

A statement of fact but why does --release-debuginfo exist? Just curious.

I’m just building the compiler so I don’t have to download a binary. Standard security protocol.

Then you just want --release.

In CMake, this is the RelWithDebInfo CMAKE_BUILD_TYPE. You can investigate what constitutes the difference there to understand why the option exists here. Happy hunting.

1 Like

Final release size is acceptable:

862M Mar 20 12:22 swift-6.2.4-RELEASE.tgz
1 Like

Release/debug (which controls amount of optimizations applied) and presence/absence of debug info are somewhat orthogonal. You can build in debug mode with reduced optimizations, and then strip debug information (which is uncommon, but technically possible), and you can build in release mode with optimizations applied, but keep debug information at the same time.

3 Likes