Skip to content

Cross-compiling tests doesn't work if a package uses macros #8094

Open
@finagolfin

Description

@finagolfin

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

It always fails with an error like this with my Android SDK bundles:

error: Failed opening '/home/finagolfin/swift-syntax/Examples/.build/aarch64-unknown-linux-android24/debug/index/store/v5/units/AddAsyncMacroTests.swift.o-20XPE2PQ2J7J7': No such file or directory

I first reported this bug in April, nothing has changed since.

Expected behavior

The tests to cross-compile

Actual behavior

Weird errors that it can't find a file

Steps to reproduce

  1. ~/swift-6.0.2-RELEASE-fedora39/usr/bin/swift sdk install ~/swift-6.0.2-RELEASE-android-24-0.1.artifactbundle.tar.gz
  2. cd swift-syntax/Examples
  3. ~/swift-6.0.2-RELEASE-fedora39/usr/bin/swift build --build-tests --swift-sdk aarch64-unknown-linux-android24

It fails with a similar error for the latest trunk 6.1 SDK bundle used by the command ~/swift-DEVELOPMENT-SNAPSHOT-2024-10-30-a-ubi9/usr/bin/swift build --build-tests --swift-sdk aarch64-unknown-linux-android24 -Xswiftc -disallow-use-new-driver, with that last flag needed because of a swift-driver 6.1 regression, swiftlang/swift-driver#1723.

Swift Package Manager version/commit hash

SwiftPM 6.0 and 6.1, cross-compiling packages that use macros didn't work at all before that

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

Swift 6.0.2/6.1 cross-compiling the swift-syntax example or swift-foundation tests for Android AArch64 from linux x86_64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions