Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Module versions with unicode #4854

Open
CeylonMigrationBot opened this issue Apr 28, 2014 · 6 comments
Open

Module versions with unicode #4854

CeylonMigrationBot opened this issue Apr 28, 2014 · 6 comments

Comments

@CeylonMigrationBot
Copy link

CeylonMigrationBot commented Apr 28, 2014

[@lucaswerkmeister]

cd /tmp
ceylon new hello-world hello-world --ant=false --eclipse=false --module-name=tmp --module-version=version
cd hello-world/
ceylon compile tmp
ceylon run tmp/version
# Note: JBoss Modules version 1.1.3.GA
# Hello, World!

sed -i 's/version/vερσiον/' source/tmp/module.ceylon
ceylon compile tmp
ceylon run tmp/vερσiον
# Note: JBoss Modules version 1.1.3.GA
# ceylon run: Invalid module name or version: contains invalid characters

That message is printed here.

If you try to create that version directly with ceylon new, you get this instead:

ceylon new hello-world hello-world-2 --ant=false --eclipse=false --module-name=tmp --module-version=vερσiον
ceylon new: Invalid value: vερσiον
java.lang.RuntimeException: Invalid value: vερσiον
at com.redhat.ceylon.tools.new_.Variable.initialize(Variable.java:70)
at com.redhat.ceylon.tools.new_.CeylonNewTool.buildPromptedEnv(CeylonNewTool.java:151)
at com.redhat.ceylon.tools.new_.CeylonNewTool.run(CeylonNewTool.java:104)
at com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:343)
at com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:283)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:82)
at com.redhat.ceylon.launcher.Launcher.main(Launcher.java:21)
Generated by linkStacktrace

Found around here. @tombentley here’s your issue, I used the repository that contains the error message.

[Migrated from ceylon/ceylon-runtime#59]

@CeylonMigrationBot
Copy link
Author

[@tombentley] Thanks for hunting that down @lucaswerkmeister. It looks like it's a limitation inherited from JBoss modules, which is using regexes with the a-z and A-Z character classes. I guess there isn't any reason why unicode categories couldn't be used, but we'll need to get that into JBoss modules in order to remove this limitation.

@CeylonMigrationBot
Copy link
Author

[@tombentley] \p{Alnum} is probably more appropriate, for example.

@CeylonMigrationBot
Copy link
Author

[@lucaswerkmeister] What are the technical restrictions to the version anyways? I get that the module name needs to be a valid Java identifier because it’s part of the package names, but as far as my knowledge goes, the version is a String only used in file names and could be almost arbitrary…

@CeylonMigrationBot
Copy link
Author

[@lucaswerkmeister] Oh and by the way, a module called τμπ compiles just fine and gets the same error when ran.

@CeylonMigrationBot
Copy link
Author

[@tombentley] I've opened https://issues.jboss.org/browse/MODULES-190, so we'll see what they say.

@CeylonMigrationBot
Copy link
Author

[@FroMage] Wow, they only ever had 189 bugs? That must be solid technology ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant