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
Packages don't update to latest commit / Package repo fails to update #563
Comments
+1 I think I had issues related to something this feature could fix. During deployment some servers failed to checkout the correct commit object (Git) |
+1 I got exactly the same issue as Dynom has. |
It's unfortunately not easy to fix, because it would mean we should check the git repo for changes before even running the solver, just to know if your master is up to date with the real master. Alternatively we just update packages with such references if they are already installed. So every time you'd run update, it would update this package to master, no matter if there are new commits or not. It would look awkward IMO and would not feel like the other packages. |
I believe how Bundler/Librarian handle this is to store the commit hash in the lockfile whereas Composer is currently storing a branch reference in I believe this would also help deal with #448 If we store the hash, then we can do some cool stuff with Related to storing hashes in lockfiles, you can quickly see how other package managers are doing this by searching their repos with //cc @yfeldblum @RobLoach EDIT: I've since realized that npm doesn't actually do any dependency resolution, and instead recursively stores every version of a required module at each level. It was relayed to me that this has something to do with not really caring about loading everything into memory in JS like you would in another language. So while NPM is the only outlier, it's for good reason, and we likely want to follow the lead of other package managers that actually do dependency resolution. |
There are two issues there, the lock file in one thing, and indeed we could just read the commit hash when locking instead of locking what is in source-reference (at the moment it already does that to get the commit date in case the reference becomes invalid). The other issue is a bit trickier, and it is that of managing updates. The best way is really to add a pass between the solver and the execution of the operations that forces those packages to update if they're not being modified, but only if they have new commits. This means a git fetch every time for every package, which isn't always too fast, but I guess it's doable. |
Thanks man.
So you mean adding a
Would it not be quicker to compare |
Hi was any progress made on this? Could really do with it. |
👍 I got exactly the same issue, does not resolved yet? I've tried using "@dev" but don't work... :( |
Same issue. Composer version 1.0-dev (79ac2ca) 2016-02-04 12:40:23 I even tried:
|
I copy the commit hash and paste it on the lock as a workaround. It works as further updates also don't change de commit. |
Bringing this issue up, because this truly rustles my jimmies. I accept that Composer will never work like you'd hope it work; e.g. dev-master always checking the actual master and then checking out the latest commit. But when you have a package at packagist.org, which is autoupdated when a commit is pushed into the package repository, and you can see the commit hash change, it's infuriating to see Composer report with "Nothing to install or update" when running This is a massive UX problem, and causes hate against Composer because it's unintuitive when you compare it to other package managers such as npm. 5 out of 5 people that I've introduced to Composer hate it because of reasons like this. I'm not kidding. It's pretty hard to get them to adopt it after they hate it. The problem could be easily mitigated by extending the response of The other issue that I'd like to mention; Getting a minimum stability error when trying to install a package is infuriating, as it doesn't even tell you what to do. Instead you're meant to read the docs and google the error message with correct keywords to get a solution. You can rinse and repeat this for just about any error :') |
I've bumped into this a couple of times and was scratching my head as to why it worked on some of my repos and not others. I've noticed that in the repos where it works "as expected", I have the following configuration on my
I suppose when that's the case the behavior for composer to pull the sources is slightly different (ie: it doesn't |
@k1sul1 @robertoandrade if you can describe a bit more what you mean, or possibly give a way to reproduce this, I'd be curious. As far as I know updates to a dev-master version work perfectly fine. Is the problem when you did a git checkout of some other branch inside the vendor dir? Or doing a simple update is not updating? |
If I have dev-master spesified as the version on a subpackage I'm working on, I expect Ofc, I could've used |
@k1sul1 ok, that sounds very odd.. How is your "subpackage" loaded, is it on packagist? path repo? vcs repo? If you can make a repro case of this somehow I'd be curious to see, because as far as I can tell it works. |
It was on packagist, yeah. I tried using VCS once, stopped using it immediately because it was too slow on updates. I wanted symlink-like behaviour instead of waiting minutes. Packagist gave me that. I used to develop an actual project in a virtual machine, and the dependency of the project in another VM, so actual symlinking wouldn't have been possible. When you say "as far as I can tell it works", do you mean it works with 2.0, or should it work with 1.x too? Only PHP development I do these days is WordPress, and before the set of plugins required to use WordPress with Composer is updated for 2.0, I can't test & verify it myself. Here's one of my packages: https://github.com/libreform/libreform If you were to require it with |
Ok yeah I have a hard time believing this sorry :D I am 100% sure that works for me, already in v1. It might take a minute or two for the metadata update to happen (that is a bit faster for composer 2), but otherwise it should absolutely work. |
@rdohms can you check if still reproducible? It looks like Composer will now update package correctly if required as dev-master (via Packagist).
e.g.
(shows newer commit hash)
|
@sypets I just stumbled over (something like) this as well: trying to update a custom dev-master package dependency:
|
Closing this here as I really don't see what to do about it. If someone can still reproduce this, please reach out to me before changing anything and then maybe I can inspect things on packagist.org. |
Not sure if this is still relevant, but I am able to reproduce this issue right now using latest Composer version. It sees Also if I run it without the hash afterwards it actually downgrades it back to
|
I had the same while trying to get the latest commit of PrintNote Same Composer version, cleared cache and all that stuff. but didnt work. passing the commit hash worked |
Same issue. |
@xtfer if you don't provide details (package name, reference you get and reference expected at least) this is really not something we can look at.. |
@Seldaek If it helps, my installed version of Running
But the package isn't updated after running either
|
@jrrdnx Please share your |
3.3.3 changed two dependencies to new major versions.. So I think probably you just need to run |
Thanks @Seldaek, it is due to those major version changes. |
When declaring packages inside the compose.json file, if reference points to
master
then running updates does not check out the latest commit in the master branch.Expected behaviour:
Composer should see that branch is master and check if commit hash is the same as HEAD, if not it should checkout head.
Actual behaviour:
Composer sees that branch is master and ignores the rest.
Temporary workaround is to add the actual commit hash into the reference field, which gets the desired outcome but add overhead in updating.
Ideally reference should also accept dev-master as code for always getting the latest commit, or simply update to latest commit in everything but tags.
The text was updated successfully, but these errors were encountered: