composer / satis

Simple static Composer repository generator - For a full private Composer repo use Private Packagist
MIT License
3.15k stars 519 forks source link

with require-all satis will include repositories from ~/.composer/config.json.. #191

Open ppetermann opened 10 years ago

ppetermann commented 10 years ago

I just run satis on a satis.json file which looks similar to this:

{
    "name": "My Repository",
    "homepage": "https://satis.somehost.com",
    "repositories": [
        { "type": "vcs", "url": "git@myowngit1host" }
    ],
    "require-all": true,
    "output-dir": "/tmp/satis-output"
}

as it turns out, satis included all packages from "git@myowngit2host" - which is only configured and referenced in my ~/.composer/config.json

i would have expected satis to stick to the repositories that are referenced in the satis.json config?

Seldaek commented 10 years ago

Yet another satis bug https://toranproxy.com doesn't have, in case you're interested in moving over.. Less time spent here and more time spent on composer is always a win :p

As a workaround I guess you can override COMPOSER_HOME when running satis so it doesn't load the global config..

emlynwest commented 9 years ago

I am also having this issue and having a look into it to see what I can come up with. What is odd is that I can reproduce it on my package server that currently runs php 5.3, while on my dev machine I am unable to reproduce it, running PHP 5.5.

@ppetermann What version of PHP are you running? I am going to try updating PHP on my server and see if that makes any difference.

Also setting my COMPOSER_HOME before running does not make any difference, in both my cases both are set as blank by default anyway.

emlynwest commented 9 years ago

After updating to PHP 5.5 and making sure my composer is up to date the problem seems to have gone away, I am now no longer seeing the satis repo listed with my packages on my package server.

@ppetermann, I'd recommend making sure everything is up to date and then trying again.

ppetermann commented 9 years ago

Nope, been on 5.5 then, and am on 5.5 now.

emlynwest commented 9 years ago

No, you are right. I am not quite sure what is going on. When I run the update manually the the satis repo gets included from the cache but running as a script via a git hook works fine so I now wonder what the difference in environment is there, I don't know enough about satis/composer to say.

ppetermann commented 9 years ago

Just a guess, but isn't your hook maybe in a repo owned by a different user? Like on most setups that would be "git"?

emlynwest commented 9 years ago

Yes, it does run under a different user but I also installed satis with that user and there is also a composer cache with the user as well.

ppetermann commented 9 years ago

Does it have the same configuration too? It's the configured private repo that's the cause, not the cache

emlynwest commented 9 years ago

Yep, the exact same.

glynnforrest commented 9 years ago

I encountered this issue today, and managed to solve it by running satis like this:

export COMPOSER_HOME=$(pwd); ./path/to/bin/satis build satis.json web

Obviously, you can replace $(pwd) with anything that's not ~/.composer.