sdl2_nim
sdl2_nim copied to clipboard
Can you rename `sdl2.nimble` to `sdl2_nim.nimble`?
This is causing clashes with the nim-lang/sdl2 wrapper and doesn't reflect the name that's in the packages.json file.
You will also need to rename the sdl2
directory to sdl2_nim
.
You will also need to rename the sdl2 directory to sdl2_nim.
Wouldn't it require changing all projects containing import sdl2/sdl
line? Sounds highly suboptimal if it is so.
Yeah. I know it's not ideal :/
We can keep it as-is for now but eventually we will be forced to enforce errors when this situation occurs.
Any ideas how to make the transition stage then?
I was thinking of adding a deprecation warning, but it would imply both old and new imports working simultaneously, so maybe something like this might work:
- duplicate this repository into
sdl2nim
with a new nimble file and a separate entry in the packages list. - add a deprecation warning to the original
sdl2_nim
repository, with the suggestion of switching tosdl2nim
.
What do you think?
I would suggest releasing a new major version of this library with the change made. For a transition period you can create a last release that's 0.x or 1.x (whichever you're using) which provides both naming schemes.
@dom96 The version scheme for this library is documented in the readme
a.b.c.d
a.b.c - underlying SDL2 version
d - sdl2_nim revision
A new manjor version is out of the question.
Then maybe we should do what Vladar suggests, but note that in Nimble's eyes sdl2_nim
and sdl2nim
are equivalent (it follows Nim's style insensitivity) so we might need a new name for this library.
in Nimble's eyes sdl2_nim and sdl2nim are equivalent (it follows Nim's style insensitivity)
Thanks for the info, missed this.
What about putting these two directories in the current repo (old sdl2
and new sdl2nim
) — if it works, it'll probably be a minimal pain approach. (A symlink would be even better, but AFAIK git doesn't really support them).
You can do this as a transition period I suppose
Megred to master
cdcc1bab9d9bc782c1dd09100f48affaa38f2112
1187a59d28e35b18aa1ee583ec5b85e794bb95d5
@dom96
Regarding the equivalency of sdl2_nim
and sdl2nim
in Nimble.
I've tested installing the newly updated sdl2_nim (with sdl2nim
dir), and got a couple of such warnings:
Warning: Package 'sdl2_nim' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'sdl2_nim', but file 'smpeg.nim' is in a directory named 'sdl2nim' instead. This will be an error in the future.
(nimble version 0.13.1)
Moreover, if I try to change import sdl2nim/sdl
to import sdl2_nim/sdl
, I get an error during compilation: Error: cannot open file: sdl2_nim/sdl
.
So, are these not equivalent after all?
If I replace name": "sdl2_nim",
with name": "sdl2nim",
string in packages.json, will it fix the problem?
huh, that's odd. I would expect import sdl2_nim
and import sdl2nim
to be equivalent. Maybe a Nim bug?
I'm not sure I completely understand the terminology, but are module names fall under "identifier" status though?
https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality
I'd say so, yes.
Hi, new user here. I just ran into this. Installing sld2_nim downright breaks the sdl2 package, it would be great if the names didn't clash (as a new user, it took me an embarrassing amount of time to figure out what was wrong...). Thanks!
Should be fixed by v2.0.14.2
and legacy support for the old style should be provided by the legacy
branch v2.0.14.2-legacy
(nimble install sdl2_nim@#legacy
).
@dom96 @krux02 @DoctorWhoof please check if possible.