nim-lang / nimble

Package manager for the Nim programming language.
Other
1.24k stars 174 forks source link

Add forge aliases for different Git forge providers #1222

Closed xTrayambak closed 1 month ago

xTrayambak commented 1 month ago

This PR adds "forge aliases" - they're an easy way to avoid writing out full URLs for packages that aren't on the Nimble index. \ They work similarly to how Nix's system works.

Here's a few examples:

$ nimble install gh:xTrayambak/librng
$ nimble install srht:bptato/chame

It also handles special "quirks" in a forge (eg., SourceHut adds a tilde in front of the username, so this handles it if the user didn't add it themselves) \ I've written a few tests for the alias "parser" as well. It works with the install and add commands, and as a result also works fine if you add the alias inside your Nimble file like this:

# Package

version       = "0.1.0"
author        = "Lorem Ipsum"
description   = "Lorem Ipsum Door Sit"
license       = "MIT"
bin           = @["lorem"]

# Dependencies

requires "nim >= 2.0.0"
requires "gh:xTrayambak/librng"
requires "srht:bptato/chame"
requires "srht:~user/repository"

Please let me know if I missed something out or if I should add something else to this.

xTrayambak commented 1 month ago

I'm gonna try to fix the failing CI really quickly, sorry for that one.

jmgomez commented 1 month ago

@xTrayambak do you mind to attempt to pass the CI with sat on?

xTrayambak commented 1 month ago

I'm not sure how the SAT solver works, sorry.

jmgomez commented 1 month ago

@xTrayambak np, to enable it is just useSatSolver*: bool = true in options.nim. I just did

xTrayambak commented 1 month ago

We're not enabling it yet though, right?

jmgomez commented 1 month ago

Nope, we need to test it in the real world. But it's a good idea to make sure the CI keeps passing for it when meaningful changes are merged

jmgomez commented 1 month ago

SAT is still green :)