From: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: The Shepherd on Fibers
Date: Sat, 26 Mar 2022 12:06:27 +0100 [thread overview]
Message-ID: <20220326110627.dm3t7u2jtjxz5xf6@pelzflorian.localdomain> (raw)
In-Reply-To: <87ee2sfg9d.fsf@inria.fr>
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 (_ #(#<directory (guile-user) 7ffff6fdec80> #<module ?>))
159:9 14 (_ #(#<directory (guile-user) 7ffff6fdec80> #<module ?>))
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 #<procedure 7ffff5f4ea50 at ice-?>)
3556:26 7 (_)
In unknown file:
6 (primitive-load-path "shepherd/service" #<procedure 7ff?>)
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 #<procedure 7ffff5f3b410 ?>)
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
next prev parent reply other threads:[~2022-03-26 11:06 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 22:36 The Shepherd on Fibers Ludovic Courtès
2022-03-25 13:29 ` Maxim Cournoyer
2022-03-26 21:28 ` Ludovic Courtès
2022-03-26 11:06 ` pelzflorian (Florian Pelz) [this message]
2022-03-26 11:09 ` Zhu Zihao
2022-03-26 11:16 ` Zhu Zihao
2022-03-26 11:18 ` pelzflorian (Florian Pelz)
2022-03-26 11:27 ` Zhu Zihao
2022-03-26 16:56 ` pelzflorian (Florian Pelz)
2022-03-26 11:59 ` Maxime Devos
2022-03-26 16:52 ` pelzflorian (Florian Pelz)
2022-03-26 18:20 ` Maxime Devos
2022-03-29 11:44 ` Ludovic Courtès
2022-03-26 12:03 ` Maxime Devos
2022-03-29 12:47 ` Ludovic Courtès
2022-03-26 12:11 ` Maxime Devos
2022-03-29 12:48 ` Ludovic Courtès
2022-03-29 16:26 ` Maxime Devos
2022-03-30 15:14 ` Ludovic Courtès
2022-03-30 17:16 ` Maxime Devos
2022-03-26 12:16 ` Maxime Devos
2022-03-29 12:50 ` Ludovic Courtès
2022-03-29 12:52 ` Maxime Devos
2022-03-29 12:54 ` Maxime Devos
2022-03-29 15:29 ` Attila Lendvai
2022-03-30 10:05 ` Ludovic Courtès
2022-03-31 4:33 ` adriano
2022-03-31 7:56 ` Attila Lendvai
2022-03-26 12:44 ` Maxime Devos
2022-03-29 13:03 ` Ludovic Courtès
2022-03-26 19:24 ` Maxime Devos
2022-03-29 0:14 ` Philip McGrath
2022-03-29 0:22 ` Philip McGrath
2022-03-29 9:36 ` Maxime Devos
2022-03-29 11:11 ` Philip McGrath
2022-03-30 10:00 ` Ludovic Courtès
2022-03-29 10:13 ` Zhu Zihao
2022-03-29 10:40 ` Maxime Devos
2022-03-30 9:49 ` Ludovic Courtès
2022-03-29 13:16 ` Ludovic Courtès
-- strict thread matches above, loose matches on Subject: below --
2022-03-24 6:48 Brendan Tildesley
2022-03-24 16:57 Nathan Dehnel
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220326110627.dm3t7u2jtjxz5xf6@pelzflorian.localdomain \
--to=pelzflorian@pelzflorian.de \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).