Skip to content

swift build release-mode rebuild using previously cached .build fails with error: undefined reference to 'xxx' #8260

@MahdiBM

Description

@MahdiBM

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

vapor/penny-bot CI (link, uploaded) is failing.

I think it's because the CI file (here) uses .build caching, and SwiftNIO has removed a (C?) symbol.
swift build -c release can no longer find the related code to that symbol, so it quits.

Seems to relate to this SwiftNIO PR.

Does not happen outside release builds.

This is one of the only reasons our .build caching results in failures in CI. It's almost always due to undefined symbol errors. I've seen it happen with other libraries as well, including Foundation.

Expected behavior

No build failures.

Actual behavior

build failures.

Steps to reproduce

Have not precisely tested this steps but I'm pretty sure this is what happened:

  1. swift build -c release a package depending on SwiftNIO 2.79.0.
  2. Update SwiftNIO to 2.80.0.
  3. Rebuild.

observe: error: undefined reference to '$s7NIOCore7sysFreeyySvXCvp'

Not sure if reproducible on macOS.

Swift Package Manager version/commit hash

6.0.3 RELEASE

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

6.0.3 RELEASE

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions