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

unable to build a release from the latest master on Xcode 13.3.1 #490

Closed
ayyappa-s opened this issue Apr 26, 2022 · 15 comments
Closed

unable to build a release from the latest master on Xcode 13.3.1 #490

ayyappa-s opened this issue Apr 26, 2022 · 15 comments

Comments

@ayyappa-s
Copy link

hi I was trying to clone and run make build_release it get broken due to duplicate symbols for on Xcode 13.3.1 ?

duplicate symbol '_swiftparse_syntax_structure_versioning_identifier' in:
    periphery/.build/apple/Products/Release/SwiftSyntaxParser.o
    /periphery/.build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser

ld: 14 duplicate symbols for architecture arm64
@AF-cgi
Copy link

AF-cgi commented Apr 28, 2022

@ayyappa-s You can try the master branch. It should work. Therefor needs a new release.

@liamnichols
Copy link
Collaborator

@ileitch, would it be possible to tag a release for this sometime soon? 🙏

@ayyappa-s
Copy link
Author

ayyappa-s commented May 2, 2022

just tried with makebuild_release latest master (bf905a03773e33e5717f6a1973e1e50fb6b84238) same results :(

duplicate symbol _swiftparse_diagnostic_get_fixit in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_diagnostic_get_fixit_count in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_diagnostic_get_message in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_diagnostic_get_range in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_diagnostic_get_range_count in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_diagnostic_get_severity in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_diagnostic_get_source_loc in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_parse_string in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_parser_create in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_parser_dispose in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_parser_set_diagnostic_handler in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_parser_set_node_handler in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_parser_set_node_lookup in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser
duplicate symbol _swiftparse_syntax_structure_versioning_identifier in:
    .build/apple/Products/Release/SwiftSyntaxParser.o
    .build/apple/Products/Release/lib_InternalSwiftSyntaxParser.framework/lib_InternalSwiftSyntaxParser

ld: 14 duplicate symbols for architecture arm64

@ayyappa-s
Copy link
Author

ayyappa-s commented May 2, 2022

looks like i found something. There is an open issue which could affecting our build swiftlang/swift-package-manager#5733

took the text below from here - https://github.com/keith/StaticInternalSwiftSyntaxParser

Note: because of this bug if you want to depend on this target in SwiftPM and target multiple architectures in a single build, you must only depend on it from top level targets such as a test or executable target.

@ileitch for your kind attention.

@liamnichols
Copy link
Collaborator

Ah, I never checked the Makefile when working on swiftlang/swift#473, we can use a workaround similar to this:

https://github.com/krzysztofzablocki/Sourcery/blob/9616fade78c7a79f257c7b9b401a71820b501101/Rakefile#L66-L74

I'll try and work on a patch tomorrow 🤞

@ayyappa-s
Copy link
Author

thanks @liamnichols :). that would be very helpful

@liamnichols
Copy link
Collaborator

@ayyappa-s: It's also worth mentioning that make build_release is only necessary if you want to build a universal binary (i.e to package for distribution).

If you want to just build for use locally on your machine, running swift build -c release should do the trick (the output can be found at swift build -c release --show-bin-path

@ayyappa-s
Copy link
Author

sure i will use that but i still need it for package distribution, will wait for you :). until then I will use the local way for now. thanks

@liamnichols
Copy link
Collaborator

Ahh ok, understood 🙂 fix is in #493 👍

@ayyappa-s
Copy link
Author

ayyappa-s commented May 4, 2022

one thing i noticed with the latest periphery build on my local machine is the time taken for the periphery scan is kind of doubled. will check this again and let you know.

yes this is true @liamnichols verified it twice :(.

@liamnichols
Copy link
Collaborator

@ayyappa-s: To confirm, how did you compare? Are you able to share a small sample project that we can use to compare together?

Am I right in assuming that you are seeing this difference between the last official release and building master? Do you still see the issue if you use Xcode 13.2.1 to build periphery instead of Xcode 13.3?

@ayyappa-s
Copy link
Author

sure @liamnichols i will see how project can be shared, btw is there a way where we can ask periphery to run in a mode to show why things getting slowed down ? if there is something to diagnose can you please share ?

@liamnichols
Copy link
Collaborator

Actually from digging around the repo, I saw there is also a kind of benchmarking script used in the repo for scanning the periphery code itself...

I did a comparison on master (well, my patch for swiftlang/swift#493) using different versions of Xcode to compile the project:

Xcode 13.2.1

$ ./scripts/scan --skip-build --strict
[10/10] Build complete!
* Inspecting project...
* Indexing...
* Analyzing...

* No unused code detected.

real	0m3.491s
user	0m6.228s
sys	0m0.315s

Xcode 13.3

$ ./scripts/scan --skip-build --strict
Building for debugging...
Build complete! (1.24s)
* Inspecting project...
* Indexing...
* Analyzing...

* No unused code detected.

real	0m2.184s
user	0m5.885s
sys	0m0.241s

I also checked out the latest release tag (2.8.6) and ran the same command with Xcode 13.2.1 again:

$ ./scripts/scan --skip-build --strict
[0/0] Build complete!
* Inspecting project...
* Indexing...
* Analyzing...

* No unused code detected.

real	0m2.268s
user	0m5.885s
sys	0m0.290s

At a first glance, it doesn't suggest any significant change, but this was in no way a scientific test 😄 It feels like it might be a separate issue though, although I'm not sure

@ayyappa-s
Copy link
Author

thanks @ileitch i am closing down this issue for now and open a new one for the time. thanks for the numbers 🙏🏾

@ileitch
Copy link
Contributor

ileitch commented May 8, 2022

Thank you all for handling this. I will get a new release out later today!

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

4 participants