apache / apache/cordova-node-xcode

addFramework uses incorrect path for Swift libraries

Đang mở
#114 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
217
Fork
102
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
6

Mô tả

The default path used in the `PBXFileReference` for frameworks with `.tbd` extensions is `/usr/lib`. However, I believe that Swift libraries with the same extension needs to have the path `/usr/lib/swift`.

For example, if you use `addFramework` to add `libswiftAVFoundation.tbd` it produces the following `PBXFileReference` in the project file:
```
27874A9BBF2444AABA64E8E0 /* libswiftAVFoundation.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libswiftAVFoundation.tbd; path = usr/lib/libswiftAVFoundation.tbd; sourceTree = SDKROOT; };
```
This will ultimately result in a Crash on iOS versions 12.1 or lower, before the Swift runtime was bundled with the OS.

If you add the library manually in Xcode, the project file has the following `PBXFileReference' added:
```
5DBEA893249434B30034407A /* libswiftAVFoundation.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libswiftAVFoundation.tbd; path = usr/lib/swift/libswiftAVFoundation.tbd; sourceTree = SDKROOT; };
```
Note the path difference:
cordova-node-xcode: usr/lib/libswiftAVFoundation.tbd
Xcode: usr/lib/swift/libswiftAVFoundation.tbd

I have an experimental patch [here](https://github.com/jskrepnek/cordova-node-xcode/commit/ebca1c14c11b5897d12e2829f4cd592d00f89d6b) to work around this.

Assuming I'm on the right track here, I'll submit a pull request but I'm hoping that the maintainers can recommend if the approach I used is acceptable or if there's a more effective way to select the correct default path for these libraries than introducing another option.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start at the addFramework entry point and compare its PBXFileReference path handling with the experimental patch linked in the issue. Reproduce the libswiftAVFoundation.tbd example and confirm that Swift libraries use usr/lib/swift while other frameworks retain their expected paths.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, nodejs
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
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
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.