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

Packagist install with older versions fails #1888

Closed
dvmanjunathdv opened this issue Feb 8, 2021 · 14 comments
Closed

Packagist install with older versions fails #1888

dvmanjunathdv opened this issue Feb 8, 2021 · 14 comments

Comments

@dvmanjunathdv
Copy link

Installing enyo/dropzone (5.3.0): Cloning origin/master from cache
origin/master is gone (history was rewritten?)

[RuntimeException]
Failed to execute git checkout 'origin/master' -- && git reset --hard 'origin/master' --

fatal: invalid reference: origin/master

facing this issue from from today

@dsmink
Copy link

dsmink commented Feb 8, 2021

@dvmanjunathdv Change the line:

From:
"reference": "origin/master"

To:
"reference": "origin/main"

For this package in the "repositories" section of you composer.json and run:
composer update enyo/dropzone

They changed the name of the 'master' branch to 'main'.

The whole world has gone nuts and we pay the price.

@enyo
Copy link
Collaborator

enyo commented Feb 8, 2021

If you're talking about composer (and packagist) then the source is now in dropzone/dropzone-packagist (master branch).

Don't simply correct it to main. They will not contain the dist files.

@enyo
Copy link
Collaborator

enyo commented Feb 8, 2021

There is apparently a missing config somewhere to tell packagist that this is the new source of truth (although I set up this project in the settings). If anyone could help out I'd be thankful.

@fjgarlin
Copy link

fjgarlin commented Feb 8, 2021

Is there a plan to rename the dropzone-packagist master branch to main too? Asking to make sure that once we change it to the packagist version is going to stay stable. We have this package included in a good number of projects.

@enyo
Copy link
Collaborator

enyo commented Feb 8, 2021

Is there a plan to rename the dropzone-packagist master branch to main too? Asking to make sure that once we change it to the packagist version is going to stay stable. We have this package included in a good number of projects.

No I'll leave that. It's really just a dump for the compiled files, since packagist doesn't offer any other way to distribute the files and I don't want compiled files in my main repo (I've been getting plenty of PRs changing them, and I think they simply should not be checked in).

@dvmanjunathdv
Copy link
Author

dvmanjunathdv commented Feb 8, 2021

packagist

Yes i'm talking about composer. composer is failing to clone origin master. Please find the below composer json code.

{ "type": "package", "package": { "name": "enyo/dropzone", "version": "5.3.0", "type": "drupal-library", "source": { "url": "https://github.com/enyo/dropzone", "type": "git", "reference": "origin/master" } } },

@fjgarlin
Copy link

fjgarlin commented Feb 8, 2021

@dvmanjunathdv you should be able to change https://github.com/enyo/dropzone for https://github.com/dropzone/dropzone-packagist in the above code and then you can require the package. That should work.

@enyo
Copy link
Collaborator

enyo commented Feb 8, 2021

Ah yes... I see. @fjgarlin is right in theory, but if you're targeting older versions then this probably will fail as well. Please upgrade to v5.7.5 if that's possible for you.

@enyo
Copy link
Collaborator

enyo commented Feb 8, 2021

Solution

Ok, so everybody who gets this issue please upgrade to v5.7.5! I'm sorry this happened, and I'm trying to get older versions back working.

If someone with a better understanding of packagist could help me out here, it would be very welcome.

@enyo enyo changed the title fatal: invalid reference: origin/master : Failed to execute git checkout 'origin/master' -- && git reset --hard 'origin/master' Packagist install with older versions fails Feb 8, 2021
@dvmanjunathdv
Copy link
Author

Thanks @fjgarlin @enyo, i will change packagist and upgrade it latest.

@dsmink
Copy link

dsmink commented Feb 9, 2021

@enyo

For Drupal 8 is it safe to remove the "repository" part in composer.json?

{ "type": "package", "package": { "name": "enyo/dropzone", "version": "dev-master", "type": "drupal-library", "source": { "url": "https://github.com/enyo/dropzone.git", "type": "git", "reference": "origin/master" } } }

@fjgarlin
Copy link

fjgarlin commented Feb 9, 2021

@dsmink - then the library would be placed in the vendor folder instead of the libraries one I believe. That's what "type": "drupal-library" does and probably the only reason why it needs to be in the list of the repositories.

@enyo
Copy link
Collaborator

enyo commented Feb 9, 2021

Thanks for helping out @fjgarlin

@enyo
Copy link
Collaborator

enyo commented Feb 9, 2021

I'm closing this for now, since I think all use cases are solved. I'm pinning it though so it's easy to find since I expect a few people running into this problem unfortunately.

Again, I'm sorry this happened. There are so many package managers depending on this project that it's hard to make big changes without breaking a few things.

@enyo enyo closed this as completed Feb 9, 2021
@enyo enyo pinned this issue Feb 9, 2021
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

4 participants