[crux-commits] ports/contrib (3.6): [notify] distcc: 3.3.3 -> 3.3.5 closes FS#1817 - distcc improvements

crux at crux.nu crux at crux.nu
Mon Mar 8 05:25:34 UTC 2021


commit 8b598823f003358b2ab22dfc1e028ccd765dfc17
Author: Danny Rawlins <contact at romster.me>
Date:   Mon Mar 8 16:24:44 2021 +1100

    [notify] distcc: 3.3.3 -> 3.3.5 closes FS#1817 - distcc improvements

diff --git a/distcc/.footprint b/distcc/.footprint
index 0470c0dd1..602bc3437 100644
--- a/distcc/.footprint
+++ b/distcc/.footprint
@@ -1,4 +1,5 @@
 drwxr-xr-x	root/root	etc/
+-rw-r--r--	root/root	etc/distccd.conf
 drwxr-xr-x	root/root	etc/rc.d/
 -rwxr-xr-x	root/root	etc/rc.d/distccd
 drwxr-xr-x	root/root	usr/
@@ -6,6 +7,7 @@ drwxr-xr-x	root/root	usr/bin/
 -rwxr-xr-x	root/root	usr/bin/distcc
 -rwxr-xr-x	root/root	usr/bin/distccmon-text
 -rwxr-xr-x	root/root	usr/bin/lsdistcc
+-rwxr-xr-x	root/root	usr/bin/pump
 drwxr-xr-x	root/root	usr/lib/
 drwxr-xr-x	root/root	usr/lib/distcc/
 lrwxrwxrwx	root/root	usr/lib/distcc/c++ -> ../../bin/distcc
@@ -13,6 +15,58 @@ lrwxrwxrwx	root/root	usr/lib/distcc/cc -> ../../bin/distcc
 lrwxrwxrwx	root/root	usr/lib/distcc/cpp -> ../../bin/distcc
 lrwxrwxrwx	root/root	usr/lib/distcc/g++ -> ../../bin/distcc
 lrwxrwxrwx	root/root	usr/lib/distcc/gcc -> ../../bin/distcc
+drwxr-xr-x	root/root	usr/lib/python3.9/
+drwxr-xr-x	root/root	usr/lib/python3.9/site-packages/
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server-3.3.5-py3.9.egg-info
+drwxr-xr-x	root/root	usr/lib/python3.9/site-packages/include_server/
+drwxr-xr-x	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/basics.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/basics_test.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/c_extensions_test.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/cache_basics.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/compiler_defaults.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/compress_files.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/include_analyzer.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/include_analyzer_memoizing_node.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/include_analyzer_memoizing_node_test.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/include_analyzer_test.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/include_server.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/include_server_test.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/macro_eval.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/macro_eval_test.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/mirror_path.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/mirror_path_test.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/parse_command.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/parse_command_test.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/parse_file.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/parse_file_test.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/run.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/setup.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/__pycache__/statistics.cpython-39.pyc
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/basics.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/basics_test.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/c_extensions_test.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/cache_basics.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/compiler_defaults.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/compress_files.py
+-rwxr-xr-x	root/root	usr/lib/python3.9/site-packages/include_server/distcc_pump_c_extensions.cpython-39-x86_64-linux-gnu.so
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/include_analyzer.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/include_analyzer_memoizing_node.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/include_analyzer_memoizing_node_test.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/include_analyzer_test.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/include_server.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/include_server_test.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/macro_eval.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/macro_eval_test.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/mirror_path.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/mirror_path_test.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/parse_command.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/parse_command_test.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/parse_file.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/parse_file_test.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/run.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/setup.py
+-rw-r--r--	root/root	usr/lib/python3.9/site-packages/include_server/statistics.py
 drwxr-xr-x	root/root	usr/sbin/
 -rwxr-xr-x	root/root	usr/sbin/distccd
 drwxr-xr-x	root/root	usr/share/
@@ -21,4 +75,9 @@ drwxr-xr-x	root/root	usr/share/man/man1/
 -rw-r--r--	root/root	usr/share/man/man1/distcc.1.gz
 -rw-r--r--	root/root	usr/share/man/man1/distccd.1.gz
 -rw-r--r--	root/root	usr/share/man/man1/distccmon-text.1.gz
+-rw-r--r--	root/root	usr/share/man/man1/include_server.1.gz
 -rw-r--r--	root/root	usr/share/man/man1/lsdistcc.1.gz
+-rw-r--r--	root/root	usr/share/man/man1/pump.1.gz
+drwxr-xr-x	root/root	var/
+drwxr-xr-x	root/root	var/run/
+drwxr-xr-x	distcc/distcc	var/run/distcc/
diff --git a/distcc/.signature b/distcc/.signature
index a6752a8d0..646cdf8d0 100644
--- a/distcc/.signature
+++ b/distcc/.signature
@@ -1,8 +1,7 @@
 untrusted comment: verify with /etc/ports/contrib.pub
-RWSagIOpLGJF3/cYlTfvzB/tCQgpYGlFCNO2jvXFfwQ+zoMVCpIb5+G81TPoizlcucHDMyWfYpfweDbsdwp2F9sh9b4YUsBn1gk=
-SHA256 (Pkgfile) = 0e7a08a1d22c5cbfaa00cadecc73fd2f9076c86a0debcc1af3751039c06eb99e
-SHA256 (.footprint) = 96261a14be1f68dc197a6eeab9ce9ffa685b7921e7802d2e62313e11e68575d4
-SHA256 (distcc-3.3.3.tar.gz) = b7f37d314704fbaf006d747514ff6e4d0d722102ef7d2aea132f97cf170f5169
-SHA256 (distccd) = d440c68490aab6c4552848d9253d033a0169cae56a0b94d75f68fa81642bb847
-SHA256 (distcc-3.3.3-py38.patch) = bc6d940980a24df9d5023a85d2b6869e8014967b561e14ab12cff7b3ff159497
-SHA256 (distcc-3.3.3-gcc-10-fix.patch) = bdb625de75400a79f873f323691fb980bbbe5373b24300e055edd475c6c23144
+RWSagIOpLGJF37C+jF3cbKbSTuALkqY/6NPH26KzPkxpGCI287MN4ZlPT86P2dEaHB/eGGAZowxV0A/C6sVeekbTXaAI6Yni6ws=
+SHA256 (Pkgfile) = f9d09d23f8eb8777d0f597ffbb8d93a8873864d4cd1b6283867a131a77721c00
+SHA256 (.footprint) = a02bb04a43c281a9085d56d381ee7094363505eee594601b6b9b5c01ee3e8d48
+SHA256 (distcc-3.3.5.tar.gz) = 7a8e45a3a2601b7d5805c7d5b24918e3ad84b6b5cc9153133f432fdcc6dce518
+SHA256 (distccd) = 5ff8d45e3e572cf0d4fb4e2e827bd77a618556c275f98d2770aff5621c4d1371
+SHA256 (distccd.conf) = 423bb705c252e52e01a9db813d8021a2647b57337daf7e58b6ffe969871d5add
diff --git a/distcc/Pkgfile b/distcc/Pkgfile
index 0f15a50e0..4846eee76 100644
--- a/distcc/Pkgfile
+++ b/distcc/Pkgfile
@@ -1,36 +1,29 @@
 # Description: A tool to distribute compilations.
-# URL: http://distcc.org/
+# URL: https://github.com/distcc/distcc
 # Maintainer: Danny Rawlins, crux at romster dot me
-# Optional: python3 gtk avahi
+# Optional: gtk avahi
 
 name=distcc
-version=3.3.3
-release=2
+version=3.3.5
+release=1
 source=(https://github.com/distcc/distcc/releases/download/v$version/$name-$version.tar.gz
-	distccd
-	distcc-3.3.3-py38.patch
-	distcc-3.3.3-gcc-10-fix.patch)
+	distccd distccd.conf)
 
 build() {
 	cd $name-$version
 
-[ -e '/usr/lib/pkgconfig/python-3.7.pc' ] || PKGMK_DISTCC+=' --disable-pump-mode'
-[ -e '/usr/lib/pkgconfig/gtk+-2.0.pc' ] || PKGMK_DISTCC+=' --without-gtk'
-[ -e '/usr/lib/pkgconfig/popt.pc' ] || PKGMK_DISTCC+=' --with-included-popt'
-
-	patch -p1 -i $SRC/distcc-3.3.3-py38.patch
-	patch -p1 -i $SRC/distcc-3.3.3-gcc-10-fix.patch
+prt-get isinst gtk3 || PKGMK_DISTCC+=' --without-gtk'
+prt-get isinst popt || PKGMK_DISTCC+=' --with-included-popt'
 
 	./autogen.sh
 
 	./configure ${PKGMK_DISTCC} \
 		--prefix=/usr \
 		--sysconfdir=/etc \
-		--enable-rfc2553 \
-		--disable-Werror
+		--enable-rfc2553
 
-	make
-	make DESTDIR=$PKG install
+	make WERROR_CFLAGS= INCLUDESERVER_PYTHON=/usr/bin/python3
+	make DESTDIR=$PKG INCLUDESERVER_PYTHON=/usr/bin/python3 install
 
 	# distccd should be in sbin
 	mv $PKG/usr/bin/distccd $PKG/usr/sbin/distccd
@@ -46,11 +39,14 @@ build() {
 	done
 	cd -
 
+	# install config file
+	install -D -m 0644 $SRC/distccd.conf $PKG/etc/distccd.conf
+
+	# create rundir
+	install -d $PKG/var/run/distcc
+	chown distcc:distcc $PKG/var/run/distcc
+
 	# cleanup
 	rm -r $PKG/usr/share/doc $PKG/etc/distcc $PKG/etc/default
-	rm $PKG//usr/sbin/update-distcc-symlinks
-
-	# python is required for pump mode
-[ -e '/usr/lib/pkgconfig/python-3.7.pc' ] || \
-	rm $PKG/usr/share/man/man1/{pump,include_server}.1.gz
+	rm $PKG/usr/sbin/update-distcc-symlinks
 }
diff --git a/distcc/README b/distcc/README
index 2da73ec9c..4943736f9 100644
--- a/distcc/README
+++ b/distcc/README
@@ -1,24 +1,11 @@
 POST-INSTALL:
 
-To use distcc, just:
-a) Set DISTCC_ALLOW=IPADDR[/MASK] to /etc/rc.conf.
-b) Export DISTCC_HOSTS to include the compilation hosts.
-c) Prepend /usr/lib/distcc to your $PATH environment variable.
-   (e.g. in pkgmk.conf)
-d) Export MAKEFLAGS=-j<n> where n is a number representing the number of
-  	parallel jobs you want.
-e) Optionally set DISTCC_LOG_LEVEL=LEVEL in /etc/rc.conf to be more or
-	less verbose to syslogd.
-
-
-DISTCCD SERVICE
-
-There's a service to simplify running distccd. By default, it wont run without DISTCC_ALLOW=IPADDR[/MASK] to accept connections and runs as user 'nobody'. Both values can be overridden in /etc/rc.conf, like this:
-
-----
-DISTCC_ALLOW='192.168.1.0/24'
-DISTCC_USER='pkgmk'
-----
-
-There is more information on the public wiki http://crux.nu/Public/HomePage
-and in the man pages 'man distccd' and 'man distcc'.
+To set up distcc as a client:
+1. Export DISTCC_HOSTS to include the compilation hosts
+2. Prepend /usr/lib/distcc to your $PATH environment variable.
+3. Export MAKEFLAGS=-j<n> where n is a number representing the number of
+   parallel jobs you want.
+
+To set up distcc as a server:
+1. Set the ALLOW or ZEROCONF option in /etc/distccd.conf
+2. Start the service with the /etc/rc.d/distccd startup script
diff --git a/distcc/distcc-3.3.3-gcc-10-fix.patch b/distcc/distcc-3.3.3-gcc-10-fix.patch
deleted file mode 100644
index 2c0bce6c8..000000000
--- a/distcc/distcc-3.3.3-gcc-10-fix.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 377969cc762569f4a5ec409a1e7ad6a7be3e51b3 Mon Sep 17 00:00:00 2001
-From: Romain Geissler <romain.geissler at amadeus.com>
-Date: Mon, 27 Jan 2020 09:28:43 +0000
-Subject: [PATCH] Fix build with gcc 10 which defaults to -fno-common (cf
- https://gcc.gnu.org/gcc-10/porting_to.html)
-
-This fixes the following link error I see when I use the latest gcc 10
-git branch:
-/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/serve.o:(.bss+0x0): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
-/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/stats.o:(.data+0x20): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
-collect2: error: ld returned 1 exit status
----
- src/stats.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/stats.h b/src/stats.h
-index 9bde285..74d4690 100644
---- a/src/stats.h
-+++ b/src/stats.h
-@@ -33,7 +33,7 @@ enum stats_e { STATS_TCP_ACCEPT, STATS_REJ_BAD_REQ, STATS_REJ_OVERLOAD,
-                 STATS_COMPILE_OK, STATS_COMPILE_ERROR, STATS_COMPILE_TIMEOUT,
-                 STATS_CLI_DISCONN, STATS_OTHER, STATS_ENUM_MAX };
- 
--const char *stats_text[20];
-+extern const char *stats_text[20];
- 
- int  dcc_stats_init(void);
- void dcc_stats_init_kid(void);
diff --git a/distcc/distcc-3.3.3-py38.patch b/distcc/distcc-3.3.3-py38.patch
deleted file mode 100644
index 1ba5fee7d..000000000
--- a/distcc/distcc-3.3.3-py38.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From c52a023b8a17e4346c66a8fddee69b40b327eae7 Mon Sep 17 00:00:00 2001
-From: MartB <mart.b at outlook.de>
-Date: Thu, 28 Nov 2019 21:00:59 +0100
-Subject: [PATCH] Replace time.clock() with time.perf_counter()
-
-.clock() got removed in python 3.8 and was marked as deprecated since 3.3
-(https://github.com/python/cpython/pull/13270)
----
- include_server/parse_file.py | 4 ++--
- include_server/statistics.py | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/include_server/parse_file.py b/include_server/parse_file.py
-index d1dcc74..f5d78b7 100755
---- a/include_server/parse_file.py
-+++ b/include_server/parse_file.py
-@@ -272,7 +272,7 @@ def Parse(self, filepath, symbol_table):
- 
-     assert isinstance(filepath, str)
-     self.filepath = filepath
--    parse_file_start_time = time.clock()
-+    parse_file_start_time = time.perf_counter()
-     statistics.parse_file_counter += 1
- 
-     includepath_map_index = self.includepath_map.Index
-@@ -338,6 +338,6 @@ def Parse(self, filepath, symbol_table):
-                       expr_includes, next_includes)
- 
- 
--    statistics.parse_file_total_time += time.clock() - parse_file_start_time
-+    statistics.parse_file_total_time += time.perf_counter() - parse_file_start_time
- 
-     return (quote_includes, angle_includes, expr_includes, next_includes)
-diff --git a/include_server/statistics.py b/include_server/statistics.py
-index 9677af3..7bc9cb8 100755
---- a/include_server/statistics.py
-+++ b/include_server/statistics.py
-@@ -62,13 +62,13 @@ def StartTiming():
-   global start_time, translation_unit_counter
-   """Mark the start of a request to find an include closure."""
-   translation_unit_counter += 1
--  start_time = time.clock()
-+  start_time = time.perf_counter()
- 
- 
- def EndTiming():
-   """Mark the end of an include closure calculation."""
-   global translation_unit_time, min_time, max_time, total_time
--  translation_unit_time = time.clock() - start_time
-+  translation_unit_time = time.perf_counter() - start_time
-   min_time = min(translation_unit_time, min_time)
-   max_time = max(translation_unit_time, max_time)
-   total_time += translation_unit_time
diff --git a/distcc/distccd b/distcc/distccd
index aebad6fac..3643e7b9b 100644
--- a/distcc/distccd
+++ b/distcc/distccd
@@ -1,32 +1,42 @@
-#!/usr/bin/env bash
+#!//bin/sh
 #
 # /etc/rc.d/distccd: start/stop distcc daemon
 #
 
-. /etc/rc.conf
-if [ -z "$DISTCC_ALLOW" ]; then 
-    echo "Please define a range of IPs allowed to connect to this distccd"
-    echo "host in DISTCC_ALLOW in /etc/rc.conf. More detailed information"
-    echo "can be found in the distcc's README package."
-    exit 1
-fi
+USER="distcc"
+GROUP="distcc"
+RUNDIR="/var/run/distcc"
+PIDFILE="$RUNDIR/distcc.pid"
+PROG="/usr/sbin/distccd"
+ARGS="--daemon --pid-file $PIDFILE"
 
-DISTCC_USER="${DISTCC_USER:=nobody}"
-DISTCC_LOG_LEVEL="${DISTCC_LOG_LEVEL:=notice}"
+# Allow overriding variables in separate file (except for PATH)
+. /etc/distccd.conf
+PATH="/sbin:/usr/sbin:/bin:/usr/bin"
 
 case $1 in
 start)
-	/usr/sbin/distccd --daemon --user "$DISTCC_USER" --allow "$DISTCC_ALLOW" --log-level "$DISTCC_LOG_LEVEL"
+	[ -d "$RUNDIR" ] || install -o $USER -g $GROUP -d "$RUNDIR"
+	start-stop-daemon --start --pidfile $PIDFILE --exec $PROG -- $ARGS
 	;;
 stop)
-	killall -q /usr/sbin/distccd
+	start-stop-daemon --stop --retry 60 --user $USER --pidfile $PIDFILE --remove-pidfile
 	;;
 restart)
 	$0 stop
 	$0 start
 	;;
+status)
+	start-stop-daemon --status --user $USER --pidfile $PIDFILE
+	case $? in
+	0) echo "$PROG running with pid: $(cat $PIDFILE)" ;;
+	1) echo "$PROG not running, stale pidfile: $PIDFILE" ;;
+	3) echo "$PROG not running" ;;
+	4) echo "Unable to determine program status" ;;
+	esac
+	;;
 *)
-	echo "usage: $0 [start|stop|restart]"
+	echo "usage: $0 [start|stop|status|restart]"
 	;;
 esac
 
diff --git a/distcc/distccd.conf b/distcc/distccd.conf
new file mode 100644
index 000000000..f6bcb32c8
--- /dev/null
+++ b/distcc/distccd.conf
@@ -0,0 +1,12 @@
+#
+# This config file is sourced by /etc/rc.d/distccd
+# We can override or append to variables
+#
+
+# USER="distcc"
+# GROUP="distcc"
+# RUNDIR="/var/run/distcc"
+# PIDFILE="$RUNDIR/distcc.pid"
+
++# Uncomment this and set --allow or --allow-local as needed:
+# ARGS="$ARGS --allow 1.2.0.0/16 --allow 3.4.5.0/24 --allow-private --zeroconf"
diff --git a/distcc/pre-install b/distcc/pre-install
new file mode 100755
index 000000000..b3bd0f2bf
--- /dev/null
+++ b/distcc/pre-install
@@ -0,0 +1,2 @@
+/usr/sbin/groupadd --system distcc
+/usr/sbin/useradd --system --gid distcc --home-dir /var/empty --shell /bin/false distcc && passwd --lock distcc


More information about the crux-commits mailing list