Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11464 closed patch (fixed)

[PATCH] errors in windows build system

Reported by: bviktor Owned by: datallah
Milestone: 2.7.0 Component: winpidgin (gtk)
Version: 2.6.6 Keywords: windows build nss nspr libxml
Cc:

Description

i wanted to give mingw64 a try, but then i ended up struggling to compile x86 pidgin with cygwin. the BuildingWinPidgin page contains a few inconsistencies. i already fixed 2 of them, just check the history but it should be ok.

there are other errors left which prevent the user from successfully compiling pidgin on windows.

first off, nss+nspr. the 2-years old release simply didn't want to compile. i was looking for newer builds but it turned out there isn't any, so i ended up building nss+nspr myself. the result:

http://nss.daydreamer.nu/

nss+nspr merged builds in 6 flavours. i used nss-3.12.5-with-nspr-4.8.2-winnt-opt-obj. the win95 version could be used easily by changing path in one of my diffs, no problems.

i intend to keep them up to date. there's some action needed on the user's part, however. after he extracts the archive to win32-dev, there will be

win32-dev/nss-3.12.5-with-nspr-4.8.2-winnt-opt-obj

in that folder there are 3 subfolders, private, public and WINNT6.1_OPT.OBJ. public/nss/* needs to be copied/moved to WINNT6.1_OPT.OBJ/include. you may ask, why is it so complicated: because the nss build system generates it this way and i don't want to mess with that.

now go on to the patches.

1) libpurple-Makefile.mingw.diff: simple. headers have been moved to a subfolder.

2) libpurple-plugins-ssl-Makefile.mingw.diff: renaming again, nspr4 -> libnspr4, plc4 -> libplc4, plds4 -> libplds4. additionally, now nssutil3 and sqlite3 are required for ssl to work.

3) libpurple-protocols-bonjour-Makefile.mingw.diff: same as 1)

4) libpurple-protocols-jabber-Makefile.mingw.diff: same as 1)

5) libpurple-win32-global.mak.diff: someone forgot to update libxml2 version here after updating the wiki page. also update nss path to use the new package. nss and nspr are merged so use the same path.

6) pidgin-plugins-perl-common-Makefile.mingw.diff: a missing include here.

7) pidgin-win32-winpidgin.c.diff: it gave me undeclared identifier errors with LANG_BOSNIAN check (apparently it was defined while sublangs arent't), so i made it more explicit. if this is incorrect this way, sorry :)

Attachments (12)

libpurple-Makefile.mingw.diff (640 bytes) - added by bviktor 9 years ago.
libpurple-plugins-ssl-Makefile.mingw.diff (726 bytes) - added by bviktor 9 years ago.
libpurple-protocols-bonjour-Makefile.mingw.diff (486 bytes) - added by bviktor 9 years ago.
libpurple-protocols-jabber-Makefile.mingw.diff (480 bytes) - added by bviktor 9 years ago.
libpurple-win32-global.mak.diff (798 bytes) - added by bviktor 9 years ago.
pidgin-plugins-perl-common-Makefile.mingw.diff (463 bytes) - added by bviktor 9 years ago.
pidgin-win32-winpidgin.c.diff (561 bytes) - added by bviktor 9 years ago.
pidgin-build.png (36.4 KB) - added by bviktor 9 years ago.
pidgin-2.6.6-windows-build-fixes.diff (7.6 KB) - added by bviktor 9 years ago.
winpidgin-error.png (13.9 KB) - added by bviktor 9 years ago.
pidgin-installer-nsi-error.png (3.3 KB) - added by bviktor 9 years ago.
pidgin-nss-update.diff (3.8 KB) - added by bviktor 9 years ago.

Download all attachments as: .zip

Change History (52)

Changed 9 years ago by bviktor

Changed 9 years ago by bviktor

Changed 9 years ago by bviktor

Changed 9 years ago by bviktor

Changed 9 years ago by bviktor

comment:1 Changed 9 years ago by bviktor

here's the proof it indeed works. as you can see, i used the latest bundle (gtk+-bundle_2.18.7-20100213_win32.zip). if you don't mind, the wiki page could be updated in this regard too (i.e.: to point users to the 2.18 bundle instead of the 2.14 one), unless there's a good reason not to do so.

comment:2 Changed 9 years ago by bviktor

one correction: to use the win95 nss build, not only the path has to be changed in global.mak, but also the lib* renames have to reverted.

however, anyone willing to build pidgin will most likely have at least win2000 :)

comment:3 Changed 9 years ago by bviktor

never mind the previous patches. here's an all-in-one with additional fixes (pidgin-2.6.6-windows-build-fixes.diff). i just applied it to the vanilla pidgin sources, then did a make install, make installers. it works like a charm. no more of annoying errors and restarts :)

so what's been done so far:

  • patches for the pidgin sources
  • builds for the latest version of nss & nspr
  • installer package for recent gtk
  • fixes for the documentation (there's room for more but that requires you to accept this patch)

the nss and gtk packages are available on the site i linked. as well as my pidgin builds. just for fun.

however i understand that these modifications will cause pidgin cease to work on win9x. it may be a drawback, although graphs like this make me think the opposite (others = 0,52%) :)

Changed 9 years ago by bviktor

comment:4 Changed 9 years ago by darkrain42

  • Component changed from unclassified to winpidgin (gtk)
  • Milestone set to Patches Needing Review
  • Owner changed from rekkanoryo to datallah

comment:5 Changed 9 years ago by rekkanoryo

Pidgin 2.7.0 forcibly kills Windows 9x/ME and Windows NT 4.0 support, because it is moving to a newer version of GTK+ and GLib that do not work on those old systems. Killing support for those systems in other dependencies is not a problem.

When you say "vanilla pidgin sources", are you using a tarball or building from monotone? I ask because your change to BuildingWinPidgin for the global.mak gtk_2_0 directory issue is bogus--Daniel fixed that in mtn. Additionally, some of the other changes look suspect to me as well.

comment:6 Changed 9 years ago by rekkanoryo

As an additional side note, there are (or were a few weeks ago) a number of problems with GTK+ 2.18.x that prevent us from shipping it on Windows, and GTK+ 2.16.x has known clipboard problems for us.

comment:7 Changed 9 years ago by bviktor

i used 2.6.6 but now after looking at the commits i see most if the fixes are already committed :) probably the only change worth mentioning is the nss update.

which change looks subspicious?

comment:8 Changed 9 years ago by bviktor

okay a ran a build from head. indeed most problems are eliminated. however, the bosnian error still remains, see winpidgin-error.png.

i attach an updated patch against head, pidgin-nss-update.diff

with that it successfully builds against the new nt nss+nspr build. and runs, ssl works, i can use msn.

however, make installers fails, see pidgin-installer-nsi-error.png. now i don't have time to look around it, but i guess you'll solve it quickly ;)

Changed 9 years ago by bviktor

Changed 9 years ago by bviktor

Changed 9 years ago by bviktor

comment:9 Changed 9 years ago by bviktor

one more thing: the problem with that norwegian stuff may still be present but of course i can't say that for sure coz i failed to finish the process.

oh and i reverted 2 wiki edits coz i saw they code's updated accordingly, hope it's fine.

comment:10 Changed 9 years ago by datallah

  • Status changed from new to pending

Clearly there is some confusion here that has been already identified (you were following the 2.7.0 instructions when trying to build 2.6.6).

I've fixed a couple things about your BuildingWinPidgin changes (it should be pretty obvious in the history)

I also want to change the gettext to be the version from the gnome download server, not from gnuwin32, but I need to make sure it works first.

Let me address the only things that I believe are outstanding:

  • The winpidgin.c errors are caused by using an old version of the win32api.
  • The installer error is because you haven't generated the gtk zip file that is to be included (most likely because I haven't yet updated the instructions about that - I'll try to do that at some point in the near future).
  • The NSS upgrade, I'm apprehensive about. I'm not at all opposed to using a newer version, but I don't much like the idea about using a third party binary. Perhaps you can document the build steps and we can build our own binaries? Is there a way to build it, so it doesn't depend on sqlite?

comment:11 Changed 9 years ago by bviktor

  • Status changed from pending to new

i'm glad to hear everything's fine then :)

well if you don't like my binaries, i can write a howto, will start right after this comment.

from what i've found it's not possible to build nss without some database support. they've been using dbm (Berkeley DB) and now they use sqlite. the switch seems to be benefical anyway. more info on this:

https://wiki.mozilla.org/NSS_Shared_DB http://www.mozilla.org/projects/security/pki/nss/nss-3.12/nss-3.12-release-notes.html

will update you soon.

comment:12 Changed 9 years ago by bviktor

i'm writing the wiki page. it's almost finished. however, i was trying to insert reStructuredText formatting with codeblock #!rst, but it's not working. then i realised why didn't i understand the example :)

could you please check this out?

comment:13 Changed 9 years ago by datallah

The problem with RST was that python-docutils wasn't installed. It should be working now.

comment:14 Changed 9 years ago by bviktor

thanks. i've finished writing the howto:

http://developer.pidgin.im/wiki/BuildingWinNSS

comment:15 Changed 9 years ago by rekkanoryo

It sounds like NSS and NSPR are set up to be built with VS2008, which by default links to msvcrt8.dll. Considering this is an SSL library, how can this work when the rest of Pidgin and libpurple are linked against msvcrt.dll? I'm pretty sure we determined at some point in the past that everything that does file or network I/O had to be linked against the same C library.

comment:16 Changed 9 years ago by bviktor

i don't think so. VC only needed because of cl (and probably link), but the VS command prompt is started with vsvars32.bat, in which you can find (on x64):

@set LIB=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\LIB;%LIB%

and there's only msvcrt.lib.

comment:17 Changed 9 years ago by datallah

I'm pretty sure that msvcrt.lib on VS9 links to msvcrt8.dll.

There are a number of issues with this, the most concerning of which (assuming that it actually does work) is that we'd have to distribute the msvcrt8 runtime (which raises all sorts of licensing questions).

Can NSS/NSPR be built with VS6 or mingw?

Also, why mingw-64 instead of mingw?

comment:18 Changed 9 years ago by bviktor

you may be pretty sure but msvcrt8.dll can't even be found on my system, how's that?

i've built nss this way and then pidgin with that nss build. now i've just tested this pidgin build on a fresh xp install. it indeed doesn't work.

however, i just recognized that NS_USE_GCC variable. i was ignoring it coz in an other doc it was mentioned to be for systems other than windows and linux. now i tried to build nss with that but just got an error.

for mozilla\security\nss\lib\freebl\config.mk:

--- config.mk.orig	2009-04-12 00:18:42 +0200
+++ config.mk	2010-02-28 20:19:08 +0100
@@ -85,8 +85,10 @@
 RESNAME = freebl.rc
 
 ifndef WINCE
+ifndef NS_USE_GCC
 OS_LIBS += shell32.lib
 endif
+endif
 
 ifdef NS_USE_GCC
 EXTRA_SHARED_LIBS += \

then it works. it will halt just before the end, but it's already enough to build pidgin. copy this half-ready stuff to win32-dev and pidgin builds fine. the new binary works ok on the fresh xp install too. now i'm going to update the nss build doc.

now i'm trying to find out what's wrong with the gcc build of nss. in the meanwhile, you may try my build to see if it indeed works or it's just me:

http://nss.daydreamer.nu/pub/pidgin/gcc/

comment:19 Changed 9 years ago by datallah

It is actually msvcr90.dll that stuff built with VS9 depends on.

comment:20 Changed 9 years ago by bviktor

ah, you entered the page just mins before i wanted (basically with the same) :P

it seems to be the most we could get out of it with gcc for now. but it's already enough.

i guess this ticket can be closed now, but i leave it up to you. nss is updated, hurray!

comment:21 Changed 9 years ago by bviktor

umm one thing: mozillabuild already includes msys, so why do you install it (especially since you seem to make no use of it)?

comment:22 Changed 9 years ago by datallah

Aha... I didn't realize that mozillabuild already contained msys - I thought that it was coming from mingw-64 in your instructions. Thanks for noticing. I just fixed that.

I'm confused though as to your addition of the shell32 stuff - with my updated patch to freebl's config.mk to link to shell32, I don't need to manually build win32api at all.

comment:23 Changed 9 years ago by bviktor

you're right, i just did both things twice (build shell32.o and fix config.mk)...

will remove that and do some cleanup

comment:24 Changed 9 years ago by datallah

bviktor: Please let me know by which name you'd like to be credited for all the great work you've done.

comment:25 Changed 9 years ago by bviktor

thanks for the kind words, but i don't consider it that great :D

the name's Berke Viktor. in case you're wondering, Viktor's my given name but here (Hungary) we use it in the opposite order, so i use it this way world wide :D

thanks for all the good and fast communication, you really stand out of the crowd :)

comment:26 follow-up: Changed 9 years ago by bviktor

uh, once again, one more thing: would you be so kind as to send the nss patch upstream?

comment:27 in reply to: ↑ 26 Changed 9 years ago by datallah

Replying to bviktor:

uh, once again, one more thing: would you be so kind as to send the nss patch upstream?

If you have any experience interacting with the Mozilla folks, it would be great if you could do that :) . If not, I'll figure out what needs to be done in order to submit the patch.

comment:28 Changed 9 years ago by datallah

  • Milestone changed from Patches Needing Review to 2.7.0
  • Resolution set to fixed
  • Status changed from new to closed

comment:29 Changed 9 years ago by bviktor

i'm sorry but i've had no contact with them ever since, that's why i was asking :)

comment:31 Changed 9 years ago by bviktor

very well. thanks :)

comment:32 Changed 9 years ago by bviktor

FYI after A LOT of struggle i've finally managed to build pidgin with WDK against good old msvcrt.dll. it might be of interest, but i guess you prefer gcc :)

i've setted up an info page on the same address: http://nss.daydreamer.nu/

comment:33 Changed 9 years ago by bviktor

err i mean i built NSS... anyway then i successfully built pidgin using this nss build but that's another story :)

comment:34 Changed 9 years ago by datallah

I guess it would be useful if we needed to debug with MS tools or something like that. I'll have to keep that URL handy.

comment:35 Changed 9 years ago by bviktor

well debugging is exactly the problematic thing with wdk (no msvcrtd.dll), sorry :)

comment:36 Changed 9 years ago by datallah

Thanks for linking to the WDK building instructions, I was able to use them to build a new version of cyrus SASL (the last time I built it, I made a hacked up combination of VS6 and VS2005 by copying files around - yuck).

comment:37 Changed 9 years ago by bviktor

great, i'm really glad to hear it! :)

comment:38 Changed 9 years ago by bviktor

FYI, the nss 3.12.6 source has finally been made available in a tarball. i updated the nss howto accordingly. i also tested the gcc build, it works, but haven't tested whether pidgin works with it.

comment:39 Changed 9 years ago by bviktor

i've built pidgin with 3.12.6 and it apparently works

comment:40 Changed 9 years ago by bviktor

i've updated to howto for 3.12.7. it requires a smaller patch, i guess the next release will completely eliminate the error.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!