Github messages for voidlinux
 help / color / mirror / Atom feed
From: Piraty <Piraty@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [WIP] New package: icecream-1.3.1
Date: Tue, 12 Jan 2021 14:47:28 +0100	[thread overview]
Message-ID: <20210112134728.NN9lt3TIBWNsQfzGdekzVOvDbsW1MQGuah5RqqZe8Fk@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-21971@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1710 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages icecc
https://github.com/void-linux/void-packages/pull/21971

[WIP] New package: icecream-1.3.1
### Intro
This PR brings distributed compiler icecc (https://github.com/icecc/icecream) to Void.

Unlike distcc it supports building on heterogeneous workers (by sending chroot archives to the workers), so my ultimate goal is to use it in xbps-src as an alternative to distcc.

### TODO
* [x] ~Naming of the package? `icecc` or `icecream`? [repology](https://repology.org/project/icecream/versions)~ icecream it is
* [ ] where should daemon's basedir be? [fedora](https://src.fedoraproject.org/rpms/icecream/tree/master) uses `/var/cache/icecc`
* [ ] other distros like [debian](https://sources.debian.org/src/icecc/1.3.1-1/debian/) [fedora](https://src.fedoraproject.org/rpms/icecream/blob/master/f/fedora-sysconfig.icecream) ship a custom icecc.conf that could be adopted for a more simple configuration of the services

### How to test
Required ports are mentioned in the project's [README](https://github.com/icecc/icecream#firewall)
1. on the remote machine: start the daemon: `iceccd -vvv`
1. on the local machine: start the scheduler: `icecc-scheduler -vvv` and a daemon
1. make sure scheduler connects to remote daemon
1. expand PATH to find the icecc symlinks 
```
export ICECC_DEBUG=debug
export PATH="/usr/libexec/icecc/bin:$PATH"
gcc -o helloworld helloworld.c
```
5. or invoke icecc directly
```
ICECC_DEBUG=debug icecc gcc -o helloworld helloworld.c
```

A patch file from https://github.com/void-linux/void-packages/pull/21971.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-icecc-21971.patch --]
[-- Type: text/x-diff, Size: 12188 bytes --]

From af6a1ae78ae5eec014c0d1063cfb25d067fdb947 Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Thu, 9 May 2019 18:16:36 +0200
Subject: [PATCH 1/3] WIP: New package: icecream-1.3.1

---
 common/shlibs                                 |  2 +
 srcpkgs/icecream-devel                        |  1 +
 srcpkgs/icecream/files/icecc-scheduler/run    |  4 ++
 srcpkgs/icecream/files/iceccd/run             |  4 ++
 ...ont-ignore-point-to-point-interfaces.patch | 55 +++++++++++++++++++
 srcpkgs/icecream/template                     | 46 ++++++++++++++++
 6 files changed, 112 insertions(+)
 create mode 120000 srcpkgs/icecream-devel
 create mode 100644 srcpkgs/icecream/files/icecc-scheduler/run
 create mode 100644 srcpkgs/icecream/files/iceccd/run
 create mode 100644 srcpkgs/icecream/patches/dont-ignore-point-to-point-interfaces.patch
 create mode 100644 srcpkgs/icecream/template

diff --git a/common/shlibs b/common/shlibs
index 5e6a8d0c6ec..2d4b2fe86a9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,6 +987,8 @@ liblilv-0.so.0 liblilv-0.14.4_1
 libsuil-0.so.0 suil-0.6.4_1
 libmcpp.so.0 libmcpp-2.7.2_1
 libjitterentropy.so.3 jitterentropy-3.0.0_1
+libicecc.so.0 icecream-1.3_1
+libjitterentropy.so.2 jitterentropy-2.2.0_1
 libkdecorations2.so.5 kdecoration-5.8.4_1
 libkdecorations2private.so.7 kdecoration-5.18.0_1
 libGlacier2.so.35 libIce-3.5.0_1
diff --git a/srcpkgs/icecream-devel b/srcpkgs/icecream-devel
new file mode 120000
index 00000000000..551c10ac351
--- /dev/null
+++ b/srcpkgs/icecream-devel
@@ -0,0 +1 @@
+icecream
\ No newline at end of file
diff --git a/srcpkgs/icecream/files/icecc-scheduler/run b/srcpkgs/icecream/files/icecc-scheduler/run
new file mode 100644
index 00000000000..18b5c835f98
--- /dev/null
+++ b/srcpkgs/icecream/files/icecc-scheduler/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+OPTS=
+[ -r ./conf ] && . ./conf
+exec icecc-scheduler --user-uid _icecc $OPTS
diff --git a/srcpkgs/icecream/files/iceccd/run b/srcpkgs/icecream/files/iceccd/run
new file mode 100644
index 00000000000..ff1f62ae761
--- /dev/null
+++ b/srcpkgs/icecream/files/iceccd/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+OPTS=
+[ -r ./conf ] && . ./conf
+exec iceccd --user-uid _icecc $OPTS
diff --git a/srcpkgs/icecream/patches/dont-ignore-point-to-point-interfaces.patch b/srcpkgs/icecream/patches/dont-ignore-point-to-point-interfaces.patch
new file mode 100644
index 00000000000..cb200829a61
--- /dev/null
+++ b/srcpkgs/icecream/patches/dont-ignore-point-to-point-interfaces.patch
@@ -0,0 +1,55 @@
+src: https://github.com/icecc/icecream/pull/540
+
+From 772f402b26f42143aed4d15621b3f778928e3bb3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?T=C3=96R=C3=96K=20Attila?= <torokati44@gmail.com>
+Date: Sat, 20 Jun 2020 21:10:44 +0200
+Subject: [PATCH 1/2] services/comm: Don't ignore point-to-point interfaces,
+ instead use peer IP to broadcast.
+
+This should make icecream work across WireGuard connections.
+---
+ services/comm.cpp | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/services/comm.cpp b/services/comm.cpp
+index 364461fb..7d5e2a48 100644
+--- a/services/comm.cpp
++++ b/services/comm.cpp
+@@ -1473,8 +1473,8 @@ static int open_send_broadcast(int port, const char* buf, int size)
+                 continue;
+             }
+ 
+-            if ((addr->ifa_flags & IFF_POINTOPOINT) || !(addr->ifa_flags & IFF_BROADCAST)) {
+-                log_info() << "ignoring tunnels " << addr->ifa_name << " for broadcast" << endl;
++            if (!(addr->ifa_flags & IFF_BROADCAST) && !(addr->ifa_flags & IFF_POINTOPOINT)) {
++                log_info() << "ignoring " << addr->ifa_name << " - has no broadcast address, nor is it point-to-point" << endl;
+                 continue;
+             }
+         } else {
+@@ -1484,15 +1484,23 @@ static int open_send_broadcast(int port, const char* buf, int size)
+             }
+         }
+ 
+-        if (addr->ifa_broadaddr) {
++        sockaddr_in *broad_or_dst_addr = nullptr;
++
++        // both of these flags are never set at the same time
++        if (addr->ifa_flags & IFF_BROADCAST)
++            broad_or_dst_addr = (sockaddr_in *)addr->ifa_broadaddr;
++        if (addr->ifa_flags & IFF_POINTOPOINT)
++            broad_or_dst_addr = (sockaddr_in *)addr->ifa_dstaddr;
++
++        if (broad_or_dst_addr) {
+             log_info() << "broadcast "
+                        << addr->ifa_name << " "
+-                       << inet_ntoa(((sockaddr_in *)addr->ifa_broadaddr)->sin_addr)
++                       << inet_ntoa(broad_or_dst_addr->sin_addr)
+                        << endl;
+ 
+             remote_addr.sin_family = AF_INET;
+             remote_addr.sin_port = htons(port);
+-            remote_addr.sin_addr = ((sockaddr_in *)addr->ifa_broadaddr)->sin_addr;
++            remote_addr.sin_addr = broad_or_dst_addr->sin_addr;
+ 
+             if (sendto(ask_fd, buf, size, 0, (struct sockaddr *)&remote_addr,
+                        sizeof(remote_addr)) != size) {
diff --git a/srcpkgs/icecream/template b/srcpkgs/icecream/template
new file mode 100644
index 00000000000..f03f080fd44
--- /dev/null
+++ b/srcpkgs/icecream/template
@@ -0,0 +1,46 @@
+# TODO
+# * system user obviously cannot chroot, which makes building in custom envs impossible. Add a second service `iceccd-root` that can?
+# * do we need anything else than the service's conf file? ... debian ships a full-blown conf file that pre-defines all cmdline args
+#
+# references:
+# 	* https://sources.debian.org/src/icecc/1.3.1-1/debian/
+# 	* https://src.fedoraproject.org/rpms/icecream/tree/master
+
+# Template file for 'icecream'
+pkgname=icecream
+version=1.3.1
+revision=1
+build_style=gnu-configure
+configure_args="--enable-shared"
+hostmakedepends="automake libtool docbook2x"
+makedepends="libcap-ng-devel lzo-devel libarchive-devel"
+short_desc="Distributed compiler with a central scheduler to share build load"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="GPL-2.0-or-later"
+homepage="https://github.com/icecc/icecream"
+distfiles="https://github.com/icecc/icecream/archive/${version}.tar.gz"
+checksum=9f45510fb2251d818baebcff19051c1cf059e48c6b830fb064a8379480159b9d
+patch_args="-Np1"
+
+system_accounts="_icecc"
+
+pre_configure() {
+	autoreconf -vfi
+}
+
+post_install() {
+	vsv iceccd
+	vsv icecc-scheduler
+}
+
+icecream-devel_package() {
+	short_desc+=" - development files"
+	depends="${sourcepkg}>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.a"
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.la"
+	}
+}

From ec7cb1574c096d4de4d16517bbf962ee622663ba Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Thu, 23 Apr 2020 23:00:10 +0200
Subject: [PATCH 2/3] New package: icemon-3.3

---
 srcpkgs/icemon/template | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/icemon/template

diff --git a/srcpkgs/icemon/template b/srcpkgs/icemon/template
new file mode 100644
index 00000000000..f6e8a9a21b6
--- /dev/null
+++ b/srcpkgs/icemon/template
@@ -0,0 +1,13 @@
+# Template file for 'icemon'
+pkgname=icemon
+version=3.3
+revision=1
+build_style=cmake
+hostmakedepends="docbook2x extra-cmake-modules pkg-config"
+makedepends="qt5-devel lzo-devel libcap-ng-devel icecream-devel libzstd-devel libarchive-devel"
+short_desc="Icecream GUI Monitor"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="GPL-2.0-or-later"
+homepage="http://kfunk.org/tag/icemon/"
+distfiles="https://github.com/icecc/icemon/archive/v${version}.tar.gz"
+checksum=3caf14731313c99967f6e4e11ff261b061e4e3d0c7ef7565e89b12e0307814ca

From 0c64d3ac0ccafea7d535c4e9d624111b4a2086cb Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Thu, 23 Apr 2020 23:48:53 +0200
Subject: [PATCH 3/3] New package: icecream-sundae-1.0.0

---
 ...on-macOS-addressed-code-review-comme.patch | 49 +++++++++++++++++++
 ...ecessary-ncurses-clear-of-the-screen.patch | 33 +++++++++++++
 srcpkgs/icecream-sundae/template              | 14 ++++++
 3 files changed, 96 insertions(+)
 create mode 100644 srcpkgs/icecream-sundae/patches/0001-FIX-compilation-on-macOS-addressed-code-review-comme.patch
 create mode 100644 srcpkgs/icecream-sundae/patches/0002-Avoid-unnecessary-ncurses-clear-of-the-screen.patch
 create mode 100644 srcpkgs/icecream-sundae/template

diff --git a/srcpkgs/icecream-sundae/patches/0001-FIX-compilation-on-macOS-addressed-code-review-comme.patch b/srcpkgs/icecream-sundae/patches/0001-FIX-compilation-on-macOS-addressed-code-review-comme.patch
new file mode 100644
index 00000000000..29d90e4aaa7
--- /dev/null
+++ b/srcpkgs/icecream-sundae/patches/0001-FIX-compilation-on-macOS-addressed-code-review-comme.patch
@@ -0,0 +1,49 @@
+upstream: yes
+
+From 4c1cd11a34f26b2ec29170a4cd557ffd8b1c30e8 Mon Sep 17 00:00:00 2001
+From: Rene Meusel <rene@renemeusel.de>
+Date: Mon, 23 Sep 2019 22:19:51 +0200
+Subject: [PATCH] FIX: compilation on macOS (addressed code review comments)
+
+---
+ meson.build | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 9b17663..d6c4264 100644
+--- a/meson.build
++++ b/meson.build
+@@ -10,7 +10,9 @@ project('icecream-sundae', 'cpp',
+ 
+ icecc = dependency('icecc')
+ glib = dependency('glib-2.0')
++
+ ncurses = dependency('ncursesw')
++ncurses_cxxflag = '-DNCURSES_WIDECHAR'
+ 
+ cxx = meson.get_compiler('cpp')
+ 
+@@ -33,8 +35,8 @@ int main(int argc, char **argv)
+ if not cxx.links(code, dependencies: deps, name: 'libicecc links dynamically')
+     icecc = dependency('icecc', static: true)
+     liblzo2 = cxx.find_library('lzo2')
+-    libcapng = dependency('libcap-ng')
+-    deps += [libcapng, liblzo2]
++    libcapng = dependency('libcap-ng', required: false)
++    deps += [liblzo2, libcapng, libzstd]
+ endif
+ 
+ incdir = include_directories('src')
+@@ -64,7 +66,8 @@ icecream_sundae = executable('icecream-sundae',
+     ['src/main.cpp', 'src/draw.cpp', 'src/scheduler.cpp', 'src/simulator.cpp'],
+     include_directories: incdir,
+     dependencies: deps,
+-    install : true
++    install : true,
++    cpp_args: ncurses_cxxflag
+     )
+ 
+ install_data('icecream-sundae.desktop',
+-- 
+2.30.0
+
diff --git a/srcpkgs/icecream-sundae/patches/0002-Avoid-unnecessary-ncurses-clear-of-the-screen.patch b/srcpkgs/icecream-sundae/patches/0002-Avoid-unnecessary-ncurses-clear-of-the-screen.patch
new file mode 100644
index 00000000000..1062bf4cd61
--- /dev/null
+++ b/srcpkgs/icecream-sundae/patches/0002-Avoid-unnecessary-ncurses-clear-of-the-screen.patch
@@ -0,0 +1,33 @@
+upstream: yes
+
+From c1324f186bc526aed7b3a63dfe514d34870548fb Mon Sep 17 00:00:00 2001
+From: Kevin Pulo <kev@pulo.com.au>
+Date: Tue, 19 Nov 2019 21:49:48 +1100
+Subject: [PATCH] Avoid unnecessary ncurses clear() of the screen.
+
+Instead, just erase() the screen, so that it can be drawn over again and
+then flushed at refresh() time.
+
+This fixes the problem where redraws in a slow terminal (eg. mosh or
+over a slow ssh link) sometimes render the cleared screen, causing a
+distracting visible "flash".
+---
+ src/draw.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/draw.cpp b/src/draw.cpp
+index 1ae1eb8..ec66a56 100644
+--- a/src/draw.cpp
++++ b/src/draw.cpp
+@@ -829,7 +829,7 @@ void NCursesInterface::doRender()
+ 
+ void NCursesInterface::doRedraw()
+ {
+-    clear();
++    erase();
+     doRender();
+     refresh();
+ }
+-- 
+2.30.0
+
diff --git a/srcpkgs/icecream-sundae/template b/srcpkgs/icecream-sundae/template
new file mode 100644
index 00000000000..7bbbef745b5
--- /dev/null
+++ b/srcpkgs/icecream-sundae/template
@@ -0,0 +1,14 @@
+# Template file for 'icecream-sundae'
+pkgname=icecream-sundae
+version=1.0.0
+revision=1
+build_style=meson
+hostmakedepends="pkg-config"
+makedepends="icecream-devel glib-devel ncurses-devel"
+short_desc="Commandline monitor for Icecream"
+maintainer="Piraty <piraty1@inbox.ru>"
+license="GPL-2.0-or-later"
+homepage="https://github.com/JPEWdev/icecream-sundae"
+distfiles="https://github.com/JPEWdev/icecream-sundae/archive/v${version}.tar.gz"
+checksum=15c357664e47e255044bc4c4e7aaa4dfd911ee7282e2390b7770f2a14c02ae5e
+patch_args="-Np1"

  parent reply	other threads:[~2021-01-12 13:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 19:45 [PR PATCH] " Piraty
2021-01-11  9:10 ` [PR PATCH] [Updated] " Piraty
2021-01-12 13:47 ` Piraty [this message]
2021-11-06 22:32 ` abenson
2021-11-06 22:32 ` [PR PATCH] [Closed]: " abenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210112134728.NN9lt3TIBWNsQfzGdekzVOvDbsW1MQGuah5RqqZe8Fk@z \
    --to=piraty@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).