Discussion:
[Scons-users] TryRun() problem with python3 scons-3.0.1
Dave Plater
2018-03-08 13:59:35 UTC
Permalink
Hi, I'm battling to find why these SConstruct sections fails with
"TypeError : sequence item 0: expected str instance, bytes found"

def CompilerCheck( context ):
context.Message( "Checking for a working C-compiler " )
ret = context.TryRun( """
#include <stdio.h>

int main() {
printf( "Hello World!" );
return 0;
}""", '.c' ).decode('utf-8')[0]
context.Result( ret )

or

if 'CFLAGS' in env:
oldcf = env['CFLAGS']
else:
oldcf = ""
env.Append(CFLAGS = '-std=c99')
if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);"
).decode('utf-8'):
HAVE_LRINT = 1
else:
HAVE_LRINT = 0
if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);"
).decode('utf-8'):
HAVE_LRINTF = 1
else:
HAVE_LRINTF = 0
env['HAVE_LRINT'] = HAVE_LRINT;
env['HAVE_LRINTF'] = HAVE_LRINTF;
env.Replace(CFLAGS=oldcf)

What am I doing wrong? I've tried suffixing .decode('utf-8') after the
TryRun statement as well.

Thanks
Dave Plater
Andrew C. Morrow
2018-03-08 15:26:48 UTC
Permalink
I ran into this too in a TryCompile while trying to get a project building
with python3 and SCons master, and spent a long time trying to figure out
where I was injecting a bytes type object without success. Interestingly,
it seemed to go away when I disabled CacheDir.
Post by Dave Plater
Hi, I'm battling to find why these SConstruct sections fails with
"TypeError : sequence item 0: expected str instance, bytes found"
context.Message( "Checking for a working C-compiler " )
ret = context.TryRun( """
#include <stdio.h>
int main() {
printf( "Hello World!" );
return 0;
}""", '.c' ).decode('utf-8')[0]
context.Result( ret )
or
oldcf = env['CFLAGS']
oldcf = ""
env.Append(CFLAGS = '-std=c99')
if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);"
HAVE_LRINT = 1
HAVE_LRINT = 0
if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);"
HAVE_LRINTF = 1
HAVE_LRINTF = 0
env['HAVE_LRINT'] = HAVE_LRINT;
env['HAVE_LRINTF'] = HAVE_LRINTF;
env.Replace(CFLAGS=oldcf)
What am I doing wrong? I've tried suffixing .decode('utf-8') after the
TryRun statement as well.
Thanks
Dave Plater
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Dave Plater
2018-03-09 06:06:07 UTC
Permalink
Post by Andrew C. Morrow
I ran into this too in a TryCompile while trying to get a project
building with python3 and SCons master, and spent a long time trying to
figure out where I was injecting a bytes type object without success.
Interestingly, it seemed to go away when I disabled CacheDir.
Things go wrong with TryBuild used by both TryCompile and TryRun but
using --cache-disable doesn't help here.

Dave
Bill Deegan
2018-03-08 16:56:55 UTC
Permalink
Dave,

Can you run with --debug=stacktrace and share the stacktrace?

-Bill
Post by Dave Plater
Hi, I'm battling to find why these SConstruct sections fails with
"TypeError : sequence item 0: expected str instance, bytes found"
context.Message( "Checking for a working C-compiler " )
ret = context.TryRun( """
#include <stdio.h>
int main() {
printf( "Hello World!" );
return 0;
}""", '.c' ).decode('utf-8')[0]
context.Result( ret )
or
oldcf = env['CFLAGS']
oldcf = ""
env.Append(CFLAGS = '-std=c99')
if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);"
HAVE_LRINT = 1
HAVE_LRINT = 0
if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);"
HAVE_LRINTF = 1
HAVE_LRINTF = 0
env['HAVE_LRINT'] = HAVE_LRINT;
env['HAVE_LRINTF'] = HAVE_LRINTF;
env.Replace(CFLAGS=oldcf)
What am I doing wrong? I've tried suffixing .decode('utf-8') after the
TryRun statement as well.
Thanks
Dave Plater
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Dave Plater
2018-03-09 06:02:17 UTC
Permalink
Post by Bill Deegan
Dave,
Can you run with --debug=stacktrace and share the stacktrace?
-Bill
Running with --debug=stacktrace provides nothing more than when it's
not present :
Checking for a working C-compiler TypeError : sequence item 0: expected
str instance, bytes found

Thanks,
Dave
Post by Bill Deegan
Hi, I'm battling to find why these SConstruct sections fails with
"TypeError : sequence item 0: expected str instance, bytes found"
    context.Message( "Checking for a working C-compiler " )
    ret = context.TryRun( """
#include <stdio.h>
int main() {
    printf( "Hello World!" );
    return 0;
}""", '.c' ).decode('utf-8')[0]
    context.Result( ret )
or
        oldcf = env['CFLAGS']
        oldcf = ""
    env.Append(CFLAGS = '-std=c99')
    if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);"
        HAVE_LRINT = 1
        HAVE_LRINT = 0
    if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);"
        HAVE_LRINTF = 1
        HAVE_LRINTF = 0
    env['HAVE_LRINT'] = HAVE_LRINT;
    env['HAVE_LRINTF'] = HAVE_LRINTF;
    env.Replace(CFLAGS=oldcf)
What am I doing wrong? I've tried suffixing .decode('utf-8') after
the TryRun statement as well.
Thanks
Dave Plater
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
<https://pairlist4.pair.net/mailman/listinfo/scons-users>
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Mats Wichmann
2018-03-09 06:06:24 UTC
Permalink
Try stuffing some debug prints in after the true to see what came back.
Post by Dave Plater
Post by Bill Deegan
Dave,
Can you run with --debug=stacktrace and share the stacktrace?
-Bill
Running with --debug=stacktrace provides nothing more than when it's
Checking for a working C-compiler TypeError : sequence item 0: expected
str instance, bytes found
Thanks,
Dave
Post by Bill Deegan
Hi, I'm battling to find why these SConstruct sections fails with
"TypeError : sequence item 0: expected str instance, bytes found"
    context.Message( "Checking for a working C-compiler " )
    ret = context.TryRun( """
#include <stdio.h>
int main() {
    printf( "Hello World!" );
    return 0;
}""", '.c' ).decode('utf-8')[0]
    context.Result( ret )
or
        oldcf = env['CFLAGS']
        oldcf = ""
    env.Append(CFLAGS = '-std=c99')
    if conf.CheckLibWithHeader( "m", "math.h", "c",
"lrint(3.2);"
Post by Bill Deegan
        HAVE_LRINT = 1
        HAVE_LRINT = 0
    if conf.CheckLibWithHeader( "m", "math.h", "c",
"lrintf(3.2);"
Post by Bill Deegan
        HAVE_LRINTF = 1
        HAVE_LRINTF = 0
    env['HAVE_LRINT'] = HAVE_LRINT;
    env['HAVE_LRINTF'] = HAVE_LRINTF;
    env.Replace(CFLAGS=oldcf)
What am I doing wrong? I've tried suffixing .decode('utf-8')
after
Post by Bill Deegan
the TryRun statement as well.
Thanks
Dave Plater
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
<https://pairlist4.pair.net/mailman/listinfo/scons-users>
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Mats Wichmann
2018-03-09 17:16:13 UTC
Permalink
"true"? Darn autocorrect. Put it another way, let's see what is coming back from the calls, before it tips over with a type error.
Post by Mats Wichmann
Try stuffing some debug prints in after the true to see what came back.
Post by Dave Plater
Post by Bill Deegan
Dave,
Can you run with --debug=stacktrace and share the stacktrace?
-Bill
Running with --debug=stacktrace provides nothing more than when it's
expected
Post by Dave Plater
str instance, bytes found
Thanks,
Dave
Post by Bill Deegan
Hi, I'm battling to find why these SConstruct sections fails
with
Post by Dave Plater
Post by Bill Deegan
"TypeError : sequence item 0: expected str instance, bytes
found"
Post by Dave Plater
Post by Bill Deegan
    context.Message( "Checking for a working C-compiler " )
    ret = context.TryRun( """
#include <stdio.h>
int main() {
    printf( "Hello World!" );
    return 0;
}""", '.c' ).decode('utf-8')[0]
    context.Result( ret )
or
        oldcf = env['CFLAGS']
        oldcf = ""
    env.Append(CFLAGS = '-std=c99')
    if conf.CheckLibWithHeader( "m", "math.h", "c",
"lrint(3.2);"
Post by Bill Deegan
        HAVE_LRINT = 1
        HAVE_LRINT = 0
    if conf.CheckLibWithHeader( "m", "math.h", "c",
"lrintf(3.2);"
Post by Bill Deegan
        HAVE_LRINTF = 1
        HAVE_LRINTF = 0
    env['HAVE_LRINT'] = HAVE_LRINT;
    env['HAVE_LRINTF'] = HAVE_LRINTF;
    env.Replace(CFLAGS=oldcf)
What am I doing wrong? I've tried suffixing .decode('utf-8')
after
Post by Bill Deegan
the TryRun statement as well.
Thanks
Dave Plater
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
<https://pairlist4.pair.net/mailman/listinfo/scons-users>
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Bill Deegan
2018-03-10 20:26:44 UTC
Permalink
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
Post by Mats Wichmann
"true"? Darn autocorrect. Put it another way, let's see what is coming
back from the calls, before it tips over with a type error.
Post by Mats Wichmann
Try stuffing some debug prints in after the true to see what came back.
Post by Dave Plater
Post by Bill Deegan
Dave,
Can you run with --debug=stacktrace and share the stacktrace?
-Bill
Running with --debug=stacktrace provides nothing more than when it's
Checking for a working C-compiler TypeError : sequence item 0: expected
str instance, bytes found
Thanks,
Dave
Post by Bill Deegan
Hi, I'm battling to find why these SConstruct sections fails with
"TypeError : sequence item 0: expected str instance, bytes found"
context.Message( "Checking for a working C-compiler " )
ret = context.TryRun( """
#include <stdio.h>
int main() {
printf( "Hello World!" );
return 0;
}""", '.c' ).decode('utf-8')[0]
context.Result( ret )
or
oldcf = env['CFLAGS']
oldcf = ""
env.Append(CFLAGS = '-std=c99')
if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);"
HAVE_LRINT = 1
HAVE_LRINT = 0
if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);"
HAVE_LRINTF = 1
HAVE_LRINTF = 0
env['HAVE_LRINT'] = HAVE_LRINT;
env['HAVE_LRINTF'] = HAVE_LRINTF;
env.Replace(CFLAGS=oldcf)
What am I doing wrong? I've tried suffixing .decode('utf-8') after
the TryRun statement as well.
Thanks
Dave Plater
------------------------------
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
<https://pairlist4.pair.net/mailman/listinfo/scons-users>
------------------------------
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
------------------------------
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Dave Plater
2018-03-11 10:42:26 UTC
Permalink
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
Bill Deegan
2018-03-11 15:59:26 UTC
Permalink
Can someone provide a small reproducer?

-Bill
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.
nodes = builder(target = target, source = source)
print("\nnodes = ",nodes)
nodes = [nodes]
print("\n[nodes] = ",nodes)
nodesToBeBuilt.extend(nodes)
result = self.BuildNodes(nodesToBeBuilt)
print("\nresult = ",result)
Checking for a working C-compiler TryLink
nodes = ['cache/conftest_0']
TypeError : sequence item 0: expected str instance, bytes found
Thanks
Dave
Andrew C. Morrow
2018-03-11 23:26:15 UTC
Permalink
Hi Bill -

Here is a repro for me.

You will need to clone https://github.com/acmorrow/mongo/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
Post by Bill Deegan
Can someone provide a small reproducer?
-Bill
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.
nodes = builder(target = target, source = source)
print("\nnodes = ",nodes)
nodes = [nodes]
print("\n[nodes] = ",nodes)
nodesToBeBuilt.extend(nodes)
result = self.BuildNodes(nodesToBeBuilt)
print("\nresult = ",result)
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2018-03-11 23:33:10 UTC
Permalink
Nothing smaller than the whole mongodb build tree?..
Post by Andrew C. Morrow
Hi Bill -
Here is a repro for me.
You will need to clone https://github.com/acmorrow/mongo/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.
$ 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
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
Post by Bill Deegan
Can someone provide a small reproducer?
-Bill
Post by Dave Plater
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.
nodes = builder(target = target, source = source)
print("\nnodes = ",nodes)
nodes = [nodes]
print("\n[nodes] = ",nodes)
nodesToBeBuilt.extend(nodes)
result = self.BuildNodes(nodesToBeBuilt)
print("\nresult = ",result)
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Andrew C. Morrow
2018-03-12 00:33:34 UTC
Permalink
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
Post by Bill Deegan
Nothing smaller than the whole mongodb build tree?..
On Sun, Mar 11, 2018 at 4:26 PM, Andrew C. Morrow <
Post by Andrew C. Morrow
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.
$ 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
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
Post by Bill Deegan
Can someone provide a small reproducer?
-Bill
Post by Dave Plater
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.
nodes = builder(target = target, source = source)
print("\nnodes = ",nodes)
nodes = [nodes]
print("\n[nodes] = ",nodes)
nodesToBeBuilt.extend(nodes)
result = self.BuildNodes(nodesToBeBuilt)
print("\nresult = ",result)
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2018-03-12 01:26:18 UTC
Permalink
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
Post by Andrew C. Morrow
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
Post by Bill Deegan
Nothing smaller than the whole mongodb build tree?..
On Sun, Mar 11, 2018 at 4:26 PM, Andrew C. Morrow <
Post by Andrew C. Morrow
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.
$ 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
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
Post by Bill Deegan
Can someone provide a small reproducer?
-Bill
Post by Dave Plater
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.
nodes = builder(target = target, source = source)
print("\nnodes = ",nodes)
nodes = [nodes]
print("\n[nodes] = ",nodes)
nodesToBeBuilt.extend(nodes)
result = self.BuildNodes(nodesToBeBuilt)
print("\nresult = ",result)
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2018-03-12 01:27:20 UTC
Permalink
HRm... all the other specified paths aren't going to fly on my machine..
Are they needed to build and/or see the issue?
Post by Bill Deegan
Andrew,
SCONS_LIB_DIR=$(pwd)/../../oss/scons/src/engine /usr/local/bin/python3
../../oss/scons/src/script/scons.py
/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 <
Post by Andrew C. Morrow
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
Post by Bill Deegan
Nothing smaller than the whole mongodb build tree?..
On Sun, Mar 11, 2018 at 4:26 PM, Andrew C. Morrow <
Post by Andrew C. Morrow
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.
$ 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
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 <
Post by Bill Deegan
Can someone provide a small reproducer?
-Bill
Post by Dave Plater
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.
nodes = builder(target = target, source = source)
print("\nnodes = ",nodes)
nodes = [nodes]
print("\n[nodes] = ",nodes)
nodesToBeBuilt.extend(nodes)
result = self.BuildNodes(nodesToBeBuilt)
print("\nresult = ",result)
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Bill Deegan
2018-03-12 01:35:05 UTC
Permalink
O.k. in SConf.py.

line 589:

add
except TypeError as e:
import pdb; pdb.set_trace()

and run with --cache. See if it drops you in the debugger.

I think the issue is this: (using Visual Studio code so apologies for
colorized code below)
sourcetext = self.env.Value(text)



Then change:
def _stringSource( target, source, env ):
return (str(target[0]) + ' <-\n |' +
source[0].get_contents().decode().replace( '\n', "\n |" ) )



to use get_text_contents() ?

SWAG'ing here.. Any chance you can jump on scons IRC on freenode?
Post by Bill Deegan
HRm... all the other specified paths aren't going to fly on my machine..
Are they needed to build and/or see the issue?
Post by Bill Deegan
Andrew,
SCONS_LIB_DIR=$(pwd)/../../oss/scons/src/engine /usr/local/bin/python3
../../oss/scons/src/script/scons.py
/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 <
Post by Andrew C. Morrow
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
Post by Bill Deegan
Nothing smaller than the whole mongodb build tree?..
On Sun, Mar 11, 2018 at 4:26 PM, Andrew C. Morrow <
Post by Andrew C. Morrow
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.
$ 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
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 <
Post by Bill Deegan
Can someone provide a small reproducer?
-Bill
Post by Dave Plater
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.
nodes = builder(target = target, source = source)
print("\nnodes = ",nodes)
nodes = [nodes]
print("\n[nodes] = ",nodes)
nodesToBeBuilt.extend(nodes)
result = self.BuildNodes(nodesToBeBuilt)
print("\nresult = ",result)
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
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Dave Plater
2018-03-12 06:45:14 UTC
Permalink
Post by Bill Deegan
O.k. in SConf.py.
add
   import pdb; pdb.set_trace()
and run with --cache. See if it drops you in the debugger.
I think the issue is this: (using Visual Studio code so apologies for
colorized code below)
sourcetext =self.env.Value(text)
return(str(target[0]) +' <-\n|'+
source[0].get_contents().decode().replace( '\n', "\n|") )
to use get_text_contents() ?
Ok I did this and we seem to be making progress.
I now fail on this:
[ 43s] Checking for a working C-compiler TryLink
[ 43s]
[ 43s] nodes = ['cache/conftest_0']
[ 43s]
[ 43s] result = 0
[ 43s]
[ 43s] _ac_build_counter = 1
[ 43s]
[ 43s] result.end 0
[ 43s] no
[ 43s]
[ 43s] It seems as if your system isn't even able to compile any
C-/C++-programs. Probably you don't have gcc and g++ installed.
Compiling a package from source without a working compiler is very hard
to do, please install the needed packages.
[ 43s] Hint: on *ubuntu you need both gcc- and g++-packages installed,
easiest solution is to install build-essential which depends on gcc and g++.

I've disabled the TryRun instance in ffado's SConstruct and the
CheckLibWithHeader instances now pass so as far as the TypeError: is
concerned you've hit the nail on the head.
I now get a build fail during the actual build :
[ 85s] g++ -o src/dice/presonus/firestudio_tube.os -c -std=gnu++11
-fmessage-length=0 -grecord-gcc-switches -O2 -Wall
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
-fstack-clash-protection -fno-strict-aliasing -ggdb
-Wno-deprecated-declarations -fpermissive --std=gnu++11
-Werror=date-time -mmmx -mfpmath=sse -msse -msse2 -mssse3 -msse4.1
-msse4.2 -fomit-frame-pointer -ffast-math -funroll-loops -fPIC
-D_FORTIFY_SOURCE=2 -DDEBUG_MESSAGES -DENABLE_BEBOB -DENABLE_FIREWORKS
-DENABLE_OXFORD -DENABLE_MOTU -DENABLE_DICE -DENABLE_RME
-DENABLE_GENERICAVC -I. -Isrc -I/usr/include/libxml++-2.6
-I/usr/lib64/libxml++-2.6/include -I/usr/include/libxml2
-I/usr/include/glibmm-2.4 -I/usr/lib64/glibmm-2.4/include
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
-I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include
src/dice/presonus/firestudio_tube.cpp
[ 86s] building 'libffado/ffado.h' from 'libffado/ffado.h.in'
[ 86s] scons: *** [version.h] TypeError : sequence item 1: expected
str instance, bytes found
[ 86s] scons: internal stack trace:
[ 86s] File "/usr/lib/scons-3.0.1/SCons/Job.py", line 201, in start
[ 86s] task.execute()
[ 86s] File "/usr/lib/scons-3.0.1/SCons/Script/Main.py", line 190,
in execute
[ 86s] SCons.Taskmaster.OutOfDateTask.execute(self)
[ 86s] File "/usr/lib/scons-3.0.1/SCons/Taskmaster.py", line 270, in
execute
[ 86s] raise buildError
[ 86s] Traceback (most recent call last):
[ 86s] File "/usr/lib/scons-3.0.1/SCons/Action.py", line 689, in
__call__
[ 86s] cmd = self.strfunction(target, source, env, executor)
[ 86s] TypeError: CacheRetrieveString() takes 3 positional arguments
but 4 were given
[ 86s]
[ 86s] During handling of the above exception, another exception occurred:
[ 86s]
[ 86s] Traceback (most recent call last):
[ 86s] File "/usr/lib/scons-3.0.1/SCons/Taskmaster.py", line 241, in
execute
[ 86s] if not t.retrieve_from_cache():
[ 86s] File "/usr/lib/scons-3.0.1/SCons/Node/FS.py", line 2925, in
retrieve_from_cache
[ 86s] return self.get_build_env().get_CacheDir().retrieve(self)
[ 86s] File "/usr/lib/scons-3.0.1/SCons/CacheDir.py", line 263, in
retrieve
[ 86s] if CacheRetrieve(node, [], env, execute=1) == 0:
[ 86s] File "/usr/lib/scons-3.0.1/SCons/Action.py", line 691, in
__call__
[ 86s] cmd = self.strfunction(target, source, env)
[ 86s] File "/usr/lib/scons-3.0.1/SCons/CacheDir.py", line 66, in
CacheRetrieveString
[ 86s] cachedir, cachefile = cd.cachepath(t)
[ 86s] File "/usr/lib/scons-3.0.1/SCons/CacheDir.py", line 224, in
cachepath
[ 86s] sig = node.get_cachedir_bsig()
[ 86s] File "/usr/lib/scons-3.0.1/SCons/Node/FS.py", line 3391, in
get_cachedir_bsig
[ 86s] result = self.cachesig = SCons.Util.MD5collect(sigs)
[ 86s] File "/usr/lib/scons-3.0.1/SCons/Util.py", line 1550, in
MD5collect
[ 86s] return MD5signature(', '.join(signatures))
[ 86s] TypeError: sequence item 1: expected str instance, bytes found
[ 86s] scons: building terminated because of errors.

This is all for the openSUSE distribution where I maintain ffado, I have
build with python3 scons and python2 scons-3.0.1.
The build logs are at :
https://build.opensuse.org/package/show/home:plater/ffado
and
https://build.opensuse.org/package/show/home:plater/scons
If you click on the "succeeded" or "failed" links it takes you to the
short build log then clicking "downloadlog file" takes you to the full
build logs including packages installed for the build.
The openSUSE_Tumbleweed, openSUSE_Factory and Leap_15.0 builds are all
with python-3.6.4, the Leap_42.3 build is with python-2.7 scons 3 and
succeeds.

Thanks
Dave

Loading...