ceylon / ceylon-runtime

DEPRECATED
24 stars 5 forks source link

Module versions with unicode #59

Open lucaswerkmeister opened 10 years ago

lucaswerkmeister commented 10 years ago
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](https://github.com/ceylon/ceylon-compiler/blob/bfb2f1e276d89f52ca081b3d0022d0827f262b61/src/com/redhat/ceylon/tools/new/Variable.java#L70)) at com.redhat.ceylon.tools.new.CeylonNewTool.buildPromptedEnv([CeylonNewTool.java:151](https://github.com/ceylon/ceylon-compiler/blob/bfb2f1e276d89f52ca081b3d0022d0827f262b61/src/com/redhat/ceylon/tools/new/CeylonNewTool.java#L151)) at com.redhat.ceylon.tools.new.CeylonNewTool.run([CeylonNewTool.java:104](https://github.com/ceylon/ceylon-compiler/blob/bfb2f1e276d89f52ca081b3d0022d0827f262b61/src/com/redhat/ceylon/tools/new/CeylonNewTool.java#L104)) 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.

tombentley commented 10 years ago

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.

tombentley commented 10 years ago

\p{Alnum} is probably more appropriate, for example.

lucaswerkmeister commented 10 years ago

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…

lucaswerkmeister commented 10 years ago

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

tombentley commented 10 years ago

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

FroMage commented 10 years ago

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

tombentley commented 8 years ago

This has just been fixed in jboss module's upstream: https://issues.jboss.org/browse/MODULES-190

FroMage commented 8 years ago

Err, didn't we move that issue?