JamitLabs / Accio

A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.
MIT License
664 stars 32 forks source link

Can't build package dependent on package #47

Closed MortenGregersen closed 5 years ago

MortenGregersen commented 5 years ago

I've a swift package which depends on SwiftSyntax/libsyntax. When I use accio to use my swift package in an macOS app, it fails building my package. It seems that the error is when building with Carthage, where the files from SwiftSyntax is missing (see the attached log).

I've created a sample project, which is a macOS app with only my package as dependency. It can be found at https://github.com/MortenGregersen/accio-bug-sample

I've added a Cartfile to the sample project just to test if I could build the package with Carthage - this also fails.

Can anyone see what I am doing wrong?

Here is the console output:
``` ➜ accio-bug-sample git:(master) accio install ✨ Resolving dependencies ... Fetching https://github.com/apple/swift-package-manager.git Fetching https://github.com/apple/swift-syntax.git Fetching https://github.com/MortenGregersen/SwiftCodeCodable.git Completed resolution in 4.12s Cloning https://github.com/apple/swift-syntax.git Resolving https://github.com/apple/swift-syntax.git at 0.50000.0 Cloning https://github.com/MortenGregersen/SwiftCodeCodable.git Resolving https://github.com/MortenGregersen/SwiftCodeCodable.git at libsyntax Cloning https://github.com/apple/swift-package-manager.git Resolving https://github.com/apple/swift-package-manager.git at 0.3.0 ✨ Reading package manifest at /Users/morten/MoGee/Projects/accio-bug-sample/Package.swift ... ✨ Generating dependency graph ... ✨ Resolving dependencies for target 'MyApp' on platform 'macOS' ... ✨ Found cached build products for SwiftSyntax in local cache - skipping build. ✨ Building library SwiftCodeCodable with Carthage ... *** xcodebuild output can be found in /var/folders/88/94r4q5r907b0t0bj8mj69qth0000gn/T/carthage-xcodebuild.v6jVq9.log *** Building scheme "SwiftCodeCodable-Package" in SwiftCodeCodable.xcodeproj Build Failed Task failed with exit code 65: /usr/bin/xcrun xcodebuild -project /Users/morten/MoGee/Projects/accio-bug-sample/.accio/checkouts/SwiftCodeCodable/SwiftCodeCodable.xcodeproj -scheme SwiftCodeCodable-Package -configuration Release ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/88/94r4q5r907b0t0bj8mj69qth0000gn/T/SwiftCodeCodable SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/morten/MoGee/Projects/accio-bug-sample/.accio/checkouts/SwiftCodeCodable) This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/88/94r4q5r907b0t0bj8mj69qth0000gn/T/carthage-xcodebuild.v6jVq9.log An error occurred: Command '/bin/bash -c "/usr/local/bin/carthage build --project-directory '/Users/morten/MoGee/Projects/accio-bug-sample/.accio/checkouts/SwiftCodeCodable' --platform macOS --no-skip-current --no-use-binaries"' returned with error code 1. ```

carthage-xcodebuild.v6jVq9.log

Jeehut commented 5 years ago

Hi @MortenGregersen, thank you for reporting this. From what I can see you seem not to have made a mistake. Please note that I already had several different problems with SwiftSyntax in different contexts (one of which being it couldn't be correctly linked with even with SwiftPM directly, see this ticket), so SwiftSyntax seems to be a special case when it comes to linking.

I'm not sure what the exact issue is though, this needs further investigation ... Maybe @mrylmz has an idea? :)

mrylmz commented 5 years ago

Hi @MortenGregersen there is some additional work described in the readme of swift syntax which has to be done prior to using SwiftPM to build the project. Could it be possible that this phase is missing when it is build with Accio or Carthage directly?

MortenGregersen commented 5 years ago

Hi @MortenGregersen there is some additional work described in the readme of swift syntax which has to be done prior to using SwiftPM to build the project. Could it be possible that this phase is missing when it is build with Accio or Carthage directly?

This is maybe why I can't get it to work. I'm closing this issue, as I won't be using Accio for my project, and can't help more investigating the issue.