cmake does not bundle win32 files

Bug #1571897 reported by theAdib
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
theAdib

Bug Description

cmake currently only creates the win32 binaries

but in order to run inkscape we need the dependend dlls in place.

Also the complete shared ressources must be copied in.

I propose to do this in "make install" step with a predefined PREFIX pointing to "/build/inkscape".
so all files comes into this directory (as was in the past)

I will try my best to provide patches.

Adib.
--

Tags: build cmake win32
Revision history for this message
theAdib (theadib) wrote :

attached first part:
- creating output directory, is still different from btool for now ok
- copying exe and library.dll
- copy devlibs dll
- copy mingw dll

the command is "make install"

if someone confirms that this cmake style is ok.? please.

if I do all this then inkscape does crash on the first place. ....

Adib.
--

Revision history for this message
Patrick Storz (ede123) wrote :

There's actually a lot more that needs to be copied from the devlibs (looking in build.xml and build-x64.xml respectively should give you an idea). If one of these things is missing (e.g. pixbuf loaders) Inkscape often crashes at startup.

Actually we also need slightly different files for 32bit/64bit builds since the devlibs differ slightly (so we have to introduce conditionals for that, too)

Did you test that the Windows binaries would work in principle with the new libinkscape_base.dll (e.g. by copying the files manually)?

Revision history for this message
theAdib (theadib) wrote :

attached a build of revision 14862.

When I simply replace .exe in a btool build by this ones inkscape crashes.

I don't know why and whats need to bundled.

Any idea, anyone?

Adib.
--

Revision history for this message
Mc (mc...) wrote :

The CMake inkscape executable is linked against libinkscape_base library which is probably not present in btool builds. If it's present, it might not be looking for it in the right place (last time I checked, installed executable was linked against the library in the build folder)

Revision history for this message
theAdib (theadib) wrote :
Download full text (3.4 KiB)

FYI the attachment comtains the inkscape.exe and the libinkscape_base.dll.

When I have the command window open that compiled inkscape then I can run inkscape but no Icons and translations present.
The dll might the process find in the devlibs and mingw64 path that is prepended to the current PATH variable.

When I now copy the prebuilt .dll eigther from devlibs folder or a btools build folder then INkscape starts to crash.

I use microsoft dependency walker application to see dll dependencies. http://www.dependencywalker.com/

from mingw64 folder we need:
libgcc_s_seh-1.dll, libgomp-1.dll, libstdc++-6.dll, libwinpthread-1.dll
copying into inkscape folder. OK, no crash.

I encountered that copying locale folder <containing the locale from my current language> from btool inkscape to cmake inkscape folder now crashes inkscape.
If I remove my locale from this folder, inkscape starts ok. Window with no icons.

Aha, my current locale let inkscape crash. strange.
gdb inkscape.exe
run
(gdb) run
Starting program: c:\inkscape\inkscape_trunk64_cmake\cbuild\bin\inkscape.exe
[New Thread 8092.0x1a24]
[New Thread 8092.0x1a3c]
[New Thread 8092.0x14ac]
[New Thread 8092.0x1330]
[New Thread 8092.0x1f94]
[New Thread 8092.0x1e1c]
[New Thread 8092.0x1c8c]
[New Thread 8092.0x12dc]
[New Thread 8092.0x118c]
[New Thread 8092.0x1d5c]
[New Thread 8092.0xf58]

Program received signal SIGSEGV, Segmentation fault.
0x000007feff4e5960 in strcmp () from C:\Windows\system32\msvcrt.dll

(gdb)bt

#0 0x000007feff4e5960 in strcmp () from C:\Windows\system32\msvcrt.dll
#1 0x0000000068654fd9 in g_utf8_collate (str1=<optimized out>,
    str2=<optimized out>) at gunicollate.c:149
#2 0x000000006dc1233c in Inkscape::Extension::Effect::merge_menu(Inkscape::XML:
:Node*, Inkscape::XML::Node*, Inkscape::XML::Node*, Inkscape::XML::Node*) ()
   from c:\inkscape\inkscape_trunk64_cmake\cbuild\bin\libinkscape_base.dll
#3 0x000000006dc12405 in Inkscape::Extension::Effect::merge_menu(Inkscape::XML:
:Node*, Inkscape::XML::Node*, Inkscape::XML::Node*, Inkscape::XML::Node*) ()
   from c:\inkscape\inkscape_trunk64_cmake\cbuild\bin\libinkscape_base.dll
#4 0x000000006dc12d75 in Inkscape::Extension::Effect::Effect(Inkscape::XML::Nod
e*, Inkscape::Extension::Implementation::Implementation*) ()
   from c:\inkscape\inkscape_trunk64_cmake\cbuild\bin\libinkscape_base.dll
#5 0x000000006dc1948c in Inkscape::Extension::build_from_reprdoc(Inkscape::XML:
:Document*, Inkscape::Extension::Implementation::Implementation*) [clone .constp
rop.26] ()
   from c:\inkscape\inkscape_trunk64_cmake\cbuild\bin\libinkscape_base.dll
#6 0x000000006dc19ce5 in Inkscape::Extension::build_from_mem(char const*, Inksc
ape::Extension::Implementation::Implementation*) ()
   from c:\inkscape\inkscape_trunk64_cmake\cbuild\bin\libinkscape_base.dll
#7 0x000000006dc16570 in Inkscape::Extension::init() ()
   from c:\inkscape\inkscape_trunk64_cmake\cbuild\bin\libinkscape_base.dll
#8 0x000000006e167774 in Inkscape::Application::Application(char const*, bool)
() from c:\inkscape\inkscape_trunk64_cmake\cbuild\bin\libinkscape_base.dll
#9 0x000000006e167e92 in Inkscape::Application::create(char const*, bool) ()
   from c:\inkscape\inksc...

Read more...

Revision history for this message
theAdib (theadib) wrote :
Revision history for this message
theAdib (theadib) wrote :

strange here is that inkscape loads a lot dll that should not be loaded.

There is this bluetooth library loaded btmmhook.dll.

Maybe our new dll plugin loader checks all possible directories for dll ?

Revision history for this message
Sebastian Faubel (faubulous) wrote :

hi adib,

i got some time to test the Windows build today and wrote an improved, but still not production ready CMakeLists.txt. It contains an setup routine that comes pretty close to what btool is doing. However, it's still work in progress and buggy. Find it attached.

I can say two things:

1. Locales crash inkscape on startup. If you remove the locale folder from the binary output dir, it should work.
2. There is an empty index.theme file in share/icons/hicolor/ which also crashes inkscape on startup. Simply remove it.

After doing these things I can start inkscape with the correct GTK theme, but without icons though. I figured out that it looks for the icons in the global C:\Program Files (x86)\inkscape folder which might get set on compilation from the CMAKE_INSTALL_PREFIX variable. I'm no yet sure and need to investigate further on this issue..

~faubulous

PS. Helped me a lot: copy the inkscape.com file from the current Inkscape release version into the binary output directory and use it to start inkscape. This enables command line output messages for me.. :)

Revision history for this message
Jon A. Cruz (jon-joncruz) wrote :

FYI, I used some of this patch along with my local changes to get more progress on my local build. I then got a a btool build to work, so now I can work through the staging/packaging differences and see what else needs cleanup

Revision history for this message
Sebastian Faubel (faubulous) wrote :

Hi guys,

i managed to get the icons to work. There is a function in prefix.cpp called win32_getDataDir() which returns a malformed path on Windows. The reason is that CMake sets an absolute path to INKSCAPE_DATADIR in config.h.cmake. Although this makes sense on Linux, it's highly problematic on Windows since win32_getDataDir expects a relative path. I attached a patch.

~faubulous

Revision history for this message
Sebastian Faubel (faubulous) wrote :

Hello again,

i created a new branch with a very much improved CMake setup which, theoretically, should also support 32-bit builds. However, using 32-bit devlibs it fails (cross) compiling some files with the error message:

'sorry, unimplemented: 64-bit mode not compiled in'

I'd like to mention that there's a lot of sanity checking code in this branch added to verify that the environment is sane. There are no more hard coded paths in the CMake files. Moreover, it includes all patches that enable the creation of a running Inkscape build with icons and full color.. ;)

To build, simply edit DEVLIBS_PATH and MINGW_PATH in configure.bat and execute. That should produce working Makefiles.

Please let me know if you encounter any problems with this branch. Thx.

~faubulous

Revision history for this message
Sebastian Faubel (faubulous) wrote :

PS. You can find the branch at lp:~faubulous/inkscape/cmake-win32

:)

Revision history for this message
Sebastian Faubel (faubulous) wrote :

PPS. Fixed the 32-bit issue. It's compiling now.

Revision history for this message
theAdib (theadib) wrote :

assembling files works fine now
put to fix released

Changed in inkscape:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.