swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.67k stars 1.32k forks source link

`swift build` fails with error error: `emit-module command failed due to signal 9` on Ubuntu 22.10 x64 #6548

Open valeriyvan opened 1 year ago

valeriyvan commented 1 year ago

Description

swift build fails with error error: emit-module command failed due to signal 9 on Ubuntu 22.10 x64

Expected behavior

I would expect swift build not being terminated with signal 9.

Actual behavior

swift build fails with error error: emit-module command failed due to signal 9 on Ubuntu 22.10 x64

Steps to reproduce

  1. Connect to ubuntu 22.10 over ssh.
  2. Install version 5.8 of swift.
  3. Install zlib missing on Ubuntu 22.10 with apt-get install zlib1g-dev.
  4. git clone git@github.com:nerzh/telegram-vapor-bot.git
  5. cd telegram-vapor-bot/Telegram-bot-example
  6. swift build

Swift Package Manager version/commit hash

5.8.0

Swift & OS version (output of swift --version ; uname -a)

swift --version ; uname -a
Swift version 5.8 (swift-5.8-RELEASE)
Target: x86_64-unknown-linux-gnu
Linux vapor-tg-bot 5.19.0-41-generic #42-Ubuntu SMP PREEMPT_DYNAMIC Mon Apr 17 19:17:03 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
valeriyvan commented 1 year ago

Hm. This looks like insufficient memory problem. I've had this error on instance with 512RAM, with 2GB RAM. With 4GB RAM error goes away.

Would be great to have clear out of memory error message instead of failed due to signal 9.

neonichu commented 1 year ago

Sounds like an issue for the compiler/linker instead, SwiftPM does not control their diagnostics. @shahmishal could you transfer this?