firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.55k stars 1.45k forks source link

Compilation failing since the last Promises update #12427

Closed Nonouf closed 6 months ago

Nonouf commented 6 months ago

Description

Google/Promises has been updated to 2.4.0 a few days ago and it contains a breaking changes.

The firebase iOS SDK is dependant on Promises versions 2.1.0 to 2.9.9. I've opened an issue with the Promises team here, but in the meantime is there anyway to force the firebase SDK to use an older version of Promises?

Reproducing the issue

  1. Setup a project with the latest Firebase SDK using SPM or update your existing project (make sure to clean derived data and any cache beforehand)
  2. Compile

Firebase SDK Version

10.6.0 (and also tried on the latest 10.21.0)

Xcode Version

15.2

Installation Method

Swift Package Manager

Firebase Product(s)

All

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

No response

google-oss-bot commented 6 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

mojidabckuu commented 6 months ago

Faced the same issue using tuist But using bare SPM Project everything is good.

Had to force Promises back to 2.3.1 to make it work again

Nonouf commented 6 months ago

@mojidabckuu Yes, I've done the same thing for now.

paulb777 commented 6 months ago

Hmm, I'm not able to reproduce, and looking at the Promises diffs from 2.3.1 to 2.4.0, there is only the addition of the privacy manifest and a bump of the Swift version to 5.3.

I'm not sure why either of those would cause the library to fail to build ...

paulb777 commented 6 months ago

We're going to need a repro case to help. The example being discussed at https://github.com/google/promises/issues/228 looks like it might be a problem with the TuIst build system.

Nonouf commented 6 months ago

@paulb777 Yes we're using Tuist indeed. I didn't think at first it could be related.

The repo concerned is a private one. I'll prepare an example project asap and then come back to you.

shreyash-sharechat commented 6 months ago

@Nonouf & @mojidabckuu what tuist & XCode versions you guys are using? We are having: XCode 15.2, Swift 5.9, Tuist 3.17.0

Nonouf commented 6 months ago

@shreyash-sharechat We are using Tuist 3.35.5, Xcode 15.2 and Swift 5.9

mojidabckuu commented 6 months ago

@shreyash-sharechat Xcode 14.3.1 Swift 5.8.1 tuist 3.26.0

mojidabckuu commented 6 months ago

To reproduce the compilation problem you can easily do this by

mkdir firebase-tuist
cd firebase-tuist
echo "3.26.0" >> .tuist-version
tuist bundle
tuist init --platform ios
echo "
import ProjectDescription

let dependencies = Dependencies(
    swiftPackageManager: [
        .remote(
            url: \"https://github.com/firebase/firebase-ios-sdk\",
            requirement: .exact(\"10.7.0\")
        )
    ]
)
" >> Tuist/Dependencies.swift

Then add .external("FirebaseCrashlytics") to app's target

tuist fetch
tuist generate

Then build the project

Nonouf commented 6 months ago

Here is a sample project using Tuist 3.35.5, Xcode 15.2 and Swift 5.9 : https://github.com/Nonouf/TestTuistFirebase

You should just be able to open the workspace and build.

paulb777 commented 6 months ago

Thanks for the repro, but the workspace doesn't build for me:

Screenshot 2024-02-29 at 7 12 21 AM

Looks like several things are missing from the xcworkspace:

Screenshot 2024-02-29 at 7 13 31 AM

Is there a Tuist issue report? Give this has only been reported by Tuist users, it is almost certainly an issue with the Tuist build system.

shreyash-sharechat commented 6 months ago

@paulb777 You are missing dependancies. You either run following in terminal from the root of repo:

tuist fetch
tuist generate

or @Nonouf should push whole repo without .gitignoreed dependencies folder for Tuist

Also, tuist is not really a build system, it's just project configurator, builds are run by vanilla xcodebuild system only.

Nonouf commented 6 months ago

@paulb777 Yes indeed. As @shreyash-sharechat said, it's just the dependencies that are missing. I forgot the gitignore. It'll be up to date shortly.

The more I look at the problem, the more it looks like a Tuist issue indeed. I'll forward the issue to the Tuist team if needed. There has been a lot of big changes there very recently with a new major version.

shreyash-sharechat commented 6 months ago

There has been a lot of big changes there very recently with a new major version.

Though it should all be backwords compatible, because we never updated tuist here. Still running 3.17.0 from couple of years back.

JohnnyTseng commented 6 months ago

Folks having issue with Tuist should try upgrade to Tuist 4 according to this: https://github.com/tuist/tuist/issues/6036#issuecomment-1980849357