Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Development Java (http://www.linux-archive.org/fedora-development-java/)
-   -   Maven error log due to UTF8 during make rpm (http://www.linux-archive.org/fedora-development-java/657202-maven-error-log-due-utf8-during-make-rpm.html)

Doron Fediuck 04-18-2012 01:12 PM

Maven error log due to UTF8 during make rpm
 
Hi guys,
I hope someone here stumbled upon it, and has a good idea.
We have some Java source files with remarks in French, including
Unicode characters.
When running simple maven build it works well.
However, when using rpmbuild, we're failing
with errors like this:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project talendRoutines: Compilation failure: Compilation failure:
[ERROR] /home/xxx/git-repos/ovirt-dwh/rpmtop/BUILD/ovirt-dwh-3.0/data-warehouse/history_etl/etl_sources/talendRoutines/src/main/java/routines/TalendString.java:[274,35] unmappable character for encoding ASCII
...

When debugging this, we saw that rpmbuild actually sets LANG=C,
which disables unicode thus resulting with the error.

1. Did anyone see this before?
2. Any idea how to disable the LANG setting during rpmbuild?

I'm sure Fedora Java dev's should be aware of it.

Thanks!
Doron
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel

Juan Hernandez 04-18-2012 01:19 PM

Maven error log due to UTF8 during make rpm
 
On 04/18/2012 03:12 PM, Doron Fediuck wrote:
> Hi guys,
> I hope someone here stumbled upon it, and has a good idea.
> We have some Java source files with remarks in French, including
> Unicode characters.
> When running simple maven build it works well.
> However, when using rpmbuild, we're failing
> with errors like this:
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project talendRoutines: Compilation failure: Compilation failure:
> [ERROR] /home/xxx/git-repos/ovirt-dwh/rpmtop/BUILD/ovirt-dwh-3.0/data-warehouse/history_etl/etl_sources/talendRoutines/src/main/java/routines/TalendString.java:[274,35] unmappable character for encoding ASCII
> ...
>
> When debugging this, we saw that rpmbuild actually sets LANG=C,
> which disables unicode thus resulting with the error.
>
> 1. Did anyone see this before?
> 2. Any idea how to disable the LANG setting during rpmbuild?
>
> I'm sure Fedora Java dev's should be aware of it.

I added this option the maven command line for that very reason:

-Dproject.build.sourceEncoding=ISO-8859-1

Hope it helps!

--
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel

Doron Fediuck 04-18-2012 01:24 PM

Maven error log due to UTF8 during make rpm
 
On 18/04/12 16:19, Juan Hernandez wrote:
> On 04/18/2012 03:12 PM, Doron Fediuck wrote:
>> Hi guys,
>> I hope someone here stumbled upon it, and has a good idea.
>> We have some Java source files with remarks in French, including
>> Unicode characters.
>> When running simple maven build it works well.
>> However, when using rpmbuild, we're failing
>> with errors like this:
>>
>> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project talendRoutines: Compilation failure: Compilation failure:
>> [ERROR] /home/xxx/git-repos/ovirt-dwh/rpmtop/BUILD/ovirt-dwh-3.0/data-warehouse/history_etl/etl_sources/talendRoutines/src/main/java/routines/TalendString.java:[274,35] unmappable character for encoding ASCII
>> ...
>>
>> When debugging this, we saw that rpmbuild actually sets LANG=C,
>> which disables unicode thus resulting with the error.
>>
>> 1. Did anyone see this before?
>> 2. Any idea how to disable the LANG setting during rpmbuild?
>>
>> I'm sure Fedora Java dev's should be aware of it.
>
> I added this option the maven command line for that very reason:
>
> -Dproject.build.sourceEncoding=ISO-8859-1
>
> Hope it helps!
>
Thanks Juan,
Looks like a good workaround.
I think we could improve if rpmbuild would be aware of it.
Do you think we should open a BZ on rpmbuild?

--

/d

"Hi, my name is Any Key. Please don't hit me!"
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel

Colin Walters 04-18-2012 01:25 PM

Maven error log due to UTF8 during make rpm
 
----- Original Message -----
>
> When debugging this, we saw that rpmbuild actually sets LANG=C,
> which disables unicode thus resulting with the error.
>
> 2. Any idea how to disable the LANG setting during rpmbuild?

This is a tricky issue; from what I can see of a quick read of
the JLS, it says that source files should be Unicode; but that's
not useful here because it doesn't seem to specify the encoding.

Anyways, if the OpenJDK compiler derives "ASCII" from LANG=C
that's wrong. By default, it should assume input files are UTF-8.

I guess the Python people made the same braindamaged mistake though =/

At worst, since Fedora has a policy that files in general should
be UTF-8 encoded, we could carry a javac patch that assumes UTF-8.

Some more information here:
http://stackoverflow.com/questions/1726174/how-to-compile-a-java-source-file-which-is-encoded-as-utf-8

--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel

Doron Fediuck 04-18-2012 01:30 PM

Maven error log due to UTF8 during make rpm
 
On 18/04/12 16:25, Colin Walters wrote:
> ----- Original Message -----
>>
>> When debugging this, we saw that rpmbuild actually sets LANG=C,
>> which disables unicode thus resulting with the error.
>>
>> 2. Any idea how to disable the LANG setting during rpmbuild?
>
> This is a tricky issue; from what I can see of a quick read of
> the JLS, it says that source files should be Unicode; but that's
> not useful here because it doesn't seem to specify the encoding.
>
> Anyways, if the OpenJDK compiler derives "ASCII" from LANG=C
> that's wrong. By default, it should assume input files are UTF-8.
>
> I guess the Python people made the same braindamaged mistake though =/
>
> At worst, since Fedora has a policy that files in general should
> be UTF-8 encoded, we could carry a javac patch that assumes UTF-8.
>
> Some more information here:
> http://stackoverflow.com/questions/1726174/how-to-compile-a-java-source-file-which-is-encoded-as-utf-8
>

Thanks Collin,
It actually makes sense since Java works with Unicode by design.
Please cc me on the javac bz.

--

/d

"Ford," he said, "you're turning into a penguin. Stop it." --Douglas Adams, The Hitchhiker's Guide to the Galaxy
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel

Ville Skytt 04-18-2012 06:50 PM

Maven error log due to UTF8 during make rpm
 
On 04/18/2012 04:24 PM, Doron Fediuck wrote:

On 18/04/12 16:19, Juan Hernandez wrote:



I added this option the maven command line for that very reason:

-Dproject.build.sourceEncoding=ISO-8859-1

Hope it helps!


Thanks Juan,
Looks like a good workaround.


A better thing IMO would be to fix upstream build files to take care of
settings such as this and submit the patches upstream, for example like
this:


http://pkgs.fedoraproject.org/gitweb/?p=maven-jflex-plugin.git;a=commitdiff;h=32f360f009425f75b6b4040c 2925c6e0d15ef33b

http://sf.net/tracker/?func=detail&aid=3475986&group_id=14929&atid=31492 9
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel

Stanislav Ochotnicky 04-19-2012 12:35 PM

Maven error log due to UTF8 during make rpm
 
>A better thing IMO would be to fix upstream build files to take care of
>settings such as this and submit the patches upstream, for example like
>this:
>
>http://pkgs.fedoraproject.org/gitweb/?p=maven-jflex-plugin.git;a=commitdiff;h=32f360f009425f75b6b4040c 2925c6e0d15ef33b
>
>http://sf.net/tracker/?func=detail&aid=3475986&group_id=14929&atid=31492 9

+1 here as well. It's better to fix this for everyone (other distributions
included) since they will likely face the same problems when rebuilding
on a UTF-8 systems.

If the upstream has source files in UTF-8 (or whatever else), they
should make sure their build system knows about this and they shouldn't
rely on system environment to guess

--
Stanislav Ochotnicky <sochotnicky@redhat.com>
Software Engineer - Base Operating Systems Brno

PGP: 7B087241
Red Hat Inc. http://cz.redhat.com
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel


All times are GMT. The time now is 09:53 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.