Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you rename sdl2.nimble to sdl2_nim.nimble? #35

Open
dom96 opened this issue May 2, 2021 · 15 comments
Open

Can you rename sdl2.nimble to sdl2_nim.nimble? #35

dom96 opened this issue May 2, 2021 · 15 comments

Comments

@dom96
Copy link

dom96 commented May 2, 2021

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.

@Vladar4
Copy link
Owner

Vladar4 commented May 3, 2021

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.

@dom96
Copy link
Author

dom96 commented May 3, 2021

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.

@Vladar4
Copy link
Owner

Vladar4 commented May 5, 2021

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?

@dom96
Copy link
Author

dom96 commented May 6, 2021

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.

@krux02
Copy link
Contributor

krux02 commented May 6, 2021

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

@dom96
Copy link
Author

dom96 commented May 8, 2021

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.

@Vladar4
Copy link
Owner

Vladar4 commented May 8, 2021

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

@dom96
Copy link
Author

dom96 commented Jul 4, 2021

You can do this as a transition period I suppose

@Vladar4
Copy link
Owner

Vladar4 commented Jul 10, 2021

Megred to master
cdcc1ba
1187a59

@Vladar4
Copy link
Owner

Vladar4 commented Jul 10, 2021

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

@dom96
Copy link
Author

dom96 commented Jul 10, 2021

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

@Vladar4
Copy link
Owner

Vladar4 commented Jul 11, 2021

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

@dom96
Copy link
Author

dom96 commented Jul 11, 2021

I'd say so, yes.

@DoctorWhoof
Copy link

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!

@Vladar4
Copy link
Owner

Vladar4 commented Aug 17, 2021

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.

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

No branches or pull requests

4 participants