Fix runtime finding in v2 endpoint#476
Conversation
HexF
left a comment
There was a problem hiding this comment.
I think it would be nice to allow some SemVer-like patterns instead of just hard-coding *.
Obviously we can't use actual SemVer as Nix doesn't force versions into SemVer, but maybe we can try determine the versioning scheme (e.g. CalVer, SemVer, etc.) and allow matching on them?
|
@HexF how about we have a configurable and changeable "mainstream" version for each package. It could be stored in some file as a package to version map or something. Then "*" would just get this mainstream version. Other versions would be specified manually. This will also help solve the problem of multiple runtimes of the same package |
|
@Brikaa Issue with that is we would have to pin nixpkgs to a version to ensure that all the version numbers are the same. But adding to that, what do we consider as a version from CalVer to SemVer for example? |
|
What I mean is that we would not need to do any version comparisons or conversions. We just add a Choosing |
|
Ok yeah, that could work - build that map into the nix flake. I'm thinking instead of the exact version rather it would link back to the runtime, e.g.: {
pistonMainstreamVersions = {
"python3" = runtimes.python;
};
} |
|
I have got another idea. If we could somehow use an ordered data structure in |
|
Or we can have another file that includes the priority order of the runtimes |
|
Not entirely sure if the nix-to-json conversion allows reading the order of elements in a map. I'm using the flake to export all the available runtimes to piston, so ideally I would want to bundle all the version priority stuff into the flake. |
|
Should we get rid of the v3 endpoint now? |
|
This works by loading the runtimes mentioned in Choosing It also works with specific sets like |
No description provided.