[Scons-users] TryRun() problem with python3 scons-3.0.1
Bill Deegan
bill at baddogconsulting.com
Sun Mar 11 21:26:18 EDT 2018
Andrew,
You should be able to omit SCONS_LIB_DIR in the following:
SCONS_LIB_DIR=$(pwd)/../../oss/scons/src/engine /usr/local/bin/python3
../../oss/scons/src/script/scons.py
So just:
/usr/local/bin/python3 ../../oss/scons/src/script/scons.py
Should work, unless you have scons installed in that python3 tree
I'll clone your repo and take a look.
-Bill
On Sun, Mar 11, 2018 at 5:33 PM, Andrew C. Morrow <andrew.c.morrow at gmail.com
> wrote:
>
> Hi Bill -
>
> Unfortunately, not yet.
>
> I just ran into this on Tuesday, spent a little time trying to debug it
> and failing, and then I wasn't working on it for a few days. When I saw the
> post here with the same error I chimed in since perhaps it is a related
> issue.
>
> While I could try to work on a smaller repro, I wonder if a better
> approach would be to monkey with the exception throwing mechanism or base
> exception type so we can log a stacktrace or do something else when the
> error occurs? Otherwise, since we don't get a backtrace and
> --debug=stacktrace does nothing, it is quite hard to see a way to debug it.
> I'm not the best at py debugging, so I'm happy to try out any suggestions
> you might have for how to hook into the error when it happens.
>
> Thanks,
> Andrew
>
>
> On Sun, Mar 11, 2018 at 7:33 PM, Bill Deegan <bill at baddogconsulting.com>
> wrote:
>
>> Nothing smaller than the whole mongodb build tree?..
>>
>> On Sun, Mar 11, 2018 at 4:26 PM, Andrew C. Morrow <
>> andrew.c.morrow at gmail.com> wrote:
>>
>>>
>>> Hi Bill -
>>>
>>> Here is a repro for me.
>>>
>>> You will need to clone https://github.com/acmorrow/mo
>>> ngo/tree/SERVER-32295. This is a work-in-progress branch for adding py3
>>> support to the mongodb build system. I'm using SCons from git, currently
>>> checked out to 867f762f6c1e23524cd1b0262b8e93e822b23d0c. I'm using
>>> python 3.6.4 from homebrew on OS X 10.13.
>>>
>>> The following command fails:
>>>
>>> $ SCONS_LIB_DIR=$(pwd)/../../oss/scons/src/engine
>>> /usr/local/bin/python3 ../../oss/scons/src/script/scons.py -j8 --dbg=on
>>> --opt=off --ssl --link-model=dynamic CPPPATH="/usr/local/include
>>> /usr/local/include/libbson-1.0 /usr/local/include/libmongoc-1.0
>>> /usr/local/opt/openssl/include" LIBPATH="/usr/local/lib
>>> /usr/local/opt/openssl/lib" --implicit-cache MONGO_VERSION=3.7.1-pre
>>> --variables-files= --cache
>>> scons: Reading SConscript files ...
>>> Mkdir("build/scons")
>>> scons version: __VERSION__
>>> python version: 3 6 4 final 0
>>> Checking whether the C compiler works... yes
>>> Checking whether the C++ compiler works... yes
>>> Checking that the C++ compiler can link a C++ program... yes
>>> Checking if C++ compiler "g++" is GCC... no
>>> Checking if C++ compiler "g++" is clang... yes
>>> Checking if C compiler "gcc" is clang... yes
>>> Detected a x86_64 processor
>>> Checking if target OS macOS is supported by the toolchain... yes
>>> Checking if C compiler is clang 3.8 (or Apple XCode 8.3.2) or newer...*TypeError
>>> : sequence item 0: expected str instance, bytes found*
>>>
>>> If I remove the --cache argument, the build runs (at least, it gets a
>>> lot further along, making it all the way through configure and starting to
>>> build targets, before failing for other reasons):
>>>
>>> SCONS_LIB_DIR=$(pwd)/../../oss/scons/src/engine /usr/local/bin/python3
>>> ../../oss/scons/src/script/scons.py -j8 --dbg=on --opt=off --ssl
>>> --link-model=dynamic CPPPATH="/usr/local/include
>>> /usr/local/include/libbson-1.0 /usr/local/include/libmongoc-1.0
>>> /usr/local/opt/openssl/include" LIBPATH="/usr/local/lib
>>> /usr/local/opt/openssl/lib" --implicit-cache MONGO_VERSION=3.7.1-pre
>>> --variables-files=
>>> scons: Reading SConscript files ...
>>> Mkdir("build/scons")
>>> scons version: __VERSION__
>>> python version: 3 6 4 final 0
>>> Checking whether the C compiler works... yes
>>> Checking whether the C++ compiler works... yes
>>> Checking that the C++ compiler can link a C++ program... yes
>>> Checking if C++ compiler "g++" is GCC... no
>>> Checking if C++ compiler "g++" is clang... yes
>>> Checking if C compiler "gcc" is clang... yes
>>> Detected a x86_64 processor
>>> Checking if target OS macOS is supported by the toolchain... yes
>>> Checking if C compiler is clang 3.8 (or Apple XCode 8.3.2) or newer...yes
>>> Checking if C++ compiler is clang 3.8 (or Apple XCode 8.3.2) or
>>> newer...yes
>>> Checking for sufficient macOS target version minimum... yes
>>> Checking if C compiler supports -Wno-unused-local-typedefs... yes
>>> Checking if C compiler supports -Wno-unused-function... yes
>>> Checking if C compiler supports -Wno-unused-private-field... yes
>>> Checking if C compiler supports -Wno-deprecated-declarations... yes
>>> Checking if C compiler supports -Wno-tautological-constant-out-of-range-compare...
>>> yes
>>> Checking if C compiler supports -Wno-unused-const-variable... yes
>>> Checking if C compiler supports -Wno-unused-but-set-variable... no
>>> ...
>>>
>>> Can you give that a try and see it you can repro? I'll bet it probably
>>> is something incomplete in the py3 port on the mongodb side, rather than
>>> the SCons side, but without a stacktrace it is proving hard to find.
>>>
>>> Thanks,
>>> Andrew
>>>
>>>
>>>
>>> On Sun, Mar 11, 2018 at 11:59 AM, Bill Deegan <bill at baddogconsulting.com
>>> > wrote:
>>>
>>>> Can someone provide a small reproducer?
>>>>
>>>> -Bill
>>>>
>>>> On Sun, Mar 11, 2018 at 3:42 AM, Dave Plater <dplater.list at gmail.com>
>>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> On 10/03/18 22:26, Bill Deegan wrote:
>>>>>
>>>>>> Can you try changing:
>>>>>>
>>>>>> outputStr =SCons.Util.to_str(output.get_contents())
>>>>>>
>>>>>> to
>>>>>>
>>>>>> outputStr =SCons.Util.to_str(output.get_text_contents())
>>>>>>
>>>>>> in SCons/SConf.py around line 646 in TryRun()?
>>>>>> And see if that resolves the issue..
>>>>>>
>>>>>> -Bill
>>>>>>
>>>>>>
>>>>> Hi Bill, it doesn't resolve the issue but I did go further and
>>>>> inserted a couple of print statements into TryBuild where it goes wrong.
>>>>> The result of (the first line is about line 584 in SConf.py):
>>>>> nodes = builder(target = target, source = source)
>>>>> print("\nnodes = ",nodes)
>>>>> if not SCons.Util.is_List(nodes):
>>>>> nodes = [nodes]
>>>>> print("\n[nodes] = ",nodes)
>>>>> nodesToBeBuilt.extend(nodes)
>>>>> result = self.BuildNodes(nodesToBeBuilt)
>>>>> print("\nresult = ",result)
>>>>>
>>>>> This results in :
>>>>> Checking for a working C-compiler TryLink
>>>>>
>>>>> nodes = ['cache/conftest_0']
>>>>>
>>>>> TypeError : sequence item 0: expected str instance, bytes found
>>>>>
>>>>> Thanks
>>>>> Dave
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Scons-users mailing list
>>>> Scons-users at scons.org
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180311/b789bb50/attachment.html>
More information about the Scons-users
mailing list