Archived
This forum has been archived. Please start a new discussion on GitHub.
ICE 2.1: slice2java compiler regression?
Hi,
It was great news when ICE 2.1 is born, thanks for the Java SSL support!
Alas, our first steps when into an unexpected wall as none of our build procedures are working due to some change in the slice2java compiler!
We have tracked down the problem to the following assessment:
Our project directory structure uses a 'ice' directory for slice definitions and a 'freeze' directory for objects that need to use the BerkeleyDB persistency.
We generate the Java classes in a directory 'icesrc'.
With 2.0, commands like:
did the job.
With 2.1, the same command issue an error:
Certainly, the way arguments are parsed have changed.
Trying a supposedly better command like:
Does it be possible that multiple -I are no longer supported?
It was great news when ICE 2.1 is born, thanks for the Java SSL support!
Alas, our first steps when into an unexpected wall as none of our build procedures are working due to some change in the slice2java compiler!
We have tracked down the problem to the following assessment:
Our project directory structure uses a 'ice' directory for slice definitions and a 'freeze' directory for objects that need to use the BerkeleyDB persistency.
We generate the Java classes in a directory 'icesrc'.
With 2.0, commands like:
slice2java --output-dir icesrc -Iice ice/*.ice -Ifreeze freeze/*.ice
did the job.
With 2.1, the same command issue an error:
slice2java: input files must end with `.ice'
Certainly, the way arguments are parsed have changed.
Trying a supposedly better command like:
slice2java --output-dir icesrc -Iice -Ifreeze ice/*.ice freeze/*.iceRaises another kind of error (xxx, yyy, zzz are fake names):
freeze/xxx.ice:9: yyy.ice: No such file or directory freeze/xxx.ice:29: `zzz' is not definedMore interestingly, when using only one source directory at one time like in:
slice2java --output-dir icesrc -Iice -Ifreeze ice/*.ice freeze/*.ice (OK ) slice2java --output-dir icesrc -Iice -Ifreeze freeze/*.ice (KO!)shows that there must be something different in the way includes are searched (we allow definitions in freeze/ to include files from ice/ but not the opposite).
Does it be possible that multiple -I are no longer supported?
0
Comments
-
More (strange) info.
We have a basic ant test file that DO work:<?xml version="1.0" encoding="UTF-8"?> <project name="SLICE2JAVA" default="generate.proxies" basedir="."> <target name="generate.proxies"> <delete dir="icesrc"/> <mkdir dir="icesrc"/> <exec executable="slice2java"> <arg line="--output-dir icesrc -Iice -Ifreeze ice/*.ice freeze/*.ice"/> </exec> </target> </project>
The command line:
slice2java --output-dir icesrc -Iice -Ifreeze ice/*.ice freeze/*.ice
still issue errors when launch from a windows console.
Hope that helps0 -
Thanks for the bug report. We will look into this asap.0
-
Command line option parsing indeed changed a bit, the options now need to appear first, before the arguments. However, the following should work and I don't understand why it doesn't work for you:
slice2java --output-dir icesrc -Iice -Ifreeze ice/*.ice freeze/*.ice
I've tried to reproduce it with a similar directory structure and I don't have any issues. Here's the slice files I used to try to reproduce:A/base.ice: ------------ module M { interface Base { }; }; A/a.ice: -------- #include <base.ice> module M { interface A extends Base { }; }; B/b.ice: -------- #include <a.ice> module M { interface B extends A {}; };
I can translate these slice files without any problems with:$ slice2java --output-dir classes -IA -IB A/*.ice B/*.ice
Can you perhaps send us a similar test case which would allow us to reproduce the problem or tell us how your slice files differ from the test case above?
Thanks!
Benoit.0 -
I have just posted a patch for this at http://www.zeroc.com/vbulletin/showthread.php?t=1256. My apologies for this -- I recently refactored all our code that parses command-line options and got a bit carried away on the error checking. The new parser is less fascist than the old one
This version continues to parse for options that follow arguments. For example,slice2cpp -I. x.ice -I.. y.ice
will compile both x.ice and y.ice, using both . and .. as the include search path for each of them.
Cheers,
Michi.
Cheers,
Michi.0