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

Linking error only in Archive/Release build #122

Closed
nneubauer opened this issue Oct 11, 2024 · 4 comments
Closed

Linking error only in Archive/Release build #122

nneubauer opened this issue Oct 11, 2024 · 4 comments

Comments

@nneubauer
Copy link

Hey, probably this is a problem with my individual setup, but I can't really figure out a solution.

I have a relatively small and simple iOS app with FlyingFox (0.17.0). When I build for a debug configuration all works well including on device. But, if I want to archive my build for distribution, I get the following linker error:

Undefined symbol: protocol witness table for FlyingSocks.SocketPool<A> : FlyingSocks.AsyncSocketPool in FlyingSocks

I also don't really have FlyingSocks in use anywhere, just FyingFox.

Any idea what might be wrong? I really didn't mess with any specific settings during the build process and I checked if there are any noteworthy differences between debug and release but I can't find any that seem to be relevant.

If this helps:

XCode 16.0
Build Target is iOS 18
Dependency is managed through XCode package management
Swift 5
Other packages in the project are Starscream and SwiftUIKit, nothing else.

I am happy to read on anywhere else, but a pointer would be much appreciated. Thanks!

@swhitty
Copy link
Owner

swhitty commented Oct 11, 2024

Thanks for reporting this issue. I've fixed something similar on Linux recently are you able to try the main branch to see if it still has the issue?

Can you also share the snippet of how you initialise HTTPServer? then I can attempt to reproduce.

@nneubauer
Copy link
Author

Hey,

here is a quick snipped to help to reproduce:

import Foundation
import FlyingFox

class Server {
    let server: HTTPServer
    var serverTask : Task<(), any Error>?
    
    init(serverPort: Int = 8080) {
        self.server = HTTPServer(port: UInt16(serverPort))
    }
    
    func startServer() async throws {
        
        serverTask = Task {
            try await server.start()
        }
        
        try await server.waitUntilListening()
        print("Listening...")
        
    }
}

If you add that to the default iOS App template in XCode it already fails to build for the default release config. (After adding FlyingFox as a dependency.)

I'll tryt the main branch next.

@swhitty
Copy link
Owner

swhitty commented Oct 13, 2024

Thanks, I've managed to reproduce the issue and it does appear that commit 2ec8ae2b fixed the issue so I have pushed out a new release 0.18.0

@nneubauer
Copy link
Author

Can confirm 0.18.0 fixed the archive/release build. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants