Giter Club home page Giter Club logo

Comments (17)

chEbba avatar chEbba commented on May 10, 2024

Added a prototype of cached downloads #62

from composer.

chEbba avatar chEbba commented on May 10, 2024

Any comments for prototype? Need some discussion to finish with this necessary feature

from composer.

CodeOtter avatar CodeOtter commented on May 10, 2024

And how does this cache know when to expire upon a package being changed?

from composer.

stof avatar stof commented on May 10, 2024

@CodeOtter If the commit reference is the same, it cannot be a different code. A package being changed means a different version number or a different reference for the branch, and they are used when generating the cache file name.

from composer.

CodeOtter avatar CodeOtter commented on May 10, 2024

Hrmm... so that means I have to make a brand new tag for every single code change, even in development?

from composer.

stof avatar stof commented on May 10, 2024

@CodeOtter No you don't. The reference for branches is the commit sha, which changes when you do a code change. See the dev versions listed on Packagist for instance. They display the reference: https://packagist.org/packages/symfony/symfony

from composer.

cognifloyd avatar cognifloyd commented on May 10, 2024

@Seldaek why was this one closed? Was an alternative solution implemented, or you're just rejecting the request? Does this not fit into the grand architectural vision of composer or something?

from composer.

tristanlins avatar tristanlins commented on May 10, 2024

@cognifloyd doesn't composer already cache downloaded packages? When I run composer, I often have the message "installing from cache", expect for VCS packages.

from composer.

chr0n1x avatar chr0n1x commented on May 10, 2024

@tristanlins That's what I thought too. However, I've only noticed this when installing versions of packages that have releases though (ie: packages that have zip archives associated with them). A quick search in the composer book shows that for git packages, only metadata is downloaded.

from composer.

cognifloyd avatar cognifloyd commented on May 10, 2024

@tristanlins said:

expect for VCS packages.

Exactly. During development, I want to rapidly create a bunch of fresh installations of my package. That means that for every test installation, I'm downloading the entire git repository over the network. That's very inefficient considering (A) I already have a local mirror of the repository, and (B) Composer already downloaded the entire repository 5 (or 50) times on my machine. I want composer to git clone to ~/.composer/[name of repo].git or something, and then just copy from there. Then composer only has to update the one git repo instead of hammering the open source repos that are kindly & generously hosted by one of the companies in the community. Just because someone is kindly hosting something without charging for access, does not give me the right to abuse their services. That's what composer is doing by constantly redownloading (a natural part of development) VCS repos.

from composer.

chr0n1x avatar chr0n1x commented on May 10, 2024

@cognifloyd yeah I definitely would love to see a feature where composer saves an archive of a bare copy of the repository into its cache. It makes sense...I just don't know what the core devs would think about this.

/cc @stof @Seldaek -- any thoughts?

from composer.

Seldaek avatar Seldaek commented on May 10, 2024

There are other issues regarding git caching. Zip caching has been done over a year ago, so I closed this since it didn't add any value. I went through over 300 issues yesterday and didn't really have the nerves to explain everywhere why what and cross-link things.

from composer.

chr0n1x avatar chr0n1x commented on May 10, 2024

@Seldaek I would like an explanation please. Is there an gissue somewhere where you've already explained this that I can read? Not only do I want to understand, I would like to help explain to others (not just on github) why composer does not, or should not, do this.

from composer.

cognifloyd avatar cognifloyd commented on May 10, 2024

Sorry @Seldaek, I didn't remember about the other issue (which I commented on).
Anyway, for posterity here are the relevant issues:
Issue: #1323
PR: #1338

from composer.

Seldaek avatar Seldaek commented on May 10, 2024

@chr0n1x there is an open PR for it, and I think overall it might be good but I never had enough time to try it in depth and complete it. Lots of work, not enough time, but we are getting there slowly.

from composer.

kaystrobach avatar kaystrobach commented on May 10, 2024

i also would prefer to be able to set a global cache path for repos, which is shared across projects to limit the transfered data and the time to build

from composer.

mjonas87 avatar mjonas87 commented on May 10, 2024

Not sure if this is the best place to comment, but it does seem to be the root of my current troubles.

I'm using Composer with Docker, which means I'll only ever be installing packages for this one project. When I run my build, Composer builds a local cache from source of every package (even when --prefer-dist is set). This takes a very long time and often fails due to Github throttling. To make matters worse, because I'm using Docker, this is going to happen every time I rebuild.

My main question is this: Does this caching system trigger additional downloads beyond what would be required for a minimal installation or am I misunderstanding something?

Thanks!

from composer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.