You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Michele Locati <ml...@gmail.com> on 2023/11/24 11:20:35 UTC

Errors compiling the "schema-1.1" variand of Xerces-J

Hello everybody!

I'm trying to build the JARs for the "schema-1.1" version, to no avail.

In a debian:bookworm Docker contanier, here's what I do:


# Setup a sane environment
LC_ALL=C.UTF-8
export LC_ALL

# Update system packages
apt-get update -q && apt-get upgrade -qy

# Install required system packages
apt-get install -qy curl openjdk-17-jdk-headless

# Set JAVA_HOME
JAVA_HOME="$(dirname "$(dirname "$(readlink -f "$(which java)")")")"
export JAVA_HOME

# Setup build directory
mkdir /tmp/build-xerces
cd /tmp/build-xerces

# Download Xerces-J source and build tools
curl -sSL https://dlcdn.apache.org/xerces/j/source/Xerces-J-src.2.12.2-xml-schema-1.1.tar.gz
\
   | tar xz --strip-components=1
curl -sSL https://dlcdn.apache.org/xerces/j/source/Xerces-J-tools.2.12.2-xml-schema-1.1.tar.gz
\
   | tar xz

# Convert CRLF to LF (why does it have CRLF?)
sed -i 's/\r$//' ./build.sh

# Make it executable (why isn't it executable?)
chmod +x ./build.sh

# Create the jars for the "schema-1.1" variant
./build.sh jars-schema11


The compilation fails with errors like this:

package org.eclipse.wst.xml.xpath2.processor does not exist

(see attached file for the full build log).

I also tried using Oracle's jdk-7u80 instead of openjdk-17, with the
same errors (see attached build-jdk7u80.log).

And I also tried cloning the repo with
svn export https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_12_2-xml-schema-1.1
/tmp/build-xerces

Still same results (except that build.sh is now executable and has the
correct line endings).

...any hint?

Thanks!
Michele

Re: Errors compiling the "schema-1.1" variand of Xerces-J

Posted by Mukul Gandhi <mu...@apache.org>.
Hi Michael,

On Sat, Nov 25, 2023 at 9:38 PM Michael Glavassevich <mr...@gmail.com> wrote:
> I can’t actually check any of this right now as I’m travelling, but pretty sure the Xerces-J build is still using a custom Ant task that makes adjustments to the classpath. It’s entirely possible it’s doing the wrong thing with more modern versions of Java that have been released since it was last updated. When I last did a Xerces release (years ago), I always compiled Xerces using ancient JDKs (Java 1.3 and 1.4). Hopefully Mukul chimes in on this thread as he would have the most recent knowledge of how we’ve been building releases.

The XercesJ build issues, mentioned by Michele within this mail
thread, have been resolved and committed to XercesJ svn earlier today
(both on trunk, and the branch xml-schema-1.1-dev).


-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


Re: Errors compiling the "schema-1.1" variand of Xerces-J

Posted by Michael Glavassevich <mr...@gmail.com>.
I can’t actually check any of this right now as I’m travelling, but pretty sure the Xerces-J build is still using a custom Ant task that makes adjustments to the classpath. It’s entirely possible it’s doing the wrong thing with more modern versions of Java that have been released since it was last updated. When I last did a Xerces release (years ago), I always compiled Xerces using ancient JDKs (Java 1.3 and 1.4). Hopefully Mukul chimes in on this thread as he would have the most recent knowledge of how we’ve been building releases. 

> On Nov 25, 2023, at 8:47 AM, Michele Locati <ml...@gmail.com> wrote:
> 
> 
>> 
>> The compilation fails with errors like this:
>> 
>> package org.eclipse.wst.xml.xpath2.processor does not exist
> 
> Am I doing something wrong when I generate the jars as I described at
> https://lists.apache.org/thread/o3s5bp5rj4hbwdmzf1bwklxl7mxqo1vx ?
> 
> If so, what should I do instead?
> 
> Otherwise, I'm wondering how the binary files available at
> https://xerces.apache.org/mirrors.cgi#binary have been built without
> this patch...
> But I managed to build the jars with "build.sh jars-schema11" after
> the changes described in the attached fix-build-jars-schema11.patch
> file.
> Could someone with write access merge them (I think in the
> xml-schema-1.1-dev branch).
> 
> Also, could you please apply the changes in the attached
> fix-build.sh-eol.patch file?
> That way, the build.sh file will always have posix line endings (in
> particular, think at the case when the distribution files are built on
> a Windows machine).
> 
> Thank you!
> Michele
> <fix-build-jars-schema11.patch>
> <fix-build.sh-eol.patch>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


Re: Errors compiling the "schema-1.1" variand of Xerces-J

Posted by Michele Locati <ml...@gmail.com>.
Il giorno lun 27 nov 2023 alle ore 12:37 Mukul Gandhi
<mu...@apache.org> ha scritto:

> Please verify and let us know, if these XercesJ codebase changes, have
> resolved the issues you've been facing.

Yep: now setting LC_ALL to C.UTF-8 is no more needed: after
https://github.com/mlocati/compile-xercesj-schema-1.1/commit/e6f1a3e032c616d53f509549edc4883b65920969
we correctly have
https://github.com/mlocati/compile-xercesj-schema-1.1/actions/runs/7005375371/job/19054982821

Also, when checking out the repository on Windows, the build.sh file
has the line endings expected for posix environments.

Thanks!
--
Michele

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


Re: Errors compiling the "schema-1.1" variand of Xerces-J

Posted by Mukul Gandhi <mu...@apache.org>.
Hi Michele,
   As requested by you, I've just committed the XercesJ codebase
changes (to the file XS11CMRestriction.java, on branch
xml-schema-1.1-dev), and to linux build scripts on trunk and to the
branch xml-schema-1.1-dev.

After these XercesJ codebase changes, as a sanity check, I've been
able to successfully do XercesJ builds locally (both from trunk and
branch xml-schema-1.1-dev) with command 'build clean all'.

Please verify and let us know, if these XercesJ codebase changes, have
resolved the issues you've been facing.

On Mon, Nov 27, 2023 at 4:11 PM Michele Locati <ml...@gmail.com> wrote:
> Yep, now I'm able to compile the schema-1.1 version Xerces-J by using
> the xml-schema-1.1-dev branch!
>
> I also created a GitHub Action that does it: you can see the steps I do at
> https://github.com/mlocati/compile-xercesj-schema-1.1/blob/main/.github/workflows/compile.yml
>
> And you can see at
> https://github.com/mlocati/compile-xercesj-schema-1.1/actions
> everything works, thank you!
>
> Just a couple of notes though.
>
> First of all, could you change the svn:eol-style property of the
> build.sh file from "native" to "LF"?
> I'm asking because I think the source distribution files available at
> https://xerces.apache.org/mirrors.cgi#source have been built using
> Windows, so the build.sh script included in those tarballs have
> Windows line endings, and that breaks shell scripts.
> Indeed, if I try to execute the build.sh script included in those
> tarballs I have this error:
>
> : not found 20:
> : not found 21: echo
> Xerces-Java Build System
> ------------------------
> : not found 24:
> ./build.sh: 35: Syntax error: word unexpected (expecting "in")
>
> In order to fix it, I have to replace \r\n with \n, for example with
> sed -i 's/\r$//' ./build.sh
>
>
> Furthermore, there are two "strange" characters in
> src/org/apache/xerces/impl/xs/models/XS11CMRestriction.java that break
> the compilation unless you launch build.sh with the LC_ALL environment
> variable set to C.UTF-8 (see for example
> https://github.com/mlocati/compile-xercesj-schema-1.1/actions/runs/7003512616/job/19049394085
> ).
> Since those two strange characters are in comments, I think we can
> safely remove them (see attached
> remove-strange-chars-from-XS11CMRestriction.java.patch).
>
> Thank you again!
> Michele


-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


Re: Errors compiling the "schema-1.1" variand of Xerces-J

Posted by Michele Locati <ml...@gmail.com>.
Il giorno lun 27 nov 2023 alle ore 08:59 Mukul Gandhi
<mu...@apache.org> ha scritto:
> You may please take latest XercesJ svn updates, and let us know,
> whether the XercesJ build issues that you were experiencing have been
> resolved.

Hi Mukul, thanks for the quick feedback!

Yep, now I'm able to compile the schema-1.1 version Xerces-J by using
the xml-schema-1.1-dev branch!

I also created a GitHub Action that does it: you can see the steps I do at
https://github.com/mlocati/compile-xercesj-schema-1.1/blob/main/.github/workflows/compile.yml

And you can see at
https://github.com/mlocati/compile-xercesj-schema-1.1/actions
everything works, thank you!

Just a couple of notes though.

First of all, could you change the svn:eol-style property of the
build.sh file from "native" to "LF"?
I'm asking because I think the source distribution files available at
https://xerces.apache.org/mirrors.cgi#source have been built using
Windows, so the build.sh script included in those tarballs have
Windows line endings, and that breaks shell scripts.
Indeed, if I try to execute the build.sh script included in those
tarballs I have this error:

: not found 20:
: not found 21: echo
Xerces-Java Build System
------------------------
: not found 24:
./build.sh: 35: Syntax error: word unexpected (expecting "in")

In order to fix it, I have to replace \r\n with \n, for example with
sed -i 's/\r$//' ./build.sh


Furthermore, there are two "strange" characters in
src/org/apache/xerces/impl/xs/models/XS11CMRestriction.java that break
the compilation unless you launch build.sh with the LC_ALL environment
variable set to C.UTF-8 (see for example
https://github.com/mlocati/compile-xercesj-schema-1.1/actions/runs/7003512616/job/19049394085
).
Since those two strange characters are in comments, I think we can
safely remove them (see attached
remove-strange-chars-from-XS11CMRestriction.java.patch).

Thank you again!
Michele

Re: Errors compiling the "schema-1.1" variand of Xerces-J

Posted by Mukul Gandhi <mu...@apache.org>.
Hi Michele,

On Sat, Nov 25, 2023 at 9:17 PM Michele Locati <ml...@gmail.com> wrote:
>
> > The compilation fails with errors like this:
> >
> > package org.eclipse.wst.xml.xpath2.processor does not exist
>
> Am I doing something wrong when I generate the jars as I described at
> https://lists.apache.org/thread/o3s5bp5rj4hbwdmzf1bwklxl7mxqo1vx ?
>
> If so, what should I do instead?
>
> Otherwise, I'm wondering how the binary files available at
> https://xerces.apache.org/mirrors.cgi#binary have been built without
> this patch...

The XercesJ build issues that you've described, have now been fixed on
XercesJ svn (both on trunk, and the branch xml-schema-1.1-dev). I've
used the improvements available within your XercesJ svn patch file
fix-build-jars-schema11.patch, to resolve these issues (many thanks
for that).

I've tested these XercesJ build improvements, both on windows and
linux environments, using JDK 1.7 (that's the Java language level,
that XercesJ currently supports as minimum, for the XercesJ build
binaries that are produced).

You may please take latest XercesJ svn updates, and let us know,
whether the XercesJ build issues that you were experiencing have been
resolved.

About the question,
"Otherwise, I'm wondering how the binary files available at
https://xerces.apache.org/mirrors.cgi#binary have been built without
this patch"

this could be done, using either of following two XercesJ build
commands : build.bat all (for windows), build.sh all (for linux).


-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


Re: Errors compiling the "schema-1.1" variand of Xerces-J

Posted by Michele Locati <ml...@gmail.com>.
> The compilation fails with errors like this:
>
> package org.eclipse.wst.xml.xpath2.processor does not exist

Am I doing something wrong when I generate the jars as I described at
https://lists.apache.org/thread/o3s5bp5rj4hbwdmzf1bwklxl7mxqo1vx ?

If so, what should I do instead?

Otherwise, I'm wondering how the binary files available at
https://xerces.apache.org/mirrors.cgi#binary have been built without
this patch...
But I managed to build the jars with "build.sh jars-schema11" after
the changes described in the attached fix-build-jars-schema11.patch
file.
Could someone with write access merge them (I think in the
xml-schema-1.1-dev branch).

Also, could you please apply the changes in the attached
fix-build.sh-eol.patch file?
That way, the build.sh file will always have posix line endings (in
particular, think at the case when the distribution files are built on
a Windows machine).

Thank you!
Michele