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

Fail to install a module when the same filename is present #217

Open
ferki opened this issue Apr 17, 2022 · 5 comments
Open

Fail to install a module when the same filename is present #217

ferki opened this issue Apr 17, 2022 · 5 comments

Comments

@ferki
Copy link

ferki commented Apr 17, 2022

cpm fails when trying to install a module with a name matching a file name (or directory name) in the current directory:

FAIL install file:///path/to/project/lib

and the build.log complains about:

[...] Distribution does not have META.json nor META.yml

This for example happens when a project has both a lib directory and the lib module as a dependency, then trying to use e.g. dzil listdeps | cpm install - to install all dependencies. In that case dzil returns lib as a dependency and it conflicts with the lib directory.

Before #161 and #216, core dependencies should have been filtered out in one way or another before passing the dependency list to cpm, so that masked this behavior at least for my use cases. I tried dzil listdeps --omit-core and cpm install --target-perl, but that didn't seem to help.

I could also reproduce the same failure by trying to install any other module with a name that conflicts with a directory or file name in the current directory.

It looks like a real bug, but I wonder if I might have missed some of the available options that might help here? 🤔

@skaji
Copy link
Owner

skaji commented Apr 18, 2022

For the meanwhile, you can try

dzil listdeps --omit-core=5.008001

@skaji
Copy link
Owner

skaji commented Apr 18, 2022

Related to miyagawa/cpanminus#564

@ferki
Copy link
Author

ferki commented Apr 18, 2022

For the meanwhile, you can try

dzil listdeps --omit-core=5.008001

Ah, thanks for the example! I did try dzil listdeps --omit-core=5.34.1, but that did not work. I confirm omitting with a different version format helps working around the core module problem with e.g. dzil listdeps --omit-core=5.034001.

Related to miyagawa/cpanminus#564

Thanks for the reference as well! I did not realize cpanm was affected by this naming conflict some time ago 🤔 It seems to be fixed in cpanm by now (using version 1.7044), though: cpanm lib finishes successfully with lib is up to date. (0.65).

@skaji
Copy link
Owner

skaji commented Apr 19, 2022

If the lib is not a local directory, but a local file, then cpanm lib will fail.

@ferki
Copy link
Author

ferki commented Apr 19, 2022

Right, confirmed. Looks like I just got "lucky" with lib being the only conflict for my use cases, and it's a directory. Thank you, I learned something already!

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

2 participants