-
Notifications
You must be signed in to change notification settings - Fork 70
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
Local cache directory? #31
Comments
Hi @danielbowden Thanks for reaching out! I think this is an eligible request. It is also helpful for the integration tests of this repo as it currently depends on a personal git repo. To minimize significant changes, here are my proposed changes:
--- cache_dir / --- GeneratedFrameworks / --- FrameworkA.zip
| |--- FrameworkB.zip
|
| --- Manifest.lock We'll discuss this and proceed with the next step. Thanks! |
Hi @trinhngocthuyen, thanks for the quick reply! That sounds like a solution that would work. For my understanding with this change how would you expect a typical workflow to go / commands to run for these scenarios:
Would you still call fetch and push commands even though their source would be local? Or would you likely just use I'm a big fan of Grab by the way! I've used it a lot in Malaysia, Singapore and Indonesia 🙂 |
There are 2 main workflows using with this plugin:
bundle exec pod binary prebuild [--push]
With the proposed change I mentioned earlier, the CLI for (W1) and (W2) remains the same.
|
Ok thanks for clarifying. Sounds like a good plan. If I were to Developer 1's steps would be
Now Developer 2 comes along, clones project and can just build and run? Without running any specific commands. Later when they want to contribute new dependencies or update existing ones they can learn the above workflow. Thanks again for your help, and the efforts put into the plugin. |
With the scenario you mentioned, you just don't need to care about the cache store despite its existence :). Aslso, by default, the prebuild sandbox
|
To summarize, the change needed in the plugin is:
|
Thanks @trinhngocthuyen those changes sound like they would cover it. You got me thinking about your workflow. With a remote cache (or even a local cache moving forward) What do you checkin (if anything) to source control from your main project's Pods directory? And in the case of moving from Xcode 11.7 to Xcode 12/Swift 5.3 do you do a complete rebuild of all your frameworks as part of your Xcode migration and push up the new prebuilt files to replace the old? |
Following is our setup:
|
Hi @danielbowden, kindly check out version 0.1.11 for this support. Sample configuration: config_cocoapods_binary_cache(
cache_repo: {
"default" => {
"local" => "<path/to/cache/dir>" # <--- HERE
}
}
) Thanks! |
Hi @trinhngocthuyen thank you for following up with this feature so quickly, local only support is great and I hope others benefit from it too. I've had a look at the changes and I'm keen to give it a try. I have just tried to integrate it with our project but ran into a few issues. I could very much be using it incorrectly though I apologise.
> Copying /Users/danielbowden/myprojectxxx/_Prebuild/Realm/include/RLMCollection.h
> Copying /Users/danielbowden/myprojectxxx/_Prebuild/Realm/include/RLMArray.h
> Copying /Users/danielbowden/myprojectxxx/_Prebuild/Realm/include/NSError+RLMSync.h
> Compiling work_queue.cpp
> Compiling uuid.cpp
[x] /Users/danielbowden/myprojectxxx/_Prebuild/Realm/Realm/ObjectStore/src/util/uuid.cpp:19:10: 'util/uuid.hpp' file not found
#include "util/uuid.hpp"
^~~~~~~~~~~~~~~
> Compiling weak_realm_notifier.cpp
[x] /Users/danielbowden/myprojectxxx/_Prebuild/Realm/Realm/ObjectStore/src/impl/weak_realm_notifier.cpp:19:10: 'impl/weak_realm_notifier.hpp' file not found
#include "impl/weak_realm_notifier.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Compiling transact_log_handler.cpp
[x] /Users/danielbowden/myprojectxxx/_Prebuild/Realm/Realm/ObjectStore/src/impl/transact_log_handler.cpp:19:10: 'impl/transact_log_handler.hpp' file not found
#include "impl/transact_log_handler.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Compiling thread_safe_reference.cpp
[x] /Users/danielbowden/myprojectxxx/_Prebuild/Realm/Realm/ObjectStore/src/thread_safe_reference.cpp:19:10: 'thread_safe_reference.hpp' file not found
#include "thread_safe_reference.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
> Compiling system_configuration.cpp
> Compiling sync_user.cpp
> Compiling sync_session.cpp
...
### Error
RuntimeError - Fail to build targets
I'm sorry, am I missing a step in getting this working? This doesn't seem like it would be related to your local cache change. On a side note, I noticed in another issue reply that you only build for Debug config to speed up development and do not use this plugin when building for Release. Does that mean it is only possible to specify one |
Hi @danielbowden, Thank you for the detailed report & for trying out many scenarios to see the pattern. We really appreciate it. From what you reported, there are two highlighted issues:
This is what I tried on a demo project (kindly refer to https://github.com/trinhngocthuyen/troubleshoot-pod-bin-cache/tree/78479e5/issue-31)
Thank you! |
Hi @trinhngocthuyen, Thanks so much for the thorough troubleshooting and the example project. Interestingly I grabbed your example project and ran your In that example project I now I have 3 generated frameworks (AppAuth, Realm and RealmSwift) in _Prebuild and local cache. So I'm not sure why we both experienced problems with Realm before? This is running: I will give it another go with our proper project and see how it goes. One last question, is it possible to do something like this (or similar syntax)? config_cocoapods_binary_cache(
cache_repo: {
"default" => {
"local" => "Support/cocoapods-binary-cache-debug",
"prebuild_config" => "Debug"
},
"release" => {
"local" => "Support/cocoapods-binary-cache-release",
"prebuild_config" => "Release"
},
}
) I noticed in another issue reply that you only build for Debug config to speed up development and do not use this plugin when building for Release. I saw you use a IS_POD_BINARY_CACHE_ENABLED env var, I assume you do not set this for your release builds? |
1/ As per my testing with Realm, the issue about non-modular header import happens with Xcode 11. Although it's working fine with Xcode 12, I haven't really understood the root cause and hence suggested a workaround for Xcode prior to 12.0. 2/ About the syntax of config_cocoapods_binary_cache(
...
prebuild_config: ENV["PREBUILD_CONFIG"] || "Debug"
) However, this structure you suggested makes much sense as it fits the use cases of multiple cache storage. 3/ About whether to use this plugin for Release for not: Anw, it's up to you to design the setup that fits the project. |
Hi, great plugin! I have been using cocoapods-binary but just discovered this and it looks much more active.
I have a quick question. Our project currently uses git-lfs to store the large files/frameworks in our project.
Is it at all possible configure
cocoapods-binary-cache
to continue to use a local directory inside our repo instead of the separate git repo? Or even jut continue to use the_Prebuild
directory? That way we do not have to fetch. We would like our project to continue to be able to be "cloned and run" without needing further steps, network, and user permissions to another repo.I was hoping to maintain our workflow of just pre-building the desired pods and storing them locally as git-lfs automatically handles and uploads these large files.
I tried configuring the
cache_repo
config hash to just have a local key and not remote however did not have much luck.Thanks,
Daniel
The text was updated successfully, but these errors were encountered: