Discussion:
[Scons-users] moving from 2.5.1 to 3.0.1
Rob Boehne
2018-05-03 20:11:43 UTC
Permalink
All,

I’d love to bump up my scons version from 2.5.1 to 3.0.1, and then perhaps migrate to python 3.
At present, with python 2.7 I get an exception in a project that builds when the version of SCons is the only differenceSC :

scons: Reading SConscript files ...
AttributeError: <class 'SCons.Node.FS.File'> object has no attribute 'upper':
File "C:\Users\robb\Development\apdfl-sandbox\DLE\SConstruct", line 1541:
env['EXCLUDEDOCLET'] = docletenv.Jar('$BUILDDIR/Tools.jar', excludejava, JARCHDIR=excludejava[0].dir.path)
File "c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Tool\jar.py", line 169:
target_classes.extend(file_to_class(s))
File "c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Tool\jar.py", line 143:
if(str(_my_normcase(s)).endswith(java_suffix)):
File "c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Node\FS.py", line 366:
return x.upper()
File "c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Node\FS.py", line 632:
(self.__class__, attr))
Build completed with status 2

The jar tool seems to have had a major overhaul, and it appears this might be windows-specific (we use all the platforms ☺).
A snippet of the SConstruct for (some) context:

docletenv = env.Clone(JAVACFLAGS='-classpath "$JDKROOT/lib/tools.jar"')
excludejava = docletenv.Java('$BUILDDIR/excludedoclet/classes', '#Tools/excludedoclet/src')
env['EXCLUDEDOCLET'] = docletenv.Jar('$BUILDDIR/Tools.jar', excludejava, JARCHDIR=excludejava[0].dir.path)

My guess is that I’m passing something incorrectly, but it just happens to work in 2.5.1 – any thoughts?

Thanks,

Rob



[cid:***@01D3D0E3.DCFE6710]

Rob Boehne
Senior Software Architect | Datalogics, Inc.
+1.312.853.8351<tel:(312)%20853-8351> | ***@datalogics.com<mailto:***@datalogics.com>
datalogics.com<http://www.datalogics.com/> | blogs.datalogics.com<http://blogs.datalogics.com/>

Connect with us: Facebook<https://www.facebook.com/DatalogicsInc> | Twitter<https://twitter.com/DatalogicsInc> | LinkedIn<https://www.linkedin.com/company/datalogics?actionToken=p=p%3Dbiz-company-login%26c%3D3217e65a-bdc2-4b38-8f9c-13c982e8c529%26m%3Dcompany_feed%26n%3D0&t=a%3DisFolloweeOfPoster%253Dfalse%2526distanceFromActor%253D-1%2526actorType%253D%2526likedByUser%253Dfalse%2526targetId%253D%2526recentCommentUrns%253D%2526targetType%253D%2526sponsoredFlag%253DORGANIC%2526verbType%253Dlinkedin%25253Ashare%2526objectType%253Dlinkedin%25253Aarticle%2526totalShares%253D0%2526activityId%253Durn%25253Ali%25253Aactivity%25253A6263731876121362433%2526recentLikerUrns%253D%2526actorId%253Durn%25253Ali%25253Acompany%25253A14000%2526totalComments%253D0%2526relevanceScore%253D0.0%2526recentCommenterUrns%253D%2526isPublic%253Dtrue%2526time%253D-1%2526totalLikes%253D0%2526objectId%253Durn%25253Ali%25253Aarticle%25253A7793179909183391510%2526distanceFromNestedActor%253D-1%26s%3DORG> | YouTube<https://www.youtube.com/user/Datalogics>
Daniel Moody
2018-05-03 20:28:30 UTC
Permalink
Hey Rob,

This could be a bug. I think that line 143 in jar.py should convert to str
first then normalize case.

So maybe it should instead be:

if(_my_normcase(str(s)).endswith(java_suffix)):

Do you get the same issue with the latest version of master from github?

Also I would like to capture what you did to add this case to the
regression tests. Could you send a sample that reproduces it?

Best regards,
Post by Rob Boehne
All,
I’d love to bump up my scons version from 2.5.1 to 3.0.1, and then perhaps
migrate to python 3.
At present, with python 2.7 I get an exception in a project that builds
scons: Reading SConscript files ...
env['EXCLUDEDOCLET'] = docletenv.Jar('$BUILDDIR/Tools.jar',
excludejava, JARCHDIR=excludejava[0].dir.path)
File
"c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Environment.py",
return self.method(*nargs, **kwargs)
File
"c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Tool\jar.py",
target_classes.extend(file_to_class(s))
File
"c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Tool\jar.py",
File
"c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Node\FS.py",
return x.upper()
File
"c:\Users\robb\Development\apdfl-sandbox\python-env-robb-win10\scons-3.0.1\SCons\Node\FS.py",
(self.__class__, attr))
Build completed with status 2
The jar tool seems to have had a major overhaul, and it appears this might
be windows-specific (we use all the platforms ☺).
docletenv = env.Clone(JAVACFLAGS='-classpath "$JDKROOT/lib/tools.jar"')
excludejava = docletenv.Java('$BUILDDIR/excludedoclet/classes',
'#Tools/excludedoclet/src')
env['EXCLUDEDOCLET'] = docletenv.Jar('$BUILDDIR/Tools.jar',
excludejava, JARCHDIR=excludejava[0].dir.path)
My guess is that I’m passing something incorrectly, but it just happens to
work in 2.5.1 – any thoughts?
Thanks,
Rob
*Rob Boehne*
Senior Software Architect | Datalogics, Inc.
datalogics.com <http://www.datalogics.com/> | blogs.datalogics.com
Connect with us: Facebook <https://www.facebook.com/DatalogicsInc> |
Twitter <https://twitter.com/DatalogicsInc> | LinkedIn
<https://www.linkedin.com/company/datalogics?actionToken=p=p%3Dbiz-company-login%26c%3D3217e65a-bdc2-4b38-8f9c-13c982e8c529%26m%3Dcompany_feed%26n%3D0&t=a%3DisFolloweeOfPoster%253Dfalse%2526distanceFromActor%253D-1%2526actorType%253D%2526likedByUser%253Dfalse%2526targetId%253D%2526recentCommentUrns%253D%2526targetType%253D%2526sponsoredFlag%253DORGANIC%2526verbType%253Dlinkedin%25253Ashare%2526objectType%253Dlinkedin%25253Aarticle%2526totalShares%253D0%2526activityId%253Durn%25253Ali%25253Aactivity%25253A6263731876121362433%2526recentLikerUrns%253D%2526actorId%253Durn%25253Ali%25253Acompany%25253A14000%2526totalComments%253D0%2526relevanceScore%253D0.0%2526recentCommenterUrns%253D%2526isPublic%253Dtrue%2526time%253D-1%2526totalLikes%253D0%2526objectId%253Durn%25253Ali%25253Aarticle%25253A7793179909183391510%2526distanceFromNestedActor%253D-1%26s%3DORG>
| YouTube <https://www.youtube.com/user/Datalogics>
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Loading...