From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 05 15:11:01 2023 Received: (at submit) by debbugs.gnu.org; 5 Dec 2023 20:11:01 +0000 Received: from localhost ([127.0.0.1]:38462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAbky-00068q-Td for submit@debbugs.gnu.org; Tue, 05 Dec 2023 15:11:01 -0500 Received: from lists.gnu.org ([2001:470:142::17]:55562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAbkv-00068Z-VG for submit@debbugs.gnu.org; Tue, 05 Dec 2023 15:10:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rAbkf-0001Pn-8x for bug-guix@gnu.org; Tue, 05 Dec 2023 15:10:41 -0500 Received: from mail-4018.proton.ch ([185.70.40.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rAbkb-0001gO-Gp for bug-guix@gnu.org; Tue, 05 Dec 2023 15:10:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail; t=1701807033; x=1702066233; bh=D+0FqFYDJkiQS4EqrEYcByXmXkwynEaxgYFNy7ODAUI=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=pX2918lW8PMz1Z5ciDs7Xy5gL3Urk8yc4E8doCyLMENpGnjab1FfqS5CobFDGOZWS 9PsE1o/QmWVWKunKiYhsz1S/GbeNHNC1cpIUcNTEm416hBEHxaCSYPds8P+D21PFO5 caaYaIFG9kzTx1/pZwA11KqMo1GoNgBqiI2ZY80eNc3aMHB6BkrDx6Zqgj6o4ni7IM ZpWvZFbsmzmRmR+u4xCSCMg/xKoWefKHcxAbE+R9KhV0Mqftj0p9aKxWFfp42SwPfq WWcMeiZ0zTSPJIxs5BRGE5e94scBJzwFFinhXGS/fuJgx+/T1ma0YlAjZ7/rMPuTG3 dhfWBUXis1v3w== Date: Tue, 05 Dec 2023 20:10:19 +0000 To: "bug-guix@gnu.org" From: Attila Lendvai Subject: shepherd: (shepherd support) is visible for start GEXP Message-ID: Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_zrke0617JdSAOOD2QoBfTT8uLE4uxDt9nolUVRK0Y" Received-SPF: pass client-ip=185.70.40.18; envelope-from=attila@lendvai.name; helo=mail-4018.proton.ch 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) This is a multi-part message in MIME format. --b1_zrke0617JdSAOOD2QoBfTT8uLE4uxDt9nolUVRK0Y Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable the facts: ---------- start GEXP's of services are loaded into unnamed modules. the definitions f= rom (shepherd support) are visible in these unnamed modules. see the attach= ed rerpoducer. it can be run with: $(guix system --no-graphic vm reproducer.scm) and in the VM (must use fold, because it's a dumb terminal): cat /var/log/messages | fold -150 and observe that (shepherd support) is listed. questions: ---------- is this indended? i.e. part of the shepherd API? if not, then this is probably a bug. looking at the public definitions in (= shepherd support), it's not obvious that those are meant to be available fo= r the users of shepherd. either way, this should probably be documented wit= h at least a comment at the top of the file. if this is intended, then where is this module imported? i looked all aroun= d, and i can't seem to find what mechanism imports this support module into= the unnamed module that are used for the GEXPs. my ultimate issue: ------------------ my service code has conflicting definitions with (shepherd support), and i = need to know the intent in the shepherd API to decide on the proper fix. --=20 =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CTact is a skill that can turn brutal honesty into just honesty. It= 's a skill that develops with practice, and one that's harder to use when e= motions are running high. But you can't go towards someone with a verbal fi= st and expect a hug in return. When method matches intention, outcomes are = much more peaceful.=E2=80=9D =09=E2=80=94 Doe Zantamata --b1_zrke0617JdSAOOD2QoBfTT8uLE4uxDt9nolUVRK0Y Content-Type: text/x-scheme; name=reproducer.scm Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=reproducer.scm OzsgUnVuIHdpdGggc29tZXRoaW5nIGxpa2UgdGhpczoKOzsgJChndWl4IHN5c3RlbSAtLW5vLWdy YXBoaWMgdm0gcmVwcm9kdWNlci5zY20pCgooZGVmaW5lLW1vZHVsZSAocmVwcm9kdWNlcikKICAj OnVzZS1tb2R1bGUgKGdudSBzeXN0ZW0pCiAgIzp1c2UtbW9kdWxlIChnbnUgc3lzdGVtIHNoYWRv dykKICAjOnVzZS1tb2R1bGUgKGdudSBzeXN0ZW0gbnNzKQogICM6dXNlLW1vZHVsZSAoZ251IHN5 c3RlbSB2bSkKICAjOnVzZS1tb2R1bGUgKGdudSB0ZXN0cykKICAjOnVzZS1tb2R1bGUgKGdudSBz ZXJ2aWNlcykKICAjOnVzZS1tb2R1bGUgKGdudSBzZXJ2aWNlcyBiYXNlKQogICM6dXNlLW1vZHVs ZSAoZ251IHNlcnZpY2VzIGRidXMpCiAgIzp1c2UtbW9kdWxlIChnbnUgc2VydmljZXMgc2hlcGhl cmQpCiA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XIgZ2V4cCBzcGVha2luZywgXApjdXJyZW50IG1vZHVs ZTogfkEsIFwKbW9kdWxlLXVzZXM6IH5BLCBcCnJpbmdidWZmZXI6IH5BfiUiCiAgICAgICAgICAg ICAgICAgICAgICAoY3VycmVudC1tb2R1bGUpCiAgICAgICAgICAgICAgICAgICAgICAobW9kdWxl LXVzZXMgKGN1cnJlbnQtbW9kdWxlKSkKICAgICAgICAgICAgICAgICAgICAgIChhbmQ9PiAobW9k dWxlLXZhcmlhYmxlIChjdXJyZW50LW1vZHVsZSkgJ3JpbmctYnVmZmVyKSB2YXJpYWJsZS1yZWYp KQogICAgICAgICAgICAgIDApKSkpKSkKICAgICViYXNlLXNlcnZpY2VzKSkpCg== --b1_zrke0617JdSAOOD2QoBfTT8uLE4uxDt9nolUVRK0Y-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 21 10:57:16 2024 Received: (at 67649) by debbugs.gnu.org; 21 Mar 2024 14:57:16 +0000 Received: from localhost ([127.0.0.1]:37056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnJr1-0001Q9-K5 for submit@debbugs.gnu.org; Thu, 21 Mar 2024 10:57:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnJqz-0001Pw-62 for 67649@debbugs.gnu.org; Thu, 21 Mar 2024 10:57:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnJqE-00016c-8D; Thu, 21 Mar 2024 10:56:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Dhz1KcVF3HhAf+YrlbbMu6eUtaQRSG8etQ9ayyq8ex4=; b=XkgrSCd359zqXPkcpafL h6zCn0ou2YRb1GjO3XnhYLaWVjQl2blhsD75v+Yvg5VrVinNCI0kx0/X3+1neqhR0ymolaUdy0Crt MwUUhDVGbPeuwk8GEtxXc+Qh+mCR+qwx12gKr4HsSEGAOhV10AyunSWXVTZO75kfgNpId9cZhxXeN k8Zj5rQAVUPVrfxgxr2uOnc8v0sJQO0Zy9meneSPa9yCNVT/R/9NqWy2lLTt4QRyOP7Zv3e7VU7Zs ewrcQJgnkZ6qaf2hcg3bbqsX28kOSHsZgg0DYRoXBArteIlh7SMUGBh5UlGt2RG4fDYDa9V0qMd9H bQvQxWlLv88O/w==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Attila Lendvai Subject: Re: bug#67649: shepherd: (shepherd support) is visible for start GEXP In-Reply-To: (Attila Lendvai's message of "Tue, 05 Dec 2023 20:10:19 +0000") References: Date: Thu, 21 Mar 2024 15:56:19 +0100 Message-ID: <871q83vdkc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67649 Cc: 67649@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Attila Lendvai skribis: > start GEXP's of services are loaded into unnamed modules. the definitions= from (shepherd support) are visible in these unnamed modules. see the atta= ched rerpoducer. It=E2=80=99s more than (shepherd support): --8<---------------cut here---------------start------------->8--- shepherd[1]: Starting service reproducer... shepherd[1]: *** reproducer gexp speaking, current module: #, mor face (oop goops) 7f2cf8a89c80> #= # # # # # # # # # # # # # # # # # # # # # # # # # # # # #<= custom-interface (guixl d utils) 7f2cf7adf8c0> # = # # # # # # # # #), ringbuffer: # --8<---------------cut here---------------end--------------->8--- > is this indended? i.e. part of the shepherd API? It=E2=80=99s not really intended. In Guix, =E2=80=98shepherd-service=E2=80=99 instances have a =E2=80=98modul= es=E2=80=99 field. Many, like the one for mcron, have (shepherd support) there because they need it for one thing or another. Now, your =E2=80=98reproducer=E2=80=99 service has a default =E2=80=98modul= es=E2=80=99 field so why does it see those modules anyway? First, note that (current-module) called from the =E2=80=98start=E2=80=99 m= ethod does *not* return the module where that =E2=80=98start=E2=80=99 method was defin= ed. Still, what we see here is that the module in which the shepherd config file is evaluated has way more imports than expected. This stems from the way services get loaded on Guix System, in =E2=80=98shepherd-configuration-file=E2=80=99: (register-services (parameterize ((current-warning-port (%make-void-port "w"))) (map load-compiled '#$(map scm->go files)))) Thus, each one of =E2=80=98files=E2=80=99 augments the imports of the curre= nt module, eventually leading to this import soup. This is a Guix bug we can fix by loading each service file in a fresh module: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index f5bcde721f..6b8527f0dc 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -383,6 +383,14 @@ (define (shepherd-configuration-file services shepherd) (use-modules (srfi srfi-34) (system repl error-handling)) + (define (make-user-module) + ;; Copied from (shepherd support), where it's private. + (let ((m (make-fresh-user-module))) + ;; The typical configuration file wants to do '(service ...)', and + ;; '(register-services ...)', so provide the relevant bindings by default. + (module-use! m (resolve-interface '(shepherd service))) + m)) + ;; There's code run from shepherd that uses 'call-with-input-file' & ;; co.--e.g., the 'urandom-seed' service. Starting from Shepherd ;; 0.9.2, users need to make sure not to leak non-close-on-exec file @@ -416,7 +424,12 @@ (define (shepherd-configuration-file services shepherd) (register-services (parameterize ((current-warning-port (%make-void-port "w"))) - (map load-compiled '#$(map scm->go files)))))) + (map (lambda (file) + (save-module-excursion + (lambda () + (set-current-module (make-user-module)) + (load-compiled file)))) + '#$(map scm->go files)))))) (format #t "starting services...~%") (let ((services-to-start --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable There might be breakage due to services that currently get the modules they need =E2=80=9Cby chance=E2=80=9D (as a side effect of loading another = module), but at least this small sample works fine: make check-system TESTS=3D"basic openssh nginx static-networking static-n= etworking-advanced mcron hpcguix-web" -j4 I=E2=80=99ll push the patch soonish. Thanks! Ludo=E2=80=99. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 10:20:46 2024 Received: (at 67649-done) by debbugs.gnu.org; 31 Mar 2024 14:20:46 +0000 Received: from localhost ([127.0.0.1]:48180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqw3C-0001pC-F9 for submit@debbugs.gnu.org; Sun, 31 Mar 2024 10:20:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqw3B-0001ox-36 for 67649-done@debbugs.gnu.org; Sun, 31 Mar 2024 10:20:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqw30-00064U-RX; Sun, 31 Mar 2024 10:20:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=hVkO330FWNDMTB8aItA0UTGf+N5/HQGrTsPAnW1ijwU=; b=jLP56J3qAjH+P24vEqwy R3a7OzWzjYrUUkmSzTmikwQ0CDsj9DR26JSACAmDOqBolKgMWDrVMM1QJ2QkmQoJAVG0faBy8n7vc 9Ep5vTvfdI1cezjLZ5B8LgCZbWEfgZfYpvssK4aScvReBNTFMVTVm1/a5DvluhPrTKOodYYudpdiM DsNOw9IJT3tvPALiDqYVPAl72JDA05VauribTtvVXGRg1i0/HhJtd7kSQIXgKRVOB2ZMV4eumJcee Ius5tRmfjaHMbNFtnSiAZEo6mW8g2g8FuR70ulcsY4qyZcHkSyQTNKnAukKCe+bykm1eJkLqfclU7 GFCeK2q6n9CIfQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Attila Lendvai Subject: Re: bug#67649: shepherd: (shepherd support) is visible for start GEXP In-Reply-To: <871q83vdkc.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 21 Mar 2024 15:56:19 +0100") References: <871q83vdkc.fsf@gnu.org> Date: Sun, 31 Mar 2024 16:20:31 +0200 Message-ID: <87ttkmeb4g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67649-done Cc: 67649-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Ludovic Court=C3=A8s skribis: > This is a Guix bug we can fix by loading each service file in a fresh > module: [...] > I=E2=80=99ll push the patch soonish. Pushed as 6f9d844d2ece7b369d17bbe678978462425f869c last week. Thanks! Ludo=E2=80=99. From unknown Sun Jun 22 22:45:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 29 Apr 2024 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator