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

Build issue beginning in v3.4.0 potentially related to added build target #241

Closed
3 tasks done
reedshea opened this issue Jun 17, 2024 · 5 comments
Closed
3 tasks done

Comments

@reedshea
Copy link

New Issue Checklist

Expected behavior

I am using a library that has a dependency on swift-crypto. xcodebuild started failing in CI/CD after an automatic dependency update to swift-crypto v3.4.0. Expected behavior: the build should succeed. 😃 This looks like it may be the same issue as #235 but I'm not sure.

Actual behavior

The app builds locally. In CI/CD with GitHub Actions publishing to TestFlight, there is a build error:

error: Signing for "swift-crypto_Crypto" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'swift-crypto_Crypto' from project 'swift-crypto')

Steps to reproduce

In a brand-new Xcode project, add swift-crypto as a dependency, specifying v3.3.0. Then, run xcodebuild build.

Using `swift-crypto v3.3.0:

Target 'Crypto' in project 'swift-crypto'
        ➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'

Using swift-crypto v3.4.0:

Target 'Crypto' in project 'swift-crypto'
        ➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'
        ➜ Explicit dependency on target 'swift-crypto_Crypto' in project 'swift-crypto'

Details

Terminal output from xcodebuild build using swift-crypto v3.3.0:

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build

User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES

Resolve Package Graph

Resolved source packages:
swift-crypto: https://github.com/apple/swift-crypto.git @ 3.3.0

ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (8 targets)
Target 'build-issue' in project 'build-issue'
➜ Explicit dependency on target '_CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'
Target 'Crypto' in project 'swift-crypto'
➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'
Target '_CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target '_CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSL' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSLShims' in project 'swift-crypto'
➜ Explicit dependency on target 'CryptoBoringWrapper' in project 'swift-crypto'
➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'
Target '_CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSL' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSLShims' in project 'swift-crypto'
➜ Explicit dependency on target 'CryptoBoringWrapper' in project 'swift-crypto'
➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'
Target 'Crypto' in project 'swift-crypto' (no dependencies)
Target 'CryptoBoringWrapper' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSL' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSLShims' in project 'swift-crypto'
Target 'CCryptoBoringSSLShims' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSL' in project 'swift-crypto'
Target 'CCryptoBoringSSL' in project 'swift-crypto' (no dependencies)
GatherProvisioningInputs
[...]

Terminal output from xcodebuild build using swift-crypto v3.4.0:

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build

User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES

Resolve Package Graph

Resolved source packages:
swift-crypto: https://github.com/apple/swift-crypto.git @ 3.4.0

ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (13 targets)
Target 'build-issue' in project 'build-issue'
➜ Explicit dependency on target '_CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'
Target 'Crypto' in project 'swift-crypto'
➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'
➜ Explicit dependency on target 'swift-crypto_Crypto' in project 'swift-crypto'
Target '_CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target '_CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target 'swift-crypto__CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSL' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSLShims' in project 'swift-crypto'
➜ Explicit dependency on target 'CryptoBoringWrapper' in project 'swift-crypto'
➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'
Target '_CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target 'swift-crypto__CryptoExtras' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSL' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSLShims' in project 'swift-crypto'
➜ Explicit dependency on target 'CryptoBoringWrapper' in project 'swift-crypto'
➜ Explicit dependency on target 'Crypto' in project 'swift-crypto'
Target 'Crypto' in project 'swift-crypto'
➜ Explicit dependency on target 'swift-crypto_Crypto' in project 'swift-crypto'
Target 'swift-crypto_Crypto' in project 'swift-crypto' (no dependencies)
Target 'CryptoBoringWrapper' in project 'swift-crypto'
➜ Explicit dependency on target 'swift-crypto_CryptoBoringWrapper' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSL' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSLShims' in project 'swift-crypto'
Target 'swift-crypto_CryptoBoringWrapper' in project 'swift-crypto' (no dependencies)
Target 'CCryptoBoringSSLShims' in project 'swift-crypto'
➜ Explicit dependency on target 'swift-crypto_CCryptoBoringSSLShims' in project 'swift-crypto'
➜ Explicit dependency on target 'CCryptoBoringSSL' in project 'swift-crypto'
Target 'swift-crypto_CCryptoBoringSSLShims' in project 'swift-crypto' (no dependencies)
Target 'CCryptoBoringSSL' in project 'swift-crypto'
➜ Explicit dependency on target 'swift-crypto_CCryptoBoringSSL' in project 'swift-crypto'
Target 'swift-crypto_CCryptoBoringSSL' in project 'swift-crypto' (no dependencies)
Target 'swift-crypto__CryptoExtras' in project 'swift-crypto' (no dependencies)
[...]
GatherProvisioningInputs

@reedshea reedshea changed the title Build issue Build issue beginning in v3.4.0 potentially related to added build target Jun 17, 2024
@reedshea
Copy link
Author

Deleting the .PrivacyInfo.xcprivacy file in the local build SourcePackages and re-running xcodebuild build resulted in the removal of the Explicit dependency on target 'swift-crypto_Crypto' in project 'swift-crypto' line.

2adec61

@Lukasa
Copy link
Contributor

Lukasa commented Jun 17, 2024

This looks a lot like #231. Do you mind reading through it?

@reedshea
Copy link
Author

It does look like it's the same issue. In my case, I'm using GitHub Actions to build and deploy to TestFlight, using a provisioning profile stored as a GitHub Actions variable.

Adding a privacy manifest file to my app, as described here, had no effect.

Adding DEVELOPMENT_TEAM="<id>" to the GitHub Actions workflow, as suggested by the error message and that issue #231, led to a different issue:

error: swift-crypto_Crypto does not support provisioning profiles. swift-crypto_Crypto does not support provisioning profiles, but provisioning profile [profile name] has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'swift-crypto_Crypto' from project 'swift-crypto')

Trying to set the provisioning profile to "Automatic" wasn't successful.

I haven't been very successful at trying to pin to v3.3.0 as a workaround; the xcodebuild -disableAutomaticPackageResolution flag doesn't seem to be respected in my setup, although I expected it to (possible issue mentioned here).

Thanks in advance for any help & suggestions!

@Lukasa
Copy link
Contributor

Lukasa commented Jun 18, 2024

I'm going to suggest that you take this to the Apple Developer Forums. This appears to be an issue with the way Xcode handles packages with resources, but we do require them here.

@reedshea
Copy link
Author

No luck tracking down the root of the problem. But for posterity, in case someone runs into this or a similar issue in the future, the issue seems to be in using GitHub Actions to build, archive, sign, and push to TestFlight.

The previous setup followed the documented GitHub Actions Xcode setup: https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development

Eliminating GitHub Actions in favor of Xcode Cloud allowed Xcode to be set to Automatically manage signing, which resolved this problem. The xcodebuild logs still show the extra line➜ Explicit dependency on target 'swift-crypto_Crypto' in project 'swift-crypto' but the build works.

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