Re: Possible python 3 issue?
Peter Diener <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <[email protected]> |
Thanks a lot, Bill. That fixes it for me as well. Both in the test case and in my larger software project. I found the code example for finding the module path online when I decided to switch to variantdir. I don't remember if the example used duplicate=0 or not, so I don't know if the map was necessary in that case. Obviously, I have not done enough python 3 programming to know that there was such a subtle difference in the behavior of map. Cheers, Peter On Wednesday 2019-10-16 13:21, Bill Deegan wrote: >Date: Wed, 16 Oct 2019 13:21:28 >From: Bill Deegan <[email protected]> >Reply-To: SCons users mailing list <[email protected]> >To: SCons users mailing list <[email protected]> >Subject: Re: [Scons-users] Possible python 3 issue? > >Peter, > >If you change line 26 in src/SConscript to the following it will work: > # Return the list of module paths > return list(buildmodpath) > >The issue is you're assigning *PATH = map().. which is fine in py27, but in >py3, you get a view into the map. (It does lazyier evaluation). >So by wrapping with list() you get a normal list and everything works >fine... > >In fact.. I don't think you actually need the map.. (which you shouldn't as >with duplicate=0 it'd have to include the build and src versions of the >paths you specify) >If I change the return to return modpath, it seems to build fine as well. > >-Bill > > >On Wed, Oct 16, 2019 at 10:26 AM Bill Deegan <[email protected]> >wrote: > so sounds like a scanner issue then.. could it be using > get_contents, instead of get_text_contents? > >On Wed, Oct 16, 2019 at 9:29 AM Mats Wichmann <[email protected]> >wrote: > On 10/16/19 10:04 AM, Peter Diener wrote: > > Hi, > > > > I have been successfully using scons 3.1.0 with python > 2.7.12 to build a > > mostly Fortran based software project on Linux (multiple > distributions). > > I have the source tree separated from the build > directory and are > > therefore using variantdir and an SConscript file. > Recently I tried to > > run this with python 3.7.4 and found that it did not > work as scons > > failed to correctly find the dependencies on module > files. > > > > I was able to reproduce this with a smaller test example > that mimics the > > setup in my larger software project. I have attached a > zip file with > > that source tree as well as build log files (in > build_log.2.7.12 and > > build_log.3.7.4) with all errors and output when > building with > > scons --tree=all. As can be seen from the build log > files, when building > > with python 3, scons does not seem to find the > dependencies of the main > > program on the module files. > > > > I have also tried with the latest release version of > scons 3.1.1 with > > the same results. It works with python 2 but not with > python 3. > > > > So my question is: am I doing something wrong in my > SConstruct and > > SConscript files that just happens to work with python 2 > and not with > > python 3? Or is this a problem with scons and python 3? > > Possibly a bit of both. There's an existing scons issue > that points out > some weakness in submodule support (#3366), and given that > Fortran isn't > the most heavily used language in the scons universe, > there may still be > untested code paths in the conversion to Python 3, that > don't get > exercised by what's in the test suite (there are some > fairly new tests > in that area, which you know since you contributed there > :) ) > _______________________________________________ > Scons-users mailing list > [email protected] > https://pairlist4.pair.net/mailman/listinfo/scons-users > > > _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users