Uh oh!
There was an error while loading. Please reload this page.
fix(apple): include check if Podfile and Podfile.lock changed when deciding to install Cocoapods - #2443
Conversation
Podfile and Podfile.lock when deciding to install Cocoapods Podfile and Podfile.lock changed when deciding to install Cocoapods szymonrybczak
commented
Jul 3, 2024
cc @tido64, I know that you had some concerns related to this topic. I'd really appreciate your input here what else should we improve to solve your case. |
thymikee
commented
Jul 3, 2024
Can you include some tests please? |
f76df9f to
5d83cdeCompareTMisiukiewicz
commented
Jul 3, 2024
Could you check if it'd be faster to use checksum that is auto-generated inside |
szymonrybczak
commented
Jul 3, 2024
It turns out that hashing file is faster 👀 I've created two simple scripts that checks that: Hashing file scriptconstfs=require('fs');const{ createHash }=require('crypto');functiongenerateMd5Hash(text){returncreateHash('md5').update(text).digest('hex');}asyncfunctionmain(){consthash=generateMd5Hash(fs.readFileSync('_/ios/Podfile.lock','utf8'),);console.log(hash);}main();Reading file and checking checksumconstfs=require('fs');constreadline=require('readline')asyncfunctionmain(){constfileStream=fs.createReadStream('_/ios/Podfile.lock');constrl=readline.createInterface({input: fileStream,crlfDelay: Infinity,});letlines=[];forawait(constlineofrl){lines.push(line);}lines=lines.reverse();for(constlineoflines){if(line.includes('PODFILE CHECKSUM')){console.log(line.split(': ')[1]);}}}main();On fresh project when but I've created an example scenario when |
tido64
commented
Jul 4, 2024
Rather than speed, I think in this case I'd would much prefer that we are consistent with CocoaPods. If it thinks that the manifest needs to be updated, so should we, and vice versa. And I think the only way to ensure that is to reuse the checksum or CocoaPods directly. |
Yeah, so I've added reading checksum after installing Cocoapods, so that new checksum is saved. Together with @TMisiukiewicz we did some investigations and it turns out that there are 3 scenarios with current implementation where we'll run
For 1), 2) I think we could add phase of updating cache values e.g. in post-install hook in For 3) I think it's really edge case-y and supporting this would solve very small amount of cases, or maybe even 0. |
cipolleschi
left a comment
There was a problem hiding this comment.
Small nits, the logic sounds good to me!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
c829229 to
5abea6eCompareThere hasn't been any activity on this pull request in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
…o install Cocoapods
Co-authored-by: Riccardo Cipolleschi <riccardo.cipolleschi@gmail.com>
bc02e8e to
262836eCompare
Summary:
Comparing only
dependenciesfield fromconfig's command output takes into account only autolinked dependencies, however users can add manually Pods insidePodfile, in this Pull Request I added validating hash forPodfileandPodfile.lock.Test Plan:
react-native.config.jsand enable automaticPodsInstallationPodfileorPodfile.lockcontent changes installation of Cocoapods should be triggeredChecklist