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

Error when the source-url is wrong-ish and does not end in .git is LTA #383

Open
JJ opened this issue Jan 6, 2021 · 4 comments
Open

Error when the source-url is wrong-ish and does not end in .git is LTA #383

JJ opened this issue Jan 6, 2021 · 4 comments

Comments

@JJ
Copy link
Contributor

JJ commented Jan 6, 2021

Context

See tony-o/raku-fez#11

The file it can't extract from is the (wrongly set) web page https://github.com/tony-o/raku-fez, and the file it can't extract from is then a web site.

Expected Behavior

Well, this one is really tricking. We're talking about a source-url that is correct, that is one extension removed from the correct one which could actually be interpreted (ending in .git), so I would say it's, in general, almost impossible to know what's the intention of the author. It would really need fine-tuning of heuristics here. Maybe the heuristics should include looking at the extension in the URL and/or the type returned by the system.

Actual Behavior

An error stating they don't understand the downloaded URL, but it does not include the original URL, or says what it was looking for, or has any hints on the actual type.

Steps to Reproduce

  • Delete .git from the source-url in any distribution.
  • Wait a while for re-indexing
  • zef install distro

Your Environment

  • raku -v
    0.9.4
@ugexe
Copy link
Owner

ugexe commented Jan 6, 2021

.git is absolutely required. How else can you figure out what to use to download a given url without doing something unacceptable like trying to download it with multiple getters and guessing which one worked?

@ugexe
Copy link
Owner

ugexe commented Jan 6, 2021

Also if zef could just guess what the type was it would just use the appropriate adapter in the first place instead of providing a hint

@JJ
Copy link
Contributor Author

JJ commented Jan 6, 2021

@ugexe that's quite clear and it's tested when they're added to the ecosystem. But either in CPAN, or due to any other unexpected issue, it can be wrong. So maybe the error should point in that direction.

@ugexe
Copy link
Owner

ugexe commented Jan 6, 2021

Again, how is it supposed to point you in the right direction? And if it would why wouldn't it just Do The Right Thing? How can it tell if "http://foo.com/blarg" is actually a git repository and not anything else (something that might be understood with a plugin) without downloading it? How does it do these things when using plugins that may or may not add the functionality required to parse some given uri?

My point being is that even though it sounds nice to have doesn't mean it can be done without either an insane amount of effort, breaking consistency elsewhere, hard coupling, or maybe not at all -- when this can more appropriately be handled at the ecosystem level. If you are suggesting it is broken $somewhere_else, then why not fix the problem $somewhere_else instead?

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