Changes

Jump to: navigation, search

Distcc With MSVC

6,000 bytes added, 12:50, 29 May 2007
Added link for compiler porters
= Project Description =
The goal of this project is to speed up Windows Mozilla Builds by spreading object compilations over several machines. This can be done by using an open source product called distcc created by Martin Pool. Unfortunately this is only available on *nix machines using gcc. Our project involves porting this software to Windows and use [http://msdn.microsoft.com/visualc/ Microsoft's Visual C++ compiler] using cygwinand msys.
= Project Leader(s) =
= Product Documentation =
The project has been focused on getting distcc to work with Mozilla, mainly because Mozilla uses GNU Makefiles which can run concurrent jobs. We have started a [[distcc_mozilla_tutorial| tutorial]] in order to help testers/developers. We have also written documentation for others who might wish to [[Adding Compilers to Distcc|add support to distcc for other compilers]] (e.g., Java, C#, etc.).
== Current Status ==
* distcc seems to be distributing, but something is not working on the server side which is causing distcc to fallback to localhost. This problem has not been solved as of Dec 7, 2006.
* Some of the Test Cases may be incorrect. Neither Tom nor Cesar have extensive experience in CL options. So it may not distribute when it should, or it may distribute when it shouldn't.
== What's still to do ==
 
<!-- Taken from ben's project page -->
<table style="width: 100%;" class="standard-table" cellborder=1 border=1 cellpadding=2 cellspacing=0>
 
<tr>
<th>Task</th>
<th style="width: 10%>Priority</th>
<th style="width: 30%">Status</th>
</tr>
 
<tr>
<td>Fix documentation, including website, manpage, and tutorials</td>
<td style="background-color: #ff671e; text-align: center; font-weight: bold; font-size: bigger">Medium</td>
<td>Neglected. I think Tom has worked on the man page, Cesar has worked on the tutorial</td>
</tr>
 
<tr>
<td>
* find a suitable replacement for fork()
** using windows threads. Need to use #ifdef directives to switch between unix fork and threads. But perhaps where is a better way to do this.
** Perhaps talk to Martian Pool to see if he has any ideas? He hasn't been in the mailing list for a while.
</td>
<td style="background-color: red; text-align: center; font-weight: bold; font-size: bigger">High</td>
<td>Have not started</td>
</tr>
 
<tr>
<td>
* Send .pdb files to allow debug builds. Currently blocking mozilla from ever using distcc.
** looking at the protocol. Hopefully we don't have to changed a lot.
</td>
<td style="background-color: red; text-align: center; font-weight: bold; font-size: bigger">High</td>
<td>Have not started</td>
</tr>
 
<tr>
<td>
* Port distcc to use mingw
** Properly link in winsock library ([http://www.foobartastic.com/2007/02/27/distcc-alpha-2-and-moving-to-mingw/ fixed] using libtool)
** use windows threads (another high priority item)
** locate and replace unix functionality that existed in cygwin, but doesn't exist in mingw.
</td>
<td style="background-color: red; text-align: center; font-weight: bold; font-size: bigger">High</td>
<td>Have only got libtool to compile a simple sockets program. We have now port it to distcc
* probably use #ifdef MINGW ... #else ... #endif in source files that use socket.h
* another possibility is to have one header file handle this, and the source files include that header file </td>
</tr>
 
<tr>
<td>Find more applications that use the Makefile system and can use CL</td>
<td style="background-color: #ff671e; text-align: center; font-weight: bold; font-size: bigger">Medium</td>
<td>Difficult to find. Not many open source applications use Makefile and MSVC, many choosing to opt for NMake</td>
</tr>
 
<tr>
<td>Compile NSPR using distcc</td>
<td style="background-color: #ff671e; text-align: center; font-weight: bold; font-size: bigger">Medium</td>
<td>Dave suggested only building NSPR because its smaller and won't take as long to compile. Cesar is responsible for this</td>
</tr>
 
<tr>
<td>boy there sure are lot of memory leaks... would be nice to fix that</td>
<td style="background-color: yellow; text-align: center; font-weight: bold; font-size: bigger">Low</td>
<td>We can use tools like valgrind and mtrace to help. Or we can use Boehm-GC to free the memory automatically. But this is a lot of work for such low priority.</td>
</tr>
 
<tr>
<td>Make sure that there are no orphan distcc processes left after make maintainer-check</td>
<td style="background-color: yellow; text-align: center; font-weight: bold; font-size: bigger">Low</td>
<td>This is a problem when tests are killed, and can leave to false-negatives when you try to rerun the tests again. But that can be fixed with god ol' kill-y mc. kill, agent 009</td>
</tr>
 
</table>
 
<!--
 
{|class="standard-table" border='1'
|-
|-
|}
-->
== How to get distcc to compile use cl ==
= Project News =
See what's up with this project! Older news can be found [[Distcc With MSVC:Older News|here]]
 
== May 1, 2007 ==
 
I've been doing a lot of #ifdef conditions, just to get it to compile (although we will be doing windows threads instead of fork, this is just a step). But now I'm stuck on the function fcntl(). It's a POSIX function, and it has POSIX flags, but some of the flags don't seem to exist in Windows. I don't have enough information to know how important the function is, and if we can just skip it.
 
And I forgot my power cable in a certain building, and laptop is running out of battery!
 
== April 30, 2007 ==
 
There are some header files in distcc that have the same name as some of the standard header files in /usr/include. One file is rpc.h, which is being #included by "sockets.h". Since we don't need sockets.h, this shouldn't be a problem in ''this case''. But that is still something we have to watch out for.
 
Bah! windows.h #includes rpc.h, dammit.
 
Resource : [http://www.microsoft.com/technet/interopMigration/taskstools/migrate/unix/ucamg/ch05uav3.mspx#EDHAC Microsofts Unix migration guide]
 
== April 28, 2007 ==
 
PDB files :
vc80.pdb - source file debug symbols
'''project'''.pdb - project debug symbols
 
vc80.pdb can be overwritten by/Fd'''debug'''
 
Link between '''source'''.c[pp] and '''debug''' is hard coded in the object file. You can find it by running the ''strings'' command on the object file (Thanks shaver!).
 
Leaving debug symbols aside. We should probably start porting distcc to mingw and replacing incompatible functions. Since that would be more time consuming and more difficult to get right.
 
== April 23, 2007 ==
 
Semester is over. Because I honestly have no life, and there is work to do here, I started mapping out the distcc protocol, so we can start making any changes, if necessary. It was a wasted afternoon because the protocol is already documented in the trunk, under docs directory (who would have guessed?)
 
Preliminary examination indicates that this won't be so much work. The functions seem to already be there.
 
== March 19, 2007 ==
 
There was a subtle bug in Mozilla's code base that [https://bugzilla.mozilla.org/show_bug.cgi?id=374563 bug 274563] deals with that made it impossible for distcc to build Moz. If you apply the patch attached to the [https://bugzilla.mozilla.org/show_bug.cgi?id=374563 bug] then you'll be able to do distcc builds of Mozilla. We will soon be releasing our first beta to reflect our confidence in the code.
==Feb 27, 2007==

Navigation menu