pointfreeco/swift-dependencies

Linux build with `--static-swift-stdlib` fails

finestructure opened this issue · 0 comments

Description

Building (the swift-dependencies package itself or with the package as a dependency) fails on Linux when using --static-swift-stdlib.

I should be able to work around the lack of static linking of the stdlib by building without and copying all the libs like we used to in the past but if there's a simple fix to support this flag that'd be great.

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

docker run --rm -v "$PWD":/host -w /host swift:5.8-focal swift build --static-swift-stdlib

should succeed, just like

docker run --rm -v "$PWD":/host -w /host swift:5.8-focal swift build

does.

Actual behavior

Fails to compile with error:

/host/Sources/Dependencies/DependencyValues.swift:353:10: error: no such module 'XCTest'
  import XCTest
         ^

Steps to reproduce

Steps to reproduce:

❯ git clone https://github.com/pointfreeco/swift-dependencies && cd swift-dependencies
❯ git rev-parse @
0f34848e741315119703b1990e5c962929ed5dff
❯ docker run --rm -v "$PWD":/host -w /host swift:5.8-focal swift build --static-swift-stdlib
Fetching https://github.com/apple/swift-argument-parser
Fetching https://github.com/pointfreeco/xctest-dynamic-overlay
...
[96/122] Emitting module Dependencies
/host/Sources/Dependencies/DependencyValues.swift:353:10: error: no such module 'XCTest'
  import XCTest
         ^
[97/139] Compiling Benchmark BenchmarkCommand.swift
...

Dependencies version information

0f34848 (current main)

Destination operating system

Linux

Xcode version information

No response

Swift Compiler version information

Swift version 5.8 (swift-5.8-RELEASE)
Target: aarch64-unknown-linux-gnu