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

Composer pull dependency from another branch on the same repo #7485

Closed
crmpicco opened this issue Jul 24, 2018 · 5 comments
Closed

Composer pull dependency from another branch on the same repo #7485

crmpicco opened this issue Jul 24, 2018 · 5 comments
Labels

Comments

@crmpicco
Copy link

My composer.json:

"require": {
    "CRMPicco/GolfBundle": "dev-golf-bundle"
},
"repositories": [
   {
       "type": "git",
       "url": "git@git.crmpicco.com:frontend/app.git"
   }
],

Output of composer diagnose:

Checking composer.json: WARNING
The package "excelwebzone/recaptcha-bundle" is pointing to a commit-ref, this is bad practice and can cause unforeseen issues.
The package "craue/config-bundle" is pointing to a commit-ref, this is bad practice and can cause unforeseen issues.
Defining autoload.psr-0 with an empty namespace prefix is a bad idea for performance
require.plivo/plivo-php : exact version constraints (v1.1.5) should be avoided if the package follows semantic versioning
require.slot/mandrill-bundle : exact version constraints (v1.0.10) should be avoided if the package follows semantic versioning
require.excelwebzone/recaptcha-bundle : unbound version constraints (dev-master#5a17115) should be avoided
require.craue/config-bundle : unbound version constraints (dev-master#0c662d8b9af5) should be avoided
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.6.5
PHP version: 7.0.30-1+ubuntu16.04.1+deb.sury.org+1
PHP binary path: /usr/bin/php7.0

When I run this command:

composer clear-cache
composer dump-autoload --optimize
composer update CRMPicco/GolfBundle

I get the following output:

    Your requirements could not be resolved to an installable set of packages.

    Problem 1 - The requested package crmpicco/golfbundle dev-golf-bundle exists as CRMPicco/GolfBundle[dev-master] but these are rejected by your constraint.

And I expected this to happen:

On the origin of git.crmpicco.com:frontend/app.git there exists the main branch of master and also a golf-bundle branch. I want to have the contents of the golf-bundle branch as a composer dependency in the /vendor directory.

How can I configure composer to pull from the "golf-bundle" branch?

@Seldaek
Copy link
Member

Seldaek commented Jul 24, 2018

Please run composer update CRMPicco/GolfBundle -vvv and paste the full output.

@crmpicco
Copy link
Author

@Seldaek Here it is: https://gist.github.com/crmpicco/e792c274dbc465794941138d615c2bc8

My composer.json from the golf-bundle branch:

{
  "name": "CRMPicco/GolfBundle",
  "type": "library",
  "require": {
    "php": ">=7.0",
    "symfony/config": "~2.8.34",
    "symfony/dependency-injection": "~2.8.34",
    "symfony/http-kernel": "~2.8.34",
    "chargebee/chargebee-php": "^2.0"
  },
  "autoload": {
    "psr-4": {
      "CRMPicco\\GolfBundle\\": ""
    }
  },
  "extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "symfony-assets-install": "relative"
  }
}

@Seldaek
Copy link
Member

Seldaek commented Jul 25, 2018

I don't understand where CRMPicco/GolfBundle is supposed to be loaded from. There is no golf bundle repository being loaded it seems from your log.

@crmpicco
Copy link
Author

@Seldaek Yes, sorry it is there but I believe this issue was caused by me moving things around and keeping the same name. I previously had CRMPicco/GolfBundle as a package being pulled in from another private repository. However, when I moved it into a branch within the same repo my composer.lock was still referencing the private repository dependency which required dev-master and not dev-golf-bundle as I had subsequently specified.

I cleared all composer cache, however I couldn't find a good workaround for it and ran out of patience. 🤣

What is your advice on how to tackle this?

@Seldaek
Copy link
Member

Seldaek commented Jul 26, 2018

Sorry but I don't understand what you are doing.. Maybe if you write in more details what your setup looks like right now, where you are running composer, share composer.json etc, but as is I have no clue how to help.

@Seldaek Seldaek closed this as completed Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants