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

Underscore and dash should be equivalent in haxelib names #568

Open
tobil4sk opened this issue Oct 1, 2022 · 1 comment
Open

Underscore and dash should be equivalent in haxelib names #568

tobil4sk opened this issue Oct 1, 2022 · 1 comment

Comments

@tobil4sk
Copy link
Member

tobil4sk commented Oct 1, 2022

Since the haxe compiler treats -D some-lib and -D some_lib as equivalent, it might make sense to treat these as equivalent library names. Otherwise, two different libraries could set the same define flag.

@tobil4sk
Copy link
Member Author

tobil4sk commented Oct 2, 2022

I realise now that there's a lot more problems with library name flags:

  • Library names are case insensitive, but compiler flags aren't. I think in the current development branch it always uses what's in haxelib.json if available, or otherwise, whatever name the library was installed as.
  • Library names could shadow actual compiler flags. It wouldn't really be pratical to have a list of banned library names, and that won't work for future compiler flags. Luckily, there only seems to be one instance currently, which is hxcpp-debugger which doesn't seem to be too serious.

Ideally they would be put in a haxelib namespace, like haxelib.some_lib. However, that would be a difficult migration. It would be possible to potentially have warning messages if an #if block checks for some_lib which is not set, and there exists a haxelib.some_lib flag.

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

1 participant