Skip to content

Conversation

elcritch
Copy link
Contributor

@elcritch elcritch commented Sep 4, 2025

Dependency versions would get messed up with @ being added to the pkg name in some cases.

@Araq
Copy link
Member

Araq commented Sep 4, 2025

Why the heck would @ be part of a package name?

@elcritch
Copy link
Contributor Author

elcritch commented Sep 4, 2025

Why the heck would @ be part of a package name?

Come to think of it shouldn't. I thought maybe it was from some requires format, but that's not a thing.

Hmmm, I'm digging into where the @ is coming from. Probably an errant usage of the pretty print format for a specific version.

@elcritch
Copy link
Contributor Author

elcritch commented Sep 4, 2025

That makes more sense. An old package of mine had an @ in a requires line in an old release. Probably from copying a nimble install pkg@#head or futzing with Nimble.

Now the addRelease logic can handle bad Nimble releases by skipping them. Surprising we haven't needed that yet.

@Araq
Copy link
Member

Araq commented Sep 6, 2025

  1. It's weirdly specific. There are other invalid chars, I'm sure.
  2. I think an Option would work better here rather than an exception, but I don't know for sure.

@elcritch
Copy link
Contributor Author

elcritch commented Sep 8, 2025

  1. It's weirdly specific. There are other invalid chars, I'm sure.

True, it is. Perhaps it should check for any non-ascii char that's not in the version char set? Not sure it's official, but Nimble packages seem to be ascii limited, or perhaps should?

  1. I think an Option would work better here rather than an exception, but I don't know for sure.

I thought about that, but it'd be a pain. It'd have to go through the Nimble parser and just end up with the same result of skipping that Nimble release.

@Araq
Copy link
Member

Araq commented Sep 11, 2025

Use strutils.PunctuationChars except the chars we need, >= etc, depending on the logic.

* update updates

* update updates

* update

* update

* update

* update

* update

* swap to option to represent no answer

* swap to option to represent no answer from isOutdated

* swap to option to represent no answer from isOutdated

* rename

* rename

* rename again
@elcritch
Copy link
Contributor Author

elcritch commented Oct 13, 2025

Use strutils.PunctuationChars except the chars we need, >= etc, depending on the logic.

Unfortunately that doesn't work since we can have URLs in the name component.

Still I tried to generalize it a bit more using validIdentifier or checking for a URL. If the url ends with @ it's also an error. There's cases IIRC where @ can be used in a URL itself.

Version strings are checked for incomplete parsing ignoring dangling whitespace.

Also I discovered I'm not the only one who's gone from nimble install xyx@#branch to requires "xyx@#branch" by accident.

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 this pull request may close these issues.

2 participants