How to Compile Rebirth on Windows
#11
I think you read the Python backtrace backward. Line 4975 is one of the oldest frames in the stack, so it is very far from the actual error. I have not seen that error before, and have no advice on how to handle it. Try applying the below, then post the new output after it fails:
Code:
diff --git a/SConstruct b/SConstruct
index ed5ded905..60d626180 100644
--- a/SConstruct
+++ b/SConstruct
@@ -81,6 +81,7 @@ class StaticSubprocess:
        p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=stderr)
        (o, e) = p.communicate()
        _call_cache[a] = c = _CachedCall(o, e, p.wait())
+        print('StaticSubprocess.pcall({!r}) = _CachedCall({!r}, {!r}, {!r})'.format(args, c.out, c.err, c.returncode))
        return c
    def qcall(args,stderr=None,_pcall=pcall,_shlex_split=shlex_split):
        return _pcall(_shlex_split(args),stderr)
This is not expected to fix the problem. It only adds a debug print showing the content returned by pkg-config, in the hope that the raw output as seen by Python will provide a hint about the error.

Note that the forum has an interesting interpretation of whitespace, so the print call is indented one space too many. It should be aligned with the statements on the adjacent lines.
Reply
#12
Thanks for your response. The output is as follows:

Code:
DXX-Archive.3: reading libpng version from ('/mingw/mingw32/bin/pkgconf.exe', '--modversion', 'libpng')
StaticSubprocess.pcall(('/mingw/mingw32/bin/pkgconf.exe', '--modversion', 'libpng')) = _CachedCall('1.6.35\n', None, 0)
DXX-Archive.3: libpng version: '1.6.35'
DXX-Archive.3: reading libpng settings from ('/mingw/mingw32/bin/pkgconf.exe', '--cflags', '--libs', 'libpng')
StaticSubprocess.pcall(('/mingw/mingw32/bin/pkgconf.exe', '--cflags', '--libs', 'libpng')) = _CachedCall('-IC:/mingw/mingw32/bin/../include/libpng16 -IC:/mingw/mingw32/bin/../include -LC:/mingw/mingw32/bin/../lib -lpng16 -lz \n', None, 0)
TypeError: must be encoded string without NULL bytes, not str:
EDIT: If I skip screenshot support, I get the same issue with SDL:

Code:
DXX-Archive.3: using pkg-config at discovered path /mingw/mingw32/bin/pkgconf.exe
DXX-Archive.3: reading sdl version from ('/mingw/mingw32/bin/pkgconf.exe', '--modversion', 'sdl')
StaticSubprocess.pcall(('/mingw/mingw32/bin/pkgconf.exe', '--modversion', 'sdl')) = _CachedCall('1.2.15\n', None, 0)
DXX-Archive.3: SDL version: '1.2.15'
DXX-Archive.3: reading SDL settings from ('/mingw/mingw32/bin/pkgconf.exe', '--cflags', '--libs', 'sdl')
StaticSubprocess.pcall(('/mingw/mingw32/bin/pkgconf.exe', '--cflags', '--libs', 'sdl')) = _CachedCall('-IC:/mingw/mingw32/bin/../include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main -LC:/mingw/mingw32/bin/../lib -lmingw32 -lSDLmain -lSDL -mwindows \n', None, 0)
TypeError: must be encoded string without NULL bytes, not str:
Reply
#13
I can't reproduce your issue (though I don't currently have a full Windows-hosted environment in which to test it). That output doesn't suggest any obvious causes. Google results don't yield much either. It mostly confirms that the error message seems to be reporting that the incoming string had bytes with value 0 ("NULL bytes") embedded in it. Python can handle that correctly, but calling system functions like that is likely to produce bad results, so it's reasonable that Python rejects it. SConstruct isn't supposed to use embedded nulls at all, and the inputs you showed from the debugging patch don't show any indication that embedded nulls would be used. Thus, I can't see how your environment got into this state. You could try the below patch, but I don't have much hope it will help. It's a blind guess based on the oddity of having a trailing blank and a trailing newline.
Code:
diff --git a/SConstruct b/SConstruct
index ed5ded905..70bf63ac5 100644
--- a/SConstruct
+++ b/SConstruct
@@ -81,6 +81,8 @@ class StaticSubprocess:
        p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=stderr)
        (o, e) = p.communicate()
        _call_cache[a] = c = _CachedCall(o, e, p.wait())
+        c.out = c.out.rstrip()
+        print('StaticSubprocess.pcall({!r}) = _CachedCall({!r}, {!r}, {!r})'.format(args, c.out, c.err, c.returncode))
        return c
    def qcall(args,stderr=None,_pcall=pcall,_shlex_split=shlex_split):
        return _pcall(_shlex_split(args),stderr)
If that doesn't work, I'm out of ideas until I can reproduce the problem. Sorry.

As a workaround, you could try disabling use of pkg-config (set PKG_CONFIG= on the command line) and then providing all the options that pkg-config would otherwise have provided (library search directories, libraries to link, C preprocessor arguments, etc.) in the relevant variables.

If you manage to solve it, I'll be happy to patch SConstruct to prevent the problem from affecting anyone else.
Reply
#14
I noticed that there's been a push to fix windows builds - and indeed it works for me now! Many thanks!
Reply
#15
I hate to turn down gratitude, but I think it's unearned. You're probably referring to Fix Windows build which was a fix for the preceding commit Use SCons.Node in place of bare path strings. The breaking commit was posted days after you reported a problem, so it can't be the explanation for your issue; neither of them should have done anything to fix your problem. I'm glad it works for you now, but I don't know if it works because you changed something important in your environment or if I fixed it accidentally with some other change.
Reply
#16
I changed nothing. I did a git pull and it worked. I also set things up on a raspberry but that worked straight away even before that.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)