-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Library name capitalisation issues #529
Comments
This is so comprehensive, I love it, thank you! |
Some more info and some more open questions: With the However, for For Also, the command
|
Maybe haxelib should maintain a file with libs list in the root of the haxelib repo. |
Or just a single file in the project root for projects with uppercase characters? That way if the project directory is removed manually the file will be removed as well, which seems more manageable to me. The only problem with adding extra files is that it makes the system more complex and so it should be thought out. But a solution like that could work. However, a decision has to be made regarding where this name comes from. For example, we could either get it from the first version installed, or update it with each new version. It would be easier if we could be certain (at least from now) that new library releases will not change the
Other package managers such as npm only allow for lowercase package names, which removes a lot of these issues. But I guess we have to workaround what's already been done. Another thing we'll have to think about, is that on linux, project directories will have to be lowercase from now on. This means that any old uppercase directories would have to be converted in order to work properly. For example: And if haxelib is going to have changes like this that will require "reformatting" the repository, it might be worth considering if there's any other large changes that need to be made, so that all the breaking changes come in one release rather than multiple. |
Addresses HaxeFoundation#529 This way, list shows the correct version of the name, and path falls back to the correct version when no haxelib.json is found. The "correct" version is the way the parameter to the `dev` command was capitalised, or otherwise it is the capitlisation of the library name in its information stored on the server. Throw error in `path` command when two versions of the same lib are queried even if the two versions are capitalised differently. - e.g. `LiBrArY:1.2.0` and `library:1.3.0` Ensure that haxelib run sets HAXELIB_RUN_NAME to name field in `haxelib.json`. Officially released library version names are preferred over the capitalization of `dev`, `git`, or `hg` versions. For example, after: `haxelib dev LIBRARY <path>` `haxelib install library 1.0.0` If `library` is the official capitalization, then that is preferred over `LIBRARY` after we install from the server. Ignore capitalised directories in `list`
Addresses HaxeFoundation#529 This way, list shows the correct version of the name, and path falls back to the correct version when no haxelib.json is found. The "correct" version is the way the name in haxelib.json is capitalized, or if no such file exists it is the way the parameter to the `dev`/`git`/`hg` command was capitalized. Additionally, if the parameter is an alias, then it is used instead as well. It is updated everytime a version is set as current. However, officially released library version names are preferred over the capitalization of `dev`, `git`, or `hg` versions. For example, after: `haxelib dev LIBRARY <path>` `haxelib install library 1.0.0` If `library` is the version in `haxelib.json`, then that is preferred over `LIBRARY` after we install from the server. Throw error in `path` command when two versions of the same lib are queried even if the two versions are capitalized differently. - e.g. `LiBrArY:1.2.0` and `library:1.3.0` Ensure that haxelib run sets HAXELIB_RUN_NAME to name field in `haxelib.json`. Ignore capitalized directories in `list`.
And HaxeFoundation#503 - Ensure haxelib is case insensitive for library names - Ensure haxelib keeps track of correct name capitalization for `list` command - Ensure haxelib.json name is preferred with git/hg/dev, unless an alias is given. - If there is no haxelib.json, ensure that the last name the user used is shown - Ensure running aliased libraries works correctly
Addresses HaxeFoundation#529 This way, list shows the correct version of the name, and path falls back to the correct version when no haxelib.json is found. The "correct" version is the way the name in haxelib.json is capitalized, or if no such file exists it is the way the parameter to the `dev`/`git`/`hg` command was capitalized. Additionally, if the parameter is an alias, then it is used instead as well. It is updated everytime a version is set as current. However, officially released library version names are preferred over the capitalization of `dev`, `git`, or `hg` versions. For example, after: `haxelib dev LIBRARY <path>` `haxelib install library 1.0.0` If `library` is the version in `haxelib.json`, then that is preferred over `LIBRARY` after we install from the server. Throw error in `path` command when two versions of the same lib are queried even if the two versions are capitalized differently. - e.g. `LiBrArY:1.2.0` and `library:1.3.0` Ensure that haxelib run sets HAXELIB_RUN_NAME to name field in `haxelib.json`. Ignore capitalized directories in `list`.
Also HaxeFoundation#465 and HaxeFoundation#503 - Ensure haxelib is case insensitive for library names - Ensure haxelib keeps track of correct name capitalization for `list` command - Ensure haxelib.json name is preferred with git/hg/dev, unless an alias is given. - If there is no haxelib.json, ensure that the last name the user used is shown - Ensure running aliased libraries works correctly
In #510 I think I have a working solution to this issue now. All library directories are lowercase now. This means that everywhere now library names are case insensitive, which solves all the related issues. This requires the The capitalization of the library name is the version which is used by the
I've written quite an extensive list of tests for all these edge cases and tests for the |
Thank you for all your efforts on this @tobil4sk <3 |
Addresses HaxeFoundation#529 This way, list shows the correct version of the name, and path falls back to the correct version when no haxelib.json is found. The "correct" version is the way the name in haxelib.json is capitalized, or if no such file exists it is the way the parameter to the `dev`/`git`/`hg` command was capitalized. Additionally, if the parameter is an alias, then it is used instead as well. It is updated everytime a version is set as current. However, officially released library version names are preferred over the capitalization of `dev`, `git`, or `hg` versions. For example, after: `haxelib dev LIBRARY <path>` `haxelib install library 1.0.0` If `library` is the version in `haxelib.json`, then that is preferred over `LIBRARY` after we install from the server. Throw error in `path` command when two versions of the same lib are queried even if the two versions are capitalized differently. - e.g. `LiBrArY:1.2.0` and `library:1.3.0` Ensure that haxelib run sets HAXELIB_RUN_NAME to name field in `haxelib.json`. Ignore capitalized directories in `list`.
Also HaxeFoundation#465 and HaxeFoundation#503 - Ensure haxelib is case insensitive for library names - Ensure haxelib keeps track of correct name capitalization for `list` command - Ensure haxelib.json name is preferred with git/hg/dev, unless an alias is given. - If there is no haxelib.json, ensure that the last name the user used is shown - Ensure running aliased libraries works correctly
Addresses #529 This way, list shows the correct version of the name, and path falls back to the correct version when no haxelib.json is found. The "correct" version is the way the name in haxelib.json is capitalized, or if no such file exists it is the way the parameter to the `dev`/`git`/`hg` command was capitalized. Additionally, if the parameter is an alias, then it is used instead as well. It is updated everytime a version is set as current. However, officially released library version names are preferred over the capitalization of `dev`, `git`, or `hg` versions. For example, after: `haxelib dev LIBRARY <path>` `haxelib install library 1.0.0` If `library` is the version in `haxelib.json`, then that is preferred over `LIBRARY` after we install from the server. Throw error in `path` command when two versions of the same lib are queried even if the two versions are capitalized differently. - e.g. `LiBrArY:1.2.0` and `library:1.3.0` Ensure that haxelib run sets HAXELIB_RUN_NAME to name field in `haxelib.json`. Ignore capitalized directories in `list`.
Also #465 and #503 - Ensure haxelib is case insensitive for library names - Ensure haxelib keeps track of correct name capitalization for `list` command - Ensure haxelib.json name is preferred with git/hg/dev, unless an alias is given. - If there is no haxelib.json, ensure that the last name the user used is shown - Ensure running aliased libraries works correctly
This issue is related to #465, however, this is not to do with the haxelib server.
First of all, in some definitions, a project name in
haxelib.json
has to be lowercase, however this is not really enforced at all when submitting a haxelib.Windows
On Windows, the following problems exist. There are less than on other systems because the Windows filesystem is case insensitive.
list
always returns lowercase library namespath
uses the capitalisation used in the command. For example,haxelib path someLIB
would return:C:\haxelib-repo\someLIB\0,0,1\src -D someLIB=0.0.1
Even if the actual library name is
SomeLib
. This is mainly an issue for the -D flag, as usage of define flags in conditional compilation is case sensitive. The capitalisation of the path itself does not matter on Windows thankfully.Linux
On Linux, there are more problems:
Let's say you install
Console.hx
version0.2.15
(current version as of writing this):{haxelib-repo}/console,hx/
haxelib install Console.hx
norhaxelib install console.hx
recognise that the newest version is already installed (for other libraries it does)haxelib install haxelib.json
wherehaxelib.json
contains the dependency either"Console.hx"
or"console.hx"
, it does not recognise that the newest version is installed (for other libraries it does)haxelib install file.hxml
wherefile.hxml
contains-lib Console.hx
it does not recognise that the newest version is installed, but if it is-lib console.hx
it does.haxelib set Console.hx 0.2.15
attempts to reinstall it, whilehaxelib set console.hx 0.2.15
recognises that it is already installed.haxelib path Console.hx
fails,haxelib path console.hx
works (same forlibpath
). By extension, you cannot include it in hxmls via-lib Console.hx
, you have to put-lib console.hx
haxelib update Console.hx
does not recognise that the newest version is installed (but does not fail), buthaxelib update console.hx
doeshaxelib remove Console.hx
fails,haxelib remove console.hx
workshaxelib list
showsconsole.hx
haxelib dev Console.hx [path]
creates a new library in the{haxelib-repo}/Console,hx/
directory.haxelib dev console.hx [path]
works properlyhaxelib git Console.hx [url]
also creates a new library at{haxelib-repo}/Console,hx/
,haxelib git console.hx [url]
works properlyhaxelib run Console.hx
fails,haxelib run console.hx
works (if there was a run script that is)Most of these problems on Linux can be solved by always converting the library name to lowercase to generate the library directory. This might have some backwards compatibility issues which may need to be addressed. That would solve all the linux unique issues leaving only the same ones that are on Windows.
The text was updated successfully, but these errors were encountered: