Skip to content

Instantly share code, notes, and snippets.

@achadwick
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achadwick/498358f65a71f88b85d2 to your computer and use it in GitHub Desktop.
Save achadwick/498358f65a71f88b85d2 to your computer and use it in GitHub Desktop.
An attempt at some MyPaint build instructions for Windows
@lilithebowman
Copy link

Ean Bowman@ERROR MSYS /tmp/json-c
$ make
1 [main] make 11072 child_info_fork::abort: C:\msys32\usr\bin\msys-unistring-2.dll: Loaded to different address: parent(0x440000) != child(0x7A0000)
make: fork: Resource temporarily unavailable

Ean Bowman@ERROR MSYS /tmp/json-c
$ make install
1 [main] make 9928 child_info_fork::abort: C:\msys32\usr\bin\msys-unistring-2.dll: Loaded to different address: parent(0x440000) != child(0x840000)
make: fork: Resource temporarily unavailable

I get an odd error. o_O!

@achadwick
Copy link
Author

@eanbowman
I think you need to close and reopen the shell after the first phase of the update dance if it's wibbling about fork() and address mismatches. Some quirk of Cygwin design, according to http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/

Also you shouldn't be doing this from the MSYS environment, if I understand the architectural system right. Use the MINGW32 shell instead, and it should be OK to the extent I've charted the territory myself (which isn't much).

@Alexpux
Copy link

Alexpux commented Jan 7, 2015

do you install "ming-w64-i686-pkg-config" package?

@lilithebowman
Copy link

Yeah I installed the i686 package because I didn't see an x86 link there. Maybe that's it.

I followed the instructions and closed and re-opened the console when I had that error. Tried a few different things.

[edit] it's because I was in the wrong section of course. I was following earlier advice to use the 32 bit version, so I clicked that link and landed in the i686 folder. At the top of that folder is a "Looking for the latest version?" link with the copy that achadwick used.

[edit] I was able to get as far as you do with the exact same results.

@lilithebowman
Copy link

Getting further. It appears if I add the path of the newly built json-c.pc to the environment variable it now asks for me to do the same for glib.

edge__000@Hedgehog MINGW32 /tmp/mypaint
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/json-c/

PKG_CONFIG_PATH=/mingw32/lib/pkgconfig:/mingw32/share/pkgconfig:/tmp/json-c/

edge__000@Hedgehog MINGW32 /tmp/mypaint
$ MSYSTEM= ./scons.py
scons: Reading SConscript files ...

scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/Main.py", line 602, in _scons_internal_warning
building for 'python' (use scons python_binary=xxx to change)
using 'python-config' (use scons python_config=xxx to change)
Delete(["libmypaint-tests.so", "libmypaint-tests.so", "libmypaint.so", "libmypaintlib.so", "libmypaint.a", "libmypaint-tests.a", "lib/_mypaintlib.so"])
Enabling i18n for brushlib in full application build
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
OSError: 'pkg-config --cflags --libs glib-2.0' exited 1:
File "C:\msys64\tmp\mypaint\SConstruct", line 219:
SConscript('./SConscript')
...

After doing so, I'm stuck here now:

edge__000@Hedgehog MINGW32 /tmp/mypaint
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/mingw32/lib/pkgconfig

edge__000@Hedgehog MINGW32 /tmp/mypaint
$ MSYSTEM= ./scons.py
scons: Reading SConscript files ...

scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/Main.py", line 602, in _scons_internal_warning
building for 'python' (use scons python_binary=xxx to change)
using 'python-config' (use scons python_config=xxx to change)
Delete(["libmypaint-tests.so", "libmypaint-tests.so", "libmypaint.so", "libmypaintlib.so", "libmypaint.a", "libmypaint-tests.a", "lib/_mypaintlib.so"])
Enabling i18n for brushlib in full application build
ValueError: list.remove(x): x not in list:
  File "C:\msys64\tmp\mypaint\SConstruct", line 219:
    SConscript('./SConscript')
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "C:\msys64\tmp\mypaint\SConscript", line 26:
    mypaintlib = SConscript('lib/SConscript')
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "C:\msys64\tmp\mypaint\lib\SConscript", line 77:
    env['CPPDEFINES'].remove('NDEBUG')

edge__000@Hedgehog MINGW32 /tmp/mypaint
$

(Build environment: yet another PC. This time my AMD Phenom II 1055T running Win8.1x64. Same version of MinGW that was suggested above.)

@lilithebowman
Copy link

Looked up the error message : scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly

Apparently it's exactly what the error is telling us. We need VS. And one forum post suggests that only 2012 will do. Downloading 2012 Express and crossing my fingers.

[edit] doing so eliminated the VS error but did nothing to help with the code attempting to delete from an array in env that doesn't exist.

Edited mypaint/lib/SConscript @ line 75:

# Make sure assertions are enabled
if env.get('CPPDEFINES'):
    try:
        env['CPPDEFINES'].remove('NDEBUG')
    except:
        print('NDEBUG was not enabled, not disabling.')

Then running the build produces the following output:

$ MSYSTEM= ./scons.py
scons: Reading SConscript files ...
building for 'python' (use scons python_binary=xxx to change)
using 'python-config' (use scons python_config=xxx to change)
Delete(["libmypaint-tests.so", "libmypaint-tests.so", "libmypaint.so", "libmypaintlib.so", "libmypaint.a", "libmypaint-tests.a", "lib/_mypaintlib.so"])
Enabling i18n for brushlib in full application build
NDEBUG was not enabled, not disabling.
AttributeError: 'str' object has no attribute 'attributes':
  File "C:\msys64\tmp\mypaint\SConstruct", line 219:
    SConscript('./SConscript')
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "C:\msys64\tmp\mypaint\SConscript", line 26:
    mypaintlib = SConscript('lib/SConscript')
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "C:\msys64\tmp\mypaint\lib\SConscript", line 102:
    SHLIBPREFIX="",
  File "C:\msys64\tmp\mypaint\lib\SConscript", line 23:
    return env.SharedLibrary(*args, **kwargs)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Environment.py", line 260:
    return MethodWrapper.__call__(self, target, source, *args, **kw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Environment.py", line 224:
    return self.method(*nargs, **kwargs)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Builder.py", line 633:
    return self._execute(env, target, source, OverrideWarner(kw), ekw)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Builder.py", line 554:
    tlist, slist = self._create_nodes(env, target, source)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Builder.py", line 518:
    target, source = self.emitter(target=tlist, source=slist, env=env)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Builder.py", line 344:
    target, source = e(target, source, env)
  File "C:\msys64\tmp\mypaint\scons-local-2.3.4/SCons/Tool/link.py", line 79:
    tgt.attributes.shared = 1

@mingwandroid
Copy link

You don't want to install MSVC, honestly. MSYS2 is all about Open Source code generators, tools and libraries. I gave up on scons about ten years ago since it didn't even grok cross compilation, but AFAIR you need to tell scons to use mingw tools..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment