Opened 7 years ago

Last modified 6 years ago

#43071 new update

distcc updates

Reported by: RJVB (René Bertin) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: cooljeanius (Eric Gallager)
Port: distcc

Description (last modified by pixilla (Bradley Giesbrecht))

I did some work to improve the distcc port, following a question I posted on the mailing list. MacPorts already had the latest distcc variant, but it failed to support "pumped" mode for me, and didn't support zeroconf to advertise itself.

I'm uploading an updated Portfile as well as 2 supporting files.

  1. The portfile now has variants for building the graphical monitor, distccmon-gnome
  2. I tried to build with zeroconf support, but got stuck on a "daemon not running error". It may be possible to implement a standalone server, like in avahi-discover-standalone ?
  3. Patched an error in zeroconf-reg.c
  4. rename the pump script to the more specific distcc-pump, in line with Debian
  5. added a wrapper to start a shell running a pump server (distcc-pumpedshell)
  6. added a LaunchDaemon definition, to enable a server on localhost only and currently without zeroconf. This file should be installed in /opt/local/Library/LaunchDaemons only when it doesn't exist already.

Does someone know how to address the avahi server issue, for instance how to launch one through a nested LaunchDaemon definition? For now I didn't even manage to launch one by hand (user nor root).

Relevant snippet from macports-user: On Mar 25, 2014, at 10:03, Ryan Schmidt wrote:

On Mar 25, 2014, at 03:16, René J.V. Bertin <rjvbertin@…> wrote:

Since I discovered that clang can act as a cross-compiler (generating "foreign" object, .o , files), I have a renewed interest in distcc. I'm doing rather large builds on a Linux box, and the distcc I have on there is capable of a so-called pump mode in which the precompile step is also delegated to the slaves, via a header file server. It also has lzo compression.

From what I've seen, distcc in MacPorts doesn't support neither pump mode nor suppression, and it also doesn't support the --zeroconf option (present on Apple's distcc) which advertises the services via ZeroConf.

Is there a reason for this?

The distcc port has no maintainer; nobody is looking after its interests. If we need to make a change to the port, please file a ticket to let us know, ideally supplying a unified diff of the needed changes. The port currently doesn’t seem to be doing anything too unusual with the build, so if these features you’re mentioning are unusual features that need to be explicitly enabled, then you should show us how to do that.

Attachments (7)

Portfile (2.4 KB) - added by RJVB (René Bertin) 7 years ago.
updated Portfile
patch-zeroconf-reg.c (723 bytes) - added by RJVB (René Bertin) 7 years ago.
prevent a NULL pointer dereference in zeroconf-reg.c
distcc-pumpedshell (219 bytes) - added by RJVB (René Bertin) 7 years ago.
goes in files
org.macports.distccd.plist (740 bytes) - added by RJVB (René Bertin) 7 years ago.
goes in files
patch-distcc-Portfile-from-43071.diff (6.6 KB) - added by cooljeanius (Eric Gallager) 7 years ago.
diff between my Portfile and the OP's
patch-distcc-Portfile-from-trunk.diff (5.5 KB) - added by cooljeanius (Eric Gallager) 7 years ago.
diff between my Portfile and the one in trunk
patch-zeroconf-reg.c.diff (723 bytes) - added by cooljeanius (Eric Gallager) 7 years ago.
OP's patch with the ".diff" file extension appended, to make it display more prettily on trac

Download all attachments as: .zip

Change History (17)

Changed 7 years ago by RJVB (René Bertin)

Attachment: Portfile added

updated Portfile

Changed 7 years ago by RJVB (René Bertin)

Attachment: patch-zeroconf-reg.c added

prevent a NULL pointer dereference in zeroconf-reg.c

Changed 7 years ago by RJVB (René Bertin)

Attachment: distcc-pumpedshell added

goes in files

Changed 7 years ago by RJVB (René Bertin)

Attachment: org.macports.distccd.plist added

goes in files

comment:1 Changed 7 years ago by pixilla (Bradley Giesbrecht)

Consider using Portfiles startupitem to replace org.macports.distccd.plist. https://guide.macports.org/#reference.startupitems

If Portfiles startupitem is not convenient then replace "/opt/local" with something like "@PREFIX@" in org.macports.distccd.plist, copy the file to ${worksrcpath} in "post_extract" and use reinplace in "post_patch" to replace "@PREFIX@" with ${prefix}.

comment:2 Changed 7 years ago by pixilla (Bradley Giesbrecht)

Description: modified (diff)

comment:3 Changed 7 years ago by ryandesign (Ryan Schmidt)

You should supply a unified diff of your proposed Portfile changes (against the latest version in the repository).

comment:4 Changed 7 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:5 Changed 7 years ago by cooljeanius (Eric Gallager)

It seems like there is duplicated stuff between the +gtk and +gnome variants; port -v lint --nitpick confirms:

port -v lint --nitpick distcc +gnome+gtk+zeroconf
--->  Verifying Portfile for distcc
OK: Line 1 has emacs/vim Mode
OK: Line 2 has RCS tag ($Id$)
OK: Found PortSystem 1.0
OK: Found required variable: name
OK: Found required variable: version
OK: Found required variable: description
OK: Found required variable: long_description
OK: Found required variable: categories
OK: Found required variable: maintainers
OK: Found required variable: platforms
OK: Found required variable: homepage
OK: Found required variable: master_sites
OK: Found required variable: checksums
OK: Found required variable: license
OK: Found optional variable: epoch
OK: Found optional variable: revision
OK: Found platform: darwin
OK: Found primary category: devel
OK: Found variant zeroconf: use Avahi to advertise distcc via ZeroConf
OK: Found variant gtk: Build GTK interface to distccmon
OK: Found variant gnome: Build GNOME interface to distccmon
OK: Found variant universal: (pre-defined variant)
OK: Found dependency: popt
OK: Found dependency: avahi
OK: Found dependency: gtk2
OK: Found dependency: libglade2
OK: Found dependency: gtk2
OK: Found dependency: libglade2
OK: Found dependency: libgnome
OK: Found dependency: libgnomeui
OK: Found dependency: pango
OK: Found dependency: pkgconfig
Warning: Dependency port:gtk2 specified multiple times in depends_lib
Warning: Dependency port:libglade2 specified multiple times in depends_lib
OK: Portfile parent directory matches primary category
OK: Portfile directory matches port name
--->  0 errors and 2 warnings found.

Edit: I suppose if we are working on the distcc Portfile, now might be a good time to take a look at #23754 as well...

Last edited 7 years ago by cooljeanius (Eric Gallager) (previous) (diff)

Changed 7 years ago by cooljeanius (Eric Gallager)

diff between my Portfile and the OP's

comment:6 in reply to:  5 ; Changed 7 years ago by RJVB (René Bertin)

Replying to egall@…:

It seems like there is duplicated stuff between the +gtk and +gnome variants; port -v lint --nitpick confirms:

One could indeed say that the gnome variant extends the gtk variant. I personally don't really see the interest of +gnome over and above the +gtk version, but strived to be exhaustive. Is there a way to let +gnome imply and depend on +gtk?

Edit: I suppose if we are working on the distcc Portfile, now might be a good time to take a look at #23754 as well...

Indeed, and my bad, I hadn't tested running a pump server under OS X. It would appear I missed an install phase, make installcheck .

Back to the drawingboard!

Changed 7 years ago by cooljeanius (Eric Gallager)

diff between my Portfile and the one in trunk

Changed 7 years ago by cooljeanius (Eric Gallager)

Attachment: patch-zeroconf-reg.c.diff added

OP's patch with the ".diff" file extension appended, to make it display more prettily on trac

comment:7 Changed 7 years ago by cooljeanius (Eric Gallager)

OK, I edited the Portfile, and attached diffs between my version and the OP's version, and my version and the one in trunk. I probably should have put the whitespace changes into a separate diff, but whatever... Other changes I made from the OP's Portfile besides the whitespace:

  • switched to munivesal, because I was running into the "can't be used with multiple arch flags" error
  • added a test phase (all of the variants pass it - it only runs the maintainer-check tests, though, as the full testsuite requires python...)
  • unfortunately due to the switch to muniversal I had to mess up the post-destroot block...
  • used configure.args-replace where applicable
  • added a path-style dependency on glib2 to the +gtk variant, because distcc uses symbols from it
  • made the gnome variant require the +gtk variant, and removed the duplicated dependencies from it
  • changed the dependency on pango to path-style, so that pango-devel can satisfy it
  • use the --with-gnome configure flag in the +gnome variant

comment:8 in reply to:  6 Changed 7 years ago by cooljeanius (Eric Gallager)

Replying to rjvbertin@…:

Replying to egall@…:

It seems like there is duplicated stuff between the +gtk and +gnome variants; port -v lint --nitpick confirms:

One could indeed say that the gnome variant extends the gtk variant. I personally don't really see the interest of +gnome over and above the +gtk version, but strived to be exhaustive. Is there a way to let +gnome imply and depend on +gtk?

Oops, I missed this comment as I was uploading my patches... anyways, see my patch.

Edit: I suppose if we are working on the distcc Portfile, now might be a good time to take a look at #23754 as well...

Indeed, and my bad, I hadn't tested running a pump server under OS X. It would appear I missed an install phase, make installcheck .

The installcheck target is only for after it has been installed to its final location; idk if it works with DESTDIR-type builds like MacPorts uses...

comment:9 Changed 6 years ago by ryandesign (Ryan Schmidt)

Please create diffs that show only the changes you want made, and do not show a change to every line as the diff you attached does. Possibly this is caused by the file's line endings changing.

comment:10 Changed 6 years ago by ryandesign (Ryan Schmidt)

Instead of using the user nobody, a dedicated _distcc user should be created and used.

Note: See TracTickets for help on using tickets.