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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcodebuild fails on Xcode 12.1 (12A7403) with SwiftyBeaver as a dependency #434

Closed
andylamp opened this issue Nov 8, 2020 · 14 comments
Closed

Comments

@andylamp
Copy link

andylamp commented Nov 8, 2020

First of, thanks for the amazing package 馃槃! Now, installing SwiftyBeaver using the Swift Package manager, as is shown within README fails when invoked through the command line. However, if the project is compiled from within Xcode everything works as expected.

The steps to reproduce this are fairly simple:

  1. Use Xcode 12.1 (12A7403),
  2. Create a new Swift App,
  3. Add SwiftyBeaver using the Swift Package Manager,
  4. Do the following in the @main - that's the only thing I changed in the whole code generated.
import SwiftUI
import SwiftyBeaver

let log = SwiftyBeaver.self
let console = ConsoleDestination()  // log to Xcode Console

@main
struct testpackageApp: App {
    let persistenceController = PersistenceController.shared

    var body: some Scene {
        WindowGroup {
            ContentView()
              .environment(\.managedObjectContext, persistenceController.container.viewContext).onAppear {
                log.addDestination(console)
                
                log.info("an example to show it has loaded")
              }
        }
    }
}

If I compile within Xcode IDE (even the use of the simulator) everything works as expected; should I go to the command line and type in the directory of the project xcodebuild then it fails with:

/Users/andylamp/Desktop/testpackage/testpackage/testpackageApp.swift:10:8: error: no such module 'SwiftyBeaver'
import SwiftyBeaver
       ^

** BUILD FAILED **

Removing SwiftyBeaver and adding another dependency seems to not generate the same issue (I tried with Alamofire).

Hope this helps to resolve the issue!

@skreutzberger
Copy link
Collaborator

thanks for the example and explanation. so it seems to be an SPM issue since it works after that. Weird. Let's see if other contributors have a solution for it.

@andylamp
Copy link
Author

andylamp commented Nov 9, 2020

@skreutzberger just wondering - were you able to reproduce it locally on your end? I tried on two different machines and given the steps above I could reproduce it. My conjecture also is that the problem lies with SPM itself.

@skreutzberger
Copy link
Collaborator

yes, I could reproduce it. I guess it is an SPM issue.

@skreutzberger
Copy link
Collaborator

I am closing the ticket for now until more people do report it

@andylamp
Copy link
Author

hmm, is there any workaround with this? this is kind of important as it breaks CI pipelines...

@andylamp
Copy link
Author

@skreutzberger just to update this - the issue still happens on 12.2 Xcode which was released recently; and is the latest version available.

@delvinwidjaja
Copy link

Hi @andylamp , did you manage to solve this issue? I'm having the same problem with SPM & SwiftyBeaver

@andylamp
Copy link
Author

@delvinwidjaja as far as I can tell the issue is still present, @skreutzberger said he'd ignore it until it became a bigger issue (i.e.: more people reported it).

Hope this helps.

@IsaiahJTurner
Copy link

This project has been potentially breached and your app may be exposing private information. See issue #453

@skreutzberger
Copy link
Collaborator

@IsaiahJTurner What a troll. WTF is just wrong with you abusing the Github notification system? I have reported you to Github for spam. If you want to advertise for a company or project then please do it the normal way and leave the SwiftyBeaver contributors alone. SWIFTYBEAVER HAS NOT BEEN BREACHED. SwiftyBeaver is an open-source framework and its used encryption is public, known and trusted since several years. Feel free to contribute source code which makes it safer from your point of view and the contributors and I will consider merging it.

@andylamp
Copy link
Author

@skreutzberger dw mate, we all love the project; please keep up the good work! @IsaiahJTurner please stop harassing people with baseless claims stemming from ignorance.

@skreutzberger
Copy link
Collaborator

thank you @andylamp 馃檹

@reececomo
Copy link

reececomo commented Apr 18, 2021

@skreutzberger was broken in our CI environment for us too.

Like @andylamp mentioned, all our other Swift Packages work fine, so I suspect there might be some package setting that causes this? (A bug in SPM surely, but maybe it can be mitigated.)

Unfortunately we had to remove SwiftyBeaver 馃槮 in the meantime, would love to switch back at some point.

/Source/Utilities/Log.swift:1:8: error: no such module 'SwiftyBeaver'
import SwiftyBeaver
       ^


** BUILD FAILED **


The following build commands failed:
	CompileSwift normal arm64
	CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler

@mpawlo
Copy link

mpawlo commented Jul 15, 2021

Problem still valid on Xcode 12.5.1

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

6 participants