Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link error when building in command line #171

Closed
Kyle-Ye opened this issue Jan 4, 2024 · 3 comments
Closed

Link error when building in command line #171

Kyle-Ye opened this issue Jan 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Kyle-Ye
Copy link
Contributor

Kyle-Ye commented Jan 4, 2024

Description

> swift test

...
  protocol descriptor for SwiftCompilerPlugin.CompilerPlugin, referenced from:
      l_got.$s19SwiftCompilerPlugin0bC0Mp in TestingMacrosMain.swift.o
  static (extension in SwiftCompilerPlugin):SwiftCompilerPlugin.CompilerPlugin.main() throws -> (), referenced from:
      static TestingMacros.TestingMacrosMain.$main() throws -> () in TestingMacrosMain.swift.o
  protocol conformance descriptor for Swift.String : SwiftSyntaxBuilder.ExpressibleByLiteralSyntax in SwiftSyntaxBuilder, referenced from:
      lazy protocol witness table accessor for type Swift.String and conformance Swift.String : SwiftSyntaxBuilder.ExpressibleByLiteralSyntax in SwiftSyntaxBuilder in AvailabilityGuards.swift.o
  protocol conformance descriptor for Swift.UInt64 : SwiftSyntaxBuilder.ExpressibleByLiteralSyntax in SwiftSyntaxBuilder, referenced from:
      lazy protocol witness table accessor for type Swift.UInt64 and conformance Swift.UInt64 : SwiftSyntaxBuilder.ExpressibleByLiteralSyntax in SwiftSyntaxBuilder in AvailabilityGuards.swift.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: fatalError

Build fine with Xcode GUI locally and CLI on CI. However recently I just can't build locally with CLI by running swift test. It will give me some strange link error.

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

swift-testing version/commit hash

0.2.0

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

swift --version
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx14.0

uname -a
Darwin <redacted> 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
@Kyle-Ye Kyle-Ye added the bug Something isn't working label Jan 4, 2024
@grynspan
Copy link
Contributor

grynspan commented Jan 4, 2024

The 5.9 toolchain is not supported. If you are having trouble while using a main branch development toolchain, please reopen.

@grynspan grynspan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2024
@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented Jan 6, 2024

A duplicated one as swiftlang/swift-package-manager#6940

The upstream SwiftPM team has fixed it on latest 5.9 release (5.9.2). In our case, just update the local Xcode version from Xcode 15.0 to Xcode 15.1 would fix the issue.

My CI is always using Xcode 15.1

@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented Feb 18, 2024

The 5.9 toolchain is not supported. If you are having trouble while using a main branch development toolchain, please reopen.

I have run some runtime crash on Linux after converting another framework to swift-tesing.

Since I still use 5.9 + 0.3.0 (There is no Swift 5.10 release toolchain yet on Linux), I'll report an issue if it was still there after the version bump.

For now I just comment the 2 crash test file out and limit to Darwin only.

// *** Program crashed: Bad pointer dereference at 0x0000000ffff9400a ***
// swift-testing framework will crash here on Linux
// Report to upstream for investigation when we bump to 5.10
#if canImport(Darwin)
final class ExternalTests: TestBase {
    @Test
    func example() throws {	}
}
#endif

class TestBase {
    init() { ... }
    
    deinit { ... }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants