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

Failed for Gen #33

Closed
SandroDahl opened this issue Mar 22, 2020 · 8 comments · Fixed by #39
Closed

Failed for Gen #33

SandroDahl opened this issue Mar 22, 2020 · 8 comments · Fixed by #39

Comments

@SandroDahl
Copy link

I tried to import https://github.com/pointfreeco/swift-gen and it failed during the progress.

Version: 0.12.0
Error:

➡️  Package: https://github.com/pointfreeco/swift-gen.git @ from(0.2.0)
🔧  Resolving package dependencies ...
📔  Libraries found: Gen
Error: ShellOut encountered an error
Status code: 1
Message: "'Arena-Playground' ... /Arena-Playground: error: product dependency 'Gen' in package 'Gen' not found
warning: dependency 'Gen' is not used by any target"
Output: ""

Steps to reproduce:

arena https://github.com/pointfreeco/swift-gen.git@from:0.2.0

Local fix:

I was able to fix it locally by getting rid of the package name, because it can be optional.
But the question is - does my change make sense? I'm not so familiar with the SPM.

ArenaCommand.swift:210

.product(name: "\($0.libraryName)", package: "\($0.packageName)") // original 
.product(name: "\($0.libraryName)") // new
@finestructure
Copy link
Owner

Thanks @SandroDahl for reporting that issue, I can reproduce it.

I'm not sure what exactly is going wrong here but it's good to know that removing the package name helps. Perhaps the issue is that it's identical to the product name.

I'll take a look, thanks for the report!

@finestructure
Copy link
Owner

I've pushed 0.13.1 - that should fix it :)

finestructure added a commit that referenced this issue Mar 27, 2020
This reverts commit e37ef0c.
@finestructure
Copy link
Owner

This actually breaks again with Xcode 11.4: #38

Fix incoming.

@finestructure finestructure reopened this Mar 27, 2020
finestructure added a commit that referenced this issue Mar 27, 2020
@finestructure finestructure mentioned this issue Mar 27, 2020
@finestructure
Copy link
Owner

Regressed again. Something is up with Xcode versions and PackageDescription formats.

@finestructure finestructure reopened this Mar 31, 2020
@finestructure
Copy link
Owner

The original fix (to remove package: "Gen") doesn't work anymore:

/Users/sas/Projects/Arena/Arena-Playground: error: manifest parse error(s):
/Users/sas/Projects/Arena/Arena-Playground/Package.swift:36:14: error: 'product(name:package:)' is unavailable: the 'package' argument is mandatory as of tools version 5.2
            .product(name: "Gen")
             ^~~~~~~
PackageDescription.Target.Dependency:4:24: note: 'product(name:package:)' was obsoleted in PackageDescription 5.2
    public static func product(name: String, package: String? = nil) -> PackageDescription.Target.Dependency

@finestructure
Copy link
Owner

finestructure commented Mar 31, 2020

Now it worked, without changes:

 ~/P/Arena  ⎇ $  swift run arena https://github.com/pointfreeco/swift-gen -f
...
➡️  Package: https://github.com/pointfreeco/swift-gen @ from(0.2.0)
🔧 Resolving package dependencies ...
📔 Libraries found: Gen
🔨 Building package dependencies ...
✅ Created project in folder 'Arena-Playground'
 ~/P/Arena  ⎇ $  git rev-parse @
ea260e1daa89fea992b707364a7ddccf47873db9

🤔

@finestructure
Copy link
Owner

running examples just now:

➡️  Package: https://github.com/pointfreeco/swift-gen @ from(0.2.0)
🔧 Resolving package dependencies ...
📔 Libraries found: Gen
Error: ShellOut encountered an error
Status code: 1
Message: "'Arena-Playground' /Users/sas/Projects/Arena/Arena-Playground: error: product dependency 'Gen' in package 'Gen' not found
warning: dependency 'Gen' is not used by any target"
Output: ""

No idea what's going here, this is 10dda7b without any changes except making the library dynamic.

@finestructure
Copy link
Owner

Fixed by #50

My best guess is that it was an issue with swift 5.2.2 from Xcode 11.4.1 and swift 5.2 in .swift-version.

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

Successfully merging a pull request may close this issue.

2 participants