NativeScript / NativeScript/nativescript-cli

plugin cocoapod installation is non-deterministic

未关闭
#4,551 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

CocoaPods feature os: ios
主要语言
JavaScript
星标
1.1k
派生
204
平均合并
1 天 9 小时
30 天内合并 PR
8

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定文件、测试或入口点。先跟踪插件安装和 iOS 构建路径,然后确定 Podfile 和 Podfile.lock 应该放在哪里;当源代码检出能够在本地和 CI 构建中以可复现的方式安装相同的 CocoaPods 依赖项时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
ios, javascript
领域
build-system, cli, mobile-dev
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。