sdl2_nim icon indicating copy to clipboard operation
sdl2_nim copied to clipboard

Can you rename `sdl2.nimble` to `sdl2_nim.nimble`?

Open dom96 opened this issue 3 years ago • 15 comments

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.

dom96 avatar May 02 '21 14:05 dom96

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.

Vladar4 avatar May 03 '21 17:05 Vladar4

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.

dom96 avatar May 03 '21 21:05 dom96

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:

  1. duplicate this repository into sdl2nim with a new nimble file and a separate entry in the packages list.
  2. add a deprecation warning to the original sdl2_nim repository, with the suggestion of switching to sdl2nim.

What do you think?

Vladar4 avatar May 05 '21 08:05 Vladar4

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 avatar May 06 '21 21:05 dom96

@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.

krux02 avatar May 06 '21 22:05 krux02

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.

dom96 avatar May 08 '21 15:05 dom96

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).

Vladar4 avatar May 08 '21 19:05 Vladar4

You can do this as a transition period I suppose

dom96 avatar Jul 04 '21 15:07 dom96

Megred to master cdcc1bab9d9bc782c1dd09100f48affaa38f2112 1187a59d28e35b18aa1ee583ec5b85e794bb95d5

Vladar4 avatar Jul 10 '21 14:07 Vladar4

@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?

Vladar4 avatar Jul 10 '21 16:07 Vladar4

huh, that's odd. I would expect import sdl2_nim and import sdl2nim to be equivalent. Maybe a Nim bug?

dom96 avatar Jul 10 '21 16:07 dom96

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

Vladar4 avatar Jul 11 '21 08:07 Vladar4

I'd say so, yes.

dom96 avatar Jul 11 '21 12:07 dom96

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!

DoctorWhoof avatar Aug 16 '21 19:08 DoctorWhoof

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.

Vladar4 avatar Aug 17 '21 18:08 Vladar4