NativeScript / NativeScript/nativescript-cli

plugin cocoapod installation is non-deterministic

Ouverte
#4,551 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

CocoaPods feature os: ios
Langage dominant
JavaScript
Étoiles
1.1k
Forks
204
Merge moyen
1 j 9 h
PR mergées (30 j)
8

Description

Environment
TNS 5.3.1

Describe the bug
Modern package managers give us not just the ability to install dependencies, but more critically to install dependencies deterministically. That is to say: the exact same dependencies, will be installed the exact same way, every time. No matter when the install happens.

The most common way they achieve this is by maintaining a "lock" file which contains a manifest of resolved dependencies for a given set of primary version constraints. Once checked into source control, all other environments can use the lock file to download and install the exact same set of dependencies every time. yarn, bundler, cargo, npm all have lockfiles because this is so important.

This critical dependency management feature is also available with Cocoapods. It has a lockfile called Podfile.lock. However, because of the way that pod plugins work, it appears is not captured in source control (instead it's plopped into platforms/ios which is git ignored), and so cannot be used to reliably re-create a build from source.

Some of the consequences of this:

  • non-deterministic builds.
    • you might get a a different version of a cocoapod for production than you had when you ran your tests.
    • subtle bugs that are only reproducible in unique environments as developers install their dependencies at different times and end up with slightly differing versions of a cocoapod.
  • difficulty in automation: In your CI environment, you always end up caching a set of dependencies that are fetched over the network, so that it will be faster, and also function in the absence of the repository service. To do that, you need a unique key, against which to store your cache. For package managers, this is the lock file. See Yarn caching on circleCI for an example. This is impossible without Podfile.lock

Expected behavior

Building a nativescript application from source always pulls the same set of dependencies, both from NPM and also from CocoaPods.

It seems to me that the simplest solution would be to maintain the Podfile somewhere in the project structure. Either in App_Resources/iOS or a version controlled platforms/ios

When a pod plugin is installed, it is ok, if it updates the Podfile to include its dependency, but then both the Podfile and the resulting Podfile.lock should be store in source control so that every developer, every CI environment, and ultimately every user, gets the same set of cocoapods every single time for a give version of the app in git.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Aucun fichier, test ou point d’entrée n’est indiqué. Commencez par suivre l’installation du plugin et le processus de build iOS, puis déterminez où Podfile et Podfile.lock doivent se trouver ; le travail est terminé lorsqu’un checkout des sources installe de manière reproductible les mêmes dépendances CocoaPods dans les builds locaux et CI.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
ios, javascript
Domaine
build-system, cli, mobile-dev
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.