ice icon indicating copy to clipboard operation
ice copied to clipboard

Load slice improvements

Open pepone opened this issue 3 weeks ago • 1 comments

This PR improves loadSlice to avoid redefining types, when there are multiple loadSlice calls.

We always run Slice compiler for all the given Slice files, this return a list of code fragments each correspond to a Python module or package. We only compile the new code fragments.

pepone avatar Dec 10 '25 19:12 pepone

How do we handle the following (did it work before and does it work now):

In 3.7 we have --all which instruct IcePy to also generate code for included files. With 3.7 if you use --all you don't have to worry about compile included files.

So for 3.7 you can do:

Ice.loadSlice("--all A.ice")
Ice.loadSlice("--all B.ice")

In 3.8 you have to explicitly give all the required files.

Ice.loadSlice(["C.ice", "A.ice", "B.ice"])

or

Ice.loadSlice(["C.ice")
Ice.loadSlice(["A.ice")
Ice.loadSlice(["B.ice")

or with the fix in this PR:

Ice.loadSlice(["C.ice", "A.ice"])
Ice.loadSlice(["C.ice", "B.ice"]) # C definitions don't get recompiled

pepone avatar Dec 10 '25 21:12 pepone