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

Module versions with unicode #59

Open
lucaswerkmeister opened this issue Apr 28, 2014 · 8 comments
Open

Module versions with unicode #59

lucaswerkmeister opened this issue Apr 28, 2014 · 8 comments
Labels
Milestone

Comments

@lucaswerkmeister
Copy link
Member

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.

@tombentley
Copy link
Member

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
Copy link
Member

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

@lucaswerkmeister
Copy link
Member Author

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
Copy link
Member Author

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

@tombentley
Copy link
Member

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

@FroMage
Copy link
Member

FroMage commented Apr 28, 2014

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

@tombentley
Copy link
Member

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

@FroMage
Copy link
Member

FroMage commented Dec 12, 2015

Err, didn't we move that issue?

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

No branches or pull requests

4 participants