Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendored framework not matched when only file in pod source #95

Open
1 task done
asutula opened this issue Nov 7, 2019 · 2 comments
Open
1 task done

Vendored framework not matched when only file in pod source #95

asutula opened this issue Nov 7, 2019 · 2 comments

Comments

@asutula
Copy link

asutula commented Nov 7, 2019

Report

What did you do?

I created a Podspec that spec.source references a tgz file containing an already-compiled iOS framework. This tgz file is hosted in a GitHub release. I then tried to lint the Podspec.

What did you expect to happen?

I expected the podspec lint to complete successfully.

What happened instead?

The lint failed with:

- ERROR | [iOS] file patterns: The `vendored_frameworks` pattern did not match any file

I tracked this down to a quirk where this error only happens if the .framework directory is the only thing in the spec.source referenced a tgz file. If I touch dummy to create an empty file, add that along with the .framework to a tgz file, and reference that as the spec.source, the podspec passes lint just fine.

CocoaPods Environment

Stack

   CocoaPods : 1.8.4
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.1 (19B88)
       Xcode : 11.1 (11A1027)
         Git : git version 2.21.0 (Apple Git-122)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/aaron/.gem/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.1.0

Project that demonstrates the issue

A "broken" release of the tgz file (containing only the .framework) is located at https://github.com/textileio/grpc-ipfs-lite/releases/download/v0.0.1-rc0/grpc-ipfs-lite_v0.0.1-rc0_ios-framework.tar.gz.

A working release of the tgz file (containing the .framework and an empty dummy file) is located at https://github.com/textileio/grpc-ipfs-lite/releases/download/v0.0.1-rc1/grpc-ipfs-lite_v0.0.1-rc1_ios-framework.tar.gz.

I've attached a zip containing two pod specs, one referencing each of the above tgz files. You can lint each one and see the results.
Archive.zip

@stale
Copy link

stale bot commented Feb 5, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

@amorde
Copy link
Member

amorde commented Feb 5, 2020

Apologies this wasn't ever addressed, but it looks like this was due to the default behavior of flattening certain archive formats (.tar.gz included).

To change this, add :flatten => false to the hash for the source attribute.

Relevant code:

elsif [:tgz, :tar, :tbz, :txz].include?(type)
true # those archives flatten by default

I think this could definitely be improved. Here's the logic that handles flattening - we could check if the only folder is a .framework or something similar

if contents.count == 1 && entry.directory?
tmp_entry = entry.sub_ext("#{entry.extname}.tmp")
begin
FileUtils.move(entry, tmp_entry)
FileUtils.move(tmp_entry.children, target_path)
ensure
FileUtils.remove_entry(tmp_entry)
end

@amorde amorde transferred this issue from CocoaPods/CocoaPods Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants