From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iObjOdDzPmLmhAAAgWs5BA (envelope-from ) for ; Sat, 26 Mar 2022 12:06:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yBaLNtDzPmLZvQAAauVa8A (envelope-from ) for ; Sat, 26 Mar 2022 12:06:56 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6411412C27 for ; Sat, 26 Mar 2022 12:06:56 +0100 (CET) Received: from localhost ([::1]:40992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nY4Fz-0006fS-5x for larch@yhetil.org; Sat, 26 Mar 2022 07:06:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nY4Fn-0006f9-JG for guix-devel@gnu.org; Sat, 26 Mar 2022 07:06:43 -0400 Received: from pelzflorian.de ([5.45.111.108]:40566 helo=mail.pelzflorian.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nY4Fl-0007Ux-HT; Sat, 26 Mar 2022 07:06:43 -0400 Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id 56480360630; Sat, 26 Mar 2022 12:06:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1648292797; bh=TMigDbSUSsx3xNVP8KlN4fNElf8QGYRGqdFhyz8GArc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=PtrYTh0/Ux1fORsawdoLOCxvgwYi7YvW+txjps/aDeMahJ1q6oibr5WSL9vUkEBPV icLu5zDybXl2PZvEj5yQoDiHpOogoChEvlu0KL0lS3BVZFvAjHVXTceIT6raEhK42a 35k+zFwQ83j1QoMd5rvCSgc7o78c9SgvPuhNrwSE= Date: Sat, 26 Mar 2022 12:06:27 +0100 From: "pelzflorian (Florian Pelz)" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: The Shepherd on Fibers Message-ID: <20220326110627.dm3t7u2jtjxz5xf6@pelzflorian.localdomain> References: <87ee2sfg9d.fsf@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87ee2sfg9d.fsf@inria.fr> Received-SPF: pass client-ip=5.45.111.108; envelope-from=pelzflorian@pelzflorian.de; helo=mail.pelzflorian.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648292816; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=vnp4FEKmSn7MbtR6W37LG3wFO63tUrE1RAc8BwXtq+4=; b=iSyzu1rlPdTphidRAZPJlZ6itKx1D8CnIFEiIL2K+WLqsBLC7KiWUrWfwPJ5FYrp0qNaMn kafs1GVMFkeg4H8bX3qW8FVYfBcgTOuaqfsWJ/2ihRYagKvBFjyRsTf97qrKse0VBsMgsj r/jyh+TS+xPs9SPuuITjiFWkaUjDsu1pRvVPYthQvpbuB6Z0v4739KNnu0hW2nm6iPx4YB iKwYnxJ1u0y7UEX2IUgVHdgkfV87Rv/Ihh/532aJzjR/tkldf8xwRB3pdm7ugF9VYlVlAF oYVT+78ELKjScrfuTLU2/q61rraVPVWKxuyBHjiSpovoEPRCJbE/JWg6os2nUg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648292816; a=rsa-sha256; cv=none; b=NuWqC+fy9y0n7+wzRiiSZu3rX6O/kgYDw05gnaNOQFRB+2VQ/XfiNh32KyPjmp7bVpPJOr rKWcxTtJLzrlQbsm1ol7kErWiptpL3BgKJIT3prxt+Bq+XSE70qKNHARUV7bt5He1VV2OB woGL8cBVxvsJbKOe9besKw0df6hrUjufkh0ANYqiXI6YNBnFQg8beje9MFZT+oEWFamw5w yCMs6FQI8xilJL5KvMlIKkhAu1Qz+IBwOMkRqV5oOKGuhdwy7cXvYghZdxzhWbnT/Dd8p5 lFBcormcsdbArSW92251R17H+5uHyz4Y+ul/isZU/UYTKot6qY1HkKQdh4kqiQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=pelzflorian.de header.s=mail header.b="PtrYTh0/"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 1.12 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=pelzflorian.de header.s=mail header.b="PtrYTh0/"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6411412C27 X-Spam-Score: 1.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: Pq8TEBteQvJv Hi Ludo! That you add fibers to Shepherd is great news. On Wed, Mar 23, 2022 at 11:36:30PM +0100, Ludovic Courtès wrote: > Fibers is used in a single-threaded fashion, which is the main > constraint for shepherd since it forks. That also means that fibers > cannot be preempted, so it’s fully cooperative scheduling. To understand what you mean, I needed to read shepherd commit 934204fbd158aa9fbd42914b89aa960f99eef125 + ;; Run Fibers in such a way that it does not create any POSIX thread, + ;; because POSIX threads and 'fork' cannot be used together So shepherd service authors still cannot write blocking code but need to yield? > I’ve done some Guix System testing in VMs and didn’t notice any major > issues. I’d like to merge that branch in ‘master’ and to eventually > release it as 0.9.0 (with or without socket activation, we’ll see.) > Hopefully, we could be running it within a couple of weeks. I wanted to test too how much time it takes to boot to GDM on my slow 2010 dual-core Macbook, but I can’t quite figure out each shepherd- service failing to build. How did you test the new shepherd in Guix? florian@florianmacbook ~/git/guix [env]$ gzip -cd /var/log/guix/drvs/f3/g9drzlg8vkzp6z81dcdsnfnaqa2anx-shepherd-avahi-daemon.go.drv.gz Backtrace: 16 (primitive-load "/gnu/store/4qk3x8dl8hxnwry637kq4ahh2z2?") In ice-9/eval.scm: 619:8 15 (_ #(# #)) 159:9 14 (_ #(# #)) In ice-9/boot-9.scm: 3326:17 13 (resolve-interface (shepherd service) #:select _ #:hide ?) In ice-9/threads.scm: 390:8 12 (_ _) In ice-9/boot-9.scm: 3252:13 11 (_) In ice-9/threads.scm: 390:8 10 (_ _) In ice-9/boot-9.scm: 3536:20 9 (_) 2835:4 8 (save-module-excursion #) 3556:26 7 (_) In unknown file: 6 (primitive-load-path "shepherd/service" #) In shepherd/service.scm: 26:0 5 (_) In ice-9/boot-9.scm: 3409:4 4 (define-module* _ #:filename _ #:pure _ #:version _ # _ ?) 2594:24 3 (call-with-deferred-observers #) 3422:24 2 (_) 222:17 1 (map1 (((fibers)) ((fibers scheduler) #:select (#)) # ?)) 3329:6 0 (resolve-interface (fibers) #:select _ #:hide _ #:prefix ?) ice-9/boot-9.scm:3329:6: In procedure resolve-interface: no code for module (fibers) Anyway, testing my boot time is not so important. I’d probably have to change something in gnu/services/shepherd.scm. Or I should rebuild shepherd in a less crude way. Feel free to ignore me, though for completeness, here’s what I did: * Pull shepherd wip-fibers commit abbdd1e8b0f8bd4b3952efc5614f560aab9a79bf. * I changed its Makefile.am and added -O1 to '$(GUILD) compile' because Guix normally does likewise in an origin snippet. * Then `guix shell -D shepherd autoconf automake guile-fibers help2man texinfo -- sh -c 'autoreconf -vif && ./configure --prefix=/home/florian/git/shepherd/out && make && make install'`. * Then to Guix I added to gnu/packages/admin.scm: (define-public new-shepherd (package (name "shepherd") (version "0.9.0") (source (local-file "/home/florian/git/shepherd/out" #:recursive? #t)) (build-system copy-build-system) (propagated-inputs (list guile-fibers)) (arguments `(#:install-plan '(("./" "")))) …)) ;; and synopsis, description, license, homepage and at the top #:use-module (gnu packages guile-xyz) to add guile-fibers to new-shepherd’s propagated inputs. Also #:use-module (guix build-system copy). * Lastly I grafted (define-public shepherd (package (name "shepherd") (replacement new-shepherd) … * Compiled Guix and reconfigured. Building /gnu/store/f3g9drzlg8vkzp6z81dcdsnfnaqa2anx-shepherd-avahi-daemon.go.drv failed. The same error happens when using new-shepherd as shepherd and rebuilding the GNOME world. Regards, Florian