[Scons-users] problem with new Jar builder-wrapper in 3.0.1

Mats Wichmann mats at wichmann.us
Thu Nov 16 14:33:53 EST 2017


Per the instructions still on the scons.org page, I'm emailing this here
prior to filing a ticket.

When I tried our build with 3.0.1., the CI builders for the java
versions tipped over.

The error message looks like this:

TypeError: coercing to Unicode: need string or buffer, list found:

the relevant bit of the backtrace seems to be:

15:34:53   File
"/home/jenkins-ci/workspace/iotivity-verify-linux_secured_with_java/java/examples-java/simpleclient/SConscript",
line 25:
15:34:53     example_jar = jdk_env.Jar(target='simpleclient.jar',
source=[simpleclient_classes, 'MANIFEST.MF'])
15:34:53   File
"/home/jenkins-ci/workspace/iotivity-verify-linux_secured_with_java/scons-local/scons-local-3.0.1/SCons/Environment.py",
line 224:
15:34:53     return self.method(*nargs, **kwargs)
15:34:53   File
"/home/jenkins-ci/workspace/iotivity-verify-linux_secured_with_java/scons-local/scons-local-3.0.1/SCons/Tool/jar.py",
line 174:
15:34:53     if os.path.isfile(s):
15:34:53   File "/usr/lib/python2.7/genericpath.py", line 29:
15:34:53     st = os.stat(path)


The code in question in scons in Tool/jar.py is brand new:

    """
    A pseudo-Builder wrapper around the separate Jar sources{File,Dir}
    Builders.
    """

The invocation that triggered the failure looked like this:

simpleclient_classes = jdk_env.Java(target='classes',
source=['src/main/java'])
example_jar = jdk_env.Jar(target='simpleclient.jar',
source=[simpleclient_classes, 'MANIFEST.MF'])

(the second line is the one from the traceback)

so the return from the Java builder is passed to Jar as part of the
source list, but the new code does not appear to expect the type it is
passed as a result.  It's not clear if our call to Jar is illegal, but
it worked fine through 3.0.0.  It *looks* like the intent is not to do
it the way we do, since the preceding call to the Java builder seems
unnecessary per this doc snippet:

"Any .java files in the source list will be compiled to .class files by
calling the Java Builder. "

So it would be good to figure out if this is a new bug in jar.py, or if
the documentation should be explicit about disallowing the way we are
calling it, which at least to my reading it is not explicit about.

thanks,

-- mats



More information about the Scons-users mailing list