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

Failed to fetch/configure distribution maintained in git #210

Open
XSven opened this issue Jan 6, 2022 · 7 comments · May be fixed by #250
Open

Failed to fetch/configure distribution maintained in git #210

XSven opened this issue Jan 6, 2022 · 7 comments · May be fixed by #250

Comments

@XSven
Copy link

XSven commented Jan 6, 2022

perl 5.14.2
cpm 0.997007

I have used cpm to install this

on runtime => sub { requires 'Async', '== 0.12', git => 'git@github.com:ap/Async.git', ref => 'v0.12'; };

dependency locally.

2022-01-06T17:04:35,8192510,Async| Resolved Async (== 0.12) -> git@github.com:ap/Async.git from Custom
2022-01-06T17:04:35,8192510,git@github.com:ap/Async.git| Cloning git@github.com:ap/Async.git
2022-01-06T17:04:35,8192510,git@github.com:ap/Async.git| Executing git clone git@github.com:ap/Async.git /home/micsw/.perl-cpm/work/1641485075.23134636/Async-UoVMR
2022-01-06T17:04:35,8192510,git@github.com:ap/Async.git| Cloning into '/home/micsw/.perl-cpm/work/1641485075.23134636/Async-UoVMR'...
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| Executing git checkout v0.12
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| Note: switching to 'v0.12'.
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| You are in 'detached HEAD' state. You can look around, make experimental
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| changes and commit them, and you can discard any commits you make in this
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| state without impacting any branches by switching back to a branch.
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| If you want to create a new branch to retain commits you create, you may
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| do so (now or later) by using -c with the switch command. Example:
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git|   git switch -c <new-branch-name>
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| Or undo this operation with:
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git|   git switch -
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| Turn off this advice by setting config variable advice.detachedHead to false
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| HEAD is now at eec10bc release 0.12
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| -> OK
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| Distribution does not have META.json nor META.yml
2022-01-06T17:04:37,8192510,git@github.com:ap/Async.git| Failed to fetch/configure distribution
2022-01-06T17:04:37,23134636| --
2022-01-06T17:04:37,23134636| Installation failed. The direct cause of the failure comes from the following packages/distributions; you may want to grep this log file by them:
2022-01-06T17:04:37,23134636|  * git@github.com:ap/Async.git

Cloning and switching to the tag works but finally the installation fails. Is this

Distribution does not have META.json nor META.yml

the reason? If yes please explain why this META.* information is mandatory?

@skaji
Copy link
Owner

skaji commented Jan 7, 2022

cpm gets distribution information from META.json,
so it is required.

It is true that cpm allows distributions without META.json in CPAN, but it has some historical backgrounds.

@XSven
Copy link
Author

XSven commented Jan 7, 2022

I don't get it, if cpm allows distributions without META.json in CPAN, why is it failing, if the distribution is maintained in git. Can this behaviour be changed?!

I am searching for a CPAN client that is able to download and install dependencies configured in a cpanfile. Some of these dependencies are only maintained in git. I have tried cpanm, carton, and now cpm, without success.

@XSven
Copy link
Author

XSven commented Jan 20, 2022

After reading An introduction to CPAN distribution metadata
I am quite sure that this issue should get the bug label. This is the important citation

And because they're generated, as a general rule you shouldn't include either of META.json or META.yml in your source code repository.

Conclusion: A git based download/dependency resolution should never rely on META.json and/or META.yml because in the git source code repository these files usually do not exist. They exist only in CPAN after the release of the distribution.

@oalders
Copy link
Contributor

oalders commented Nov 22, 2022

@neilb you've been cited just above. 😄 Was wondering what your thoughts on this are.

@neilb
Copy link

neilb commented Dec 5, 2022

Several thoughts:

  • For quite a while, the recommendation has been "don't add META.{yml,json} to your repo, as they're built at release time", so I don't think a tool can start expecting to find them. You can download it and generate the metadata, if you really want it.
  • Everyone publishing and getting their Perl modules via CPAN has a number of benefits, not least is ensuring no collision on namespaces (I know, no collision is a slight exaggeration, but close enough).
  • I may be behind the times here, and perhaps lots of people want to get their fix from Git{Hub,Lab}, and we should think about it, in which case it could be scheduled for a discussion at PTS 2023 ;-)

@XSven
Copy link
Author

XSven commented Oct 25, 2023

Sorry to bother you all again. Was this topic discussed during the PTS 2023? I am still looking for a cpanfile based cpan client (not necessarily cpm) that is able to download/build/test/install from Git{Hub,Lab} without expecting the files META.{yml,json} to exist.

@XSven
Copy link
Author

XSven commented Jan 5, 2024

I thought the most recent cpm version (0.997015) would have solved this issue too but unfortunately it does not. Reading the comment of the pull request #243 I am even more surprised why the restriction ("Distribution does not have META.json nor META.yml") still exists if I am installing from Git directly using a corresponding cpanfile.

kupietz added a commit to kupietz/cpm that referenced this issue Sep 11, 2024
kupietz added a commit to kupietz/cpm that referenced this issue Sep 11, 2024
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

Successfully merging a pull request may close this issue.

4 participants