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

Xcode build archive fails #79

Open
1 task done
danthorpe opened this issue May 1, 2024 · 4 comments
Open
1 task done

Xcode build archive fails #79

danthorpe opened this issue May 1, 2024 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@danthorpe
Copy link

danthorpe commented May 1, 2024

Describe the bug
xcodebuild archive fails in the following scenario.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Swift Package, which depends on MetaCodable
  2. Create a Target which depends on MetaCodable, HelperCoders and uses the MetaProtocolCodable plugin.
  3. Include this target as a product of the package
  4. Add types into the target which make use of dynamic data variations, in particular Step 9 from the tutorial: https://swiftpackageindex.com/swiftylab/metacodable/v1.3.0/tutorials/metacodable/dynamic
  5. Create an Xcode project for an iOS app which imports the product from the package.
  6. Add code-signing for your app
  7. Build and Archive from Xcode Product menu (or using xcodebuild archive)

Expected behavior
I should be able to archive the product.

Actual behaviour
Build script fails because build tools cannot find the executable tool ProtocolGen.

Showing All Issues
sandbox-exec: execvp() of '//Users/daniel/Library/Developer/Xcode/DerivedData/Posts-aaxhnzolyyfxrgcsibzfeeijakbj/Build/Intermediates.noindex/ArchiveIntermediates/Posts/BuildProductsPath/Release/ProtocolGen' failed: No such file or directory

Screenshots

Screenshot 2024-05-01 at 11 17 44

Environment (please complete the following information, remove ones not applicable):

  • OS: macOS
  • Version 14.4.1 (23E224)
  • Xcode Version 15.3 (15E204a)
  • Swift $ swift -version
    swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
    Target: arm64-apple-macosx14.0
  • CocoaPods N/A

Additional context
I have created a small project to demonstrate this issue: https://github.com/danthorpe/metacodable_demo

A possible solution, would be to export ProtocolGen as a Swift artefact bundle, and reference this as a binary target in your Package.swift. e.g. how SwiftLint is packaged. In this project, on macOS, the dependency is a binary target instead of the source code executable.

@danthorpe danthorpe added the bug Something isn't working label May 1, 2024
@soumyamahunt
Copy link
Contributor

@danthorpe this seems more like a bug in Xcode as mentioned here.

@soumyamahunt soumyamahunt removed the bug Something isn't working label May 5, 2024
@soumyamahunt soumyamahunt changed the title [Bug] Xcode build archive fails Xcode build archive fails May 13, 2024
@soumyamahunt soumyamahunt added the enhancement New feature or request label May 30, 2024
@913868456
Copy link

i got the same warnngs in xcode 15.4, macbook pro M3, swift version 5.10, i search a workaround is

 #if compiler(>= 5.10)
private import XXX
#else
@_implementationOnly import XXX
#endif

so when i can resolve these warnings in future release versions of the MetaCodable?

@soumyamahunt
Copy link
Contributor

What warnings are you getting @913868456?

@soumyamahunt soumyamahunt added the good first issue Good for newcomers label Sep 30, 2024
@soumyamahunt
Copy link
Contributor

Hopefully this issue is fixed in new swift-build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants