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

Swift Build Fails #7

Open
ravelasquez99 opened this issue Apr 21, 2020 · 6 comments
Open

Swift Build Fails #7

ravelasquez99 opened this issue Apr 21, 2020 · 6 comments

Comments

@ravelasquez99
Copy link

It seems this package cannot be added once you update beyond swift 5.

Repro:

  1. Create a library that uses this package. Example: https://pastebin.com/2WEZxsHm . This example uses Vapor but it is also repoduceable on a simple client side package (to get this package run vapor new SECP256k1issue locally in a new repo. Then add the secp256k1 package
  2. Make sure your swift version is > 5.1. Run swift --version to confirm
  3. Run swift build from the folder that contains the package.

Notice the error: https://pastebin.com/ad9WVhsL

@ravelasquez99
Copy link
Author

Update. I pinged the folks in the Swift Package manager slack. They said...

It looks as if the sources: ["."] in the package manifest of the package is causing every file in that directory to be treated as a source file. That line has been in the manifest for a while, so that could be a bug in Swift 5. I don’t know if that was a deliberate change in behavior for swift-tools-version:5.0 packages, but even if it were, it doesn’t seem that the dependency should be treated that way, since it is declaring itself as 4.0

Still pending more comments from them, but I think we may be able to fix this by updating this line to point to a nested folder instead (

)

@ravelasquez99
Copy link
Author

I also confirmed this happened between Swift 5.1->5.2.2. As it does not repro on Swift 5.1

@koraykoska
Copy link
Member

@ravelasquez99 Thanks for identifying this issue. But I don't understand what exactly causes the issue. Is it really the "."? Changing it to a subfolder and moving all the files just works? Could you give it a try and make a PR if it works?

@koraykoska
Copy link
Member

You would only have to move the files secp256k1-config.h, secp256k1_ec_mult_static_context.h and secp256k1_main.h to a headers subfolder and change the "." to "headers". If this is the issue...

@koraykoska
Copy link
Member

For me the error seems more like the compiler is trying to compile non source files. In which case I do really hope they support regex paths already as it would really be painful including all files manually...

@koraykoska
Copy link
Member

@ravelasquez99 I can build the library. Please close this issue unless it persists with current Swift versions.

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