NativeScript / NativeScript/nativescript-cli
plugin cocoapod installation is non-deterministic
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.1k
- Fork
- 204
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 8
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Không có tệp, bài kiểm thử hoặc điểm vào nào được nêu. Hãy bắt đầu bằng cách lần theo quá trình cài đặt plugin và đường dẫn build iOS, sau đó xác định Podfile và Podfile.lock nên nằm ở đâu; công việc được xem là hoàn tất khi một source checkout cài đặt có thể tái lập cùng một bộ dependency CocoaPods trong các bản build cục bộ và CI.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- ios, javascript
- Lĩnh vực
- build-system, cli, mobile-dev
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100