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

cordova-fetch is much slower at prepare #52

Closed
ekrapfl opened this issue Oct 11, 2018 · 26 comments
Closed

cordova-fetch is much slower at prepare #52

ekrapfl opened this issue Oct 11, 2018 · 26 comments

Comments

@ekrapfl
Copy link

ekrapfl commented Oct 11, 2018

It would appear that when I run a cordova prepare using cordova-fetch, it takes drastically longer than when I run it without cordova-fetch.

I have tested this on a repo with no platforms or plugins present in the directory structure, and about 20 plugins and 2 platforms defined in the package.json.

Using cordova 6.5, cordova prepare runs in about 30 seconds to add the platforms and plugins.
Using cordova 7, cordova prepare --nofetch takes about the same amount of time.
Using cordova 7, cordova prepare takes about somewhere around 5 minutes.
Using cordova 8, cordova prepare takes about the same amount of time as cordova 7 with the fetch.

Is this a known issue? This is a pretty painful amount of time to have to wait for a clean build. It causes builds on our build server to bloat quite significantly.

Any help would be appreciated.
Thanks!

@dpogue
Copy link
Member

dpogue commented Oct 11, 2018

This is a known issue. The good news is that it will be fixed in Cordova 9, the bad news is that Cordova 9 isn't ready to be released yet.

@dpogue dpogue closed this as completed Oct 11, 2018
@ekrapfl
Copy link
Author

ekrapfl commented Oct 11, 2018

Dumb question. Is there any sort of time frame for Cordova 9 at this point?

@dpogue
Copy link
Member

dpogue commented Oct 11, 2018

I don't want to make any sort of official sounding statement that could be interpreted as committing to a date 😅
I know all of us working on it would like to see it released before the end of the year.

@ekrapfl
Copy link
Author

ekrapfl commented Oct 11, 2018

I won't hold you to the fire 😀. We all cringe when asked for a "release date".

@galsc-tr
Copy link

galsc-tr commented Jan 6, 2019

@dpogue, is there any updates on this issue?

@phyr0s
Copy link

phyr0s commented Jan 11, 2019

In my app more than 30 minutes to donwload all the plugins, this is a big trouble

@rricamar
Copy link

@videmort totally agree, do some builds in a CI environment is so painful 🔥

@manudefrutosvila
Copy link

@videmort you so true, i can take a nap while reinstalling the cordova plugins

@phyr0s
Copy link

phyr0s commented Jan 16, 2019

@manudefrutosvila you can take 2-3 nap per day.
The proof @dpogue (Run on mac PRO top specs)
captura de pantalla 2019-01-16 a las 15 12 37

@dpogue
Copy link
Member

dpogue commented Jan 16, 2019

Yes, we are aware. This affects all of my CI builds too.

The issue has been fixed and released as cordova-fetch 2.0.0. We're in the process of doing a major version release for all the platforms and tooling which will pull in this updated version.

@galsc-tr
Copy link

@dpogue, is there an ETA when the new version will be released?

@galsc-tr
Copy link

Hi,

Seems like new major Cordova-Android and Cordova-iOS were released (https://cordova.apache.org/announcements/2019/02/16/cordova-android-release-8.0.0.html,
https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html)

Is the problem resolved ?

@janpio
Copy link
Member

janpio commented Feb 18, 2019

afaik those are only the platforms fetched by cordova-fetch.
you'll have to wait a bit longer until codova cli 9 is released.

@galsc-tr
Copy link

@janpio any eta when cli 9 will be released?

@janpio
Copy link
Member

janpio commented Feb 18, 2019

As soon as it's ready. The Android and iOS releases where some of the last "big" releases, so we are definitely talking more weeks than months.

@phyr0s
Copy link

phyr0s commented Mar 14, 2019

Any news?

@janpio
Copy link
Member

janpio commented Mar 14, 2019

@ekrapfl
Copy link
Author

ekrapfl commented Mar 25, 2019

Very close now:
apache/cordova#10 (comment)
Just waiting on the plugins to be updated at this point.

@dpogue
Copy link
Member

dpogue commented Mar 25, 2019

This has been released as part of Cordova 9. Please try installing cordova@9.0.0 from npm.

@ekrapfl
Copy link
Author

ekrapfl commented Mar 25, 2019

The prepare is wicked fast with cordova@9.0.0, but I am unable to take advantage at the moment because we require a plugin to be updated as well. Looking great, though!

@bytenik
Copy link

bytenik commented Mar 26, 2019

Prepare is no faster for me on 9.0.0 than on 8.x. Is there something additional I need to do to see the increased speed?

@ekrapfl
Copy link
Author

ekrapfl commented Mar 26, 2019

That is odd. Just updating to cordova@9.0.0 took our prepare from 10-15 minutes down to 10-15 seconds. Dumb question, did you make sure you updated the globally installed cordova if you have one (or locally installed, if that is what you use)?

@bytenik
Copy link

bytenik commented Mar 26, 2019

I did not install globally, but, I did execute npx cordova prepare android. npx should cause it to use the local copy.

I wouldn't expect 10-15 seconds as I am doing a full restore prepare (incl. fetch) -- I started with no platforms or plugins directories. But, it also shouldn't take 3-5 mins per plugin.

@ekrapfl
Copy link
Author

ekrapfl commented Mar 26, 2019

Yeah, when switching over to cordova@9.0.0, I am literally seeing 10-15 seconds for the full prepare. Nuking platforms and plugins, the only thing I have done is an npm install. I'm not sure why you are not seeing that improvement.

@dpogue
Copy link
Member

dpogue commented Mar 26, 2019

If you did not run npm install, cordova-fetch still has to install plugins one at a time. If you ran npm install and already have a node_modules folder, cordova-fetch will check that the installed version meets the criteria and then use it.

Plugins being installed from git URLs need to be fetched every time, because npm doesn't give us a good way to verify that it's the correct commit.

@hoshauch
Copy link

It's really fast now, thx!

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

9 participants