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

Make Package.Swift Explicit #14021

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rofle100lvl
Copy link

#13998 issue

Description

This pull request addresses an issue with the FirebasePerformance library in Firebase project. Currently, the Target FirebasePerformance is not explicitly declared as a product target of "FirebasePerformance" library in the Package.swift file. As a result, tools designed to detect implicit dependencies are marking the import FirebasePerformance statement as an implicit dependency across projects that utilize the FirebasePerformance library.

Proposed Change

To resolve this issue, I propose explicitly adding FirebasePerformance to FirebasePerformance library targets in the Package.swift file. This modification will ensure that there are no implicit dependencies related to FirebasePerformance, thereby enhancing clarity and maintaining strict dependency management.

Benefits

  • Reduces potential for dependency-related issues in the future.
  • Simplifies maintenance and improves clarity of dependency declarations.
  • Ensures compliance with best practices for Swift package management.

Copy link

google-cla bot commented Nov 4, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ncooke3
Copy link
Member

ncooke3 commented Nov 4, 2024

Thanks for the PR, @rofle100lvl. The reason for the indirection here is to work around potential build issues on non-iOS platforms. FirebasePerformanceTarget acts as a wrapper target that keeps the FirebasePerformance target from building for unsupported platforms.

.target(
name: "FirebasePerformanceTarget",
dependencies: [.target(name: "FirebasePerformance",
condition: .when(platforms: [.iOS, .tvOS, .visionOS]))],
path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
),

@andrewheard
Copy link
Contributor

Thanks for the PR, @rofle100lvl. The reason for the indirection here is to work around potential build issues on non-iOS platforms. FirebasePerformanceTarget acts as a wrapper target that keeps the FirebasePerformance target from building for unsupported platforms.

+1 to Nick's comments. Unfortunately we can't accept the PR as is since it will break our Package builds for macOS and watchOS, which aren't supported by Firebase Performance. We're using this wrapper target approach for a few SDKs since library products in Swift Package Manager don't have any options for conditional inclusion, unlike targets.

I'll kick off the CI since I expect we have a workflow that will demonstrate the issue.

@paulb777
Copy link
Member

paulb777 commented Nov 8, 2024

Thanks for the PR. We'll need to take some time to reevaluate how we're managing multi-Apple platform support before moving forward with it.

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 this pull request may close these issues.

4 participants