From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:35968) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr4Sm-0003uk-ST for guix-patches@gnu.org; Fri, 26 Jul 2019 13:57:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hr4Sl-0001cM-NE for guix-patches@gnu.org; Fri, 26 Jul 2019 13:57:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34505) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hr4Sl-0001Yv-Ja for guix-patches@gnu.org; Fri, 26 Jul 2019 13:57:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hr4Sk-0001IE-Fg for guix-patches@gnu.org; Fri, 26 Jul 2019 13:57:02 -0400 Subject: [bug#36555] [PATCH v6 3/3] tests: Add reconfigure system test. Resent-Message-ID: From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) References: <87imsci9sj.fsf@sdf.lonestar.org> <87ftn63l7d.fsf@sdf.lonestar.org> <87v9w1zgon.fsf_-_@sdf.lonestar.org> <87y30v3qke.fsf@sdf.lonestar.org> <871rylrjt8.fsf_-_@sdf.lonestar.org> <87wogdq575.fsf_-_@sdf.lonestar.org> <87r26lq531.fsf_-_@sdf.lonestar.org> <87muh9q51e.fsf_-_@sdf.lonestar.org> <87wogc4v6e.fsf@gnu.org> <87zhl69box.fsf@sdf.lonestar.org> <87o91laojb.fsf_-_@sdf.lonestar.org> <87k1c9aofq.fsf_-_@sdf.lonestar.org> <87ftmxaodv.fsf_-_@sdf.lonestar.org> <87ftmwz8mc.fsf@gnu.org> <877e889tyj.fsf@sdf.lonestar.org> <87tvbc8dgi.fsf@sdf.lonestar.org> <87muh3bdf4.fsf_-_@sdf.lonestar.org> <87imrrbddx.fsf_-_@sdf.lonestar.org> <87ef2fbdcx.fsf_-_@sdf.lonestar.org> <87a7d3bdc1.fsf_-_@sdf.lonestar.org> <87wog4k9yx.fsf@gnu.org> Date: Fri, 26 Jul 2019 13:53:03 -0400 In-Reply-To: <87wog4k9yx.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 26 Jul 2019 18:59:50 +0200") Message-ID: <87imrolm2o.fsf@sdf.lonestar.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 36555-done@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo, Ludovic Court=C3=A8s writes: > Hi there! > > I=E2=80=99ve applied the whole series with the change below. \o/ Awesome, thank you! > Because of the monadic style, the =E2=80=98guard=E2=80=99 clause had no e= ffect: > > scheme@(guile-user)> ,run-in-store (guard (c (#t 'caught)) (mbegin %store= -monad (return 1)(return (raise (condition (&message (message "oh!"))))))) > While executing meta-command: > Throw to key `srfi-34' with args `(#)'. My thoughts were similar when I was working on earlier versions of this series, so I had devised the following snippet: --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=example.scm (use-modules (guix monads) (guix store) (srfi srfi-34) (srfi srfi-35)) (define (monadic-procedure) (catch #t (lambda () (guard (c ((message-condition? c) (format (current-error-port) "error: ~a~%" (condition-message c)) (throw c))) (mbegin %store-monad (return (raise (condition (&message (message "Bogus error")))))))) (lambda _ (mbegin %store-monad (return (format #t "Error was caught~%")))))) (with-store store (run-with-store store (monadic-procedure))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Which, when run, outputs the following: jakob@Epsilon ~ $ guile example.scm error: Bogus error Error was caught I have a fairly weak understanding of monads, how they're implemented in Guix, and how exception handling works in Guile, so I'm not entirely sure why one example works and the other doesn't. Either way, > I thought about adding it in some other way, but it turns out not to > be needed at all because error conditions are guarded against in > =E2=80=98guix-system=E2=80=99. Hence the patch. I suppose that, in that case, we don't really need to worry about it. > Thank you for the hard work on this series! And thank you for all of the code review you've done :) > I=E2=80=99ll be away from keyboard roughly until August 17th. Hopefully y= ou > can get feedback from David or Chris, and maybe you can get others on > board as well. :-) If my opinion on changes to the core is needed, you > can always push to a separate branch in the meantime. Anyway, I=E2=80=99m > confident! Sounds good. Take care, Ludo! Regards, Jakob --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEa1VJLOiXAjQ2BGSm9Qb9Fp2P2VoFAl07Pf8ACgkQ9Qb9Fp2P 2VrIWg//V1avkkBnXtlTTiZyMaCWpU6wh/S+7lfXJROs9X783yvNoR0HIFxk7otQ gPApV8I6LMFqZ/slSntvgF5D6wvm/AlLf9fkSdW9RHU2uNZO2ttgVxNn9NHwGoDJ EQcawe/LSOhk/4BSJj9qaOnS05vicc2uZPd1rtwfnN8AIZB/x95czrynWRcdU/c3 xV2KliCp6K1iO5VoEqC48kAS48iwqmVsYuA/73INaKs69N9P3PkKycNz4lW5Zw/H 7/z6CoXm67JSQnz9w7eJ9guMU8SIki/TdMD8ewl2dZ6o54QTCUAF8z/xn3C8X1Mo ab0nrIdMUUNIpmuW6OofWCF8sR5Ni07UxyKmDTs2CiuJn554lRXNZM0s336wKh+G jTQYf3HD/zt2X9CQ8/1ARsB5scEeSwKvMV1HOFujaBX21+kq5UFgrRrs5JszoEz+ VfaCF4MUDKKkQDEIhVvrcI5TbrwEhzEyH7sprKCDw9Vblnr9fS9gyMZRiGnW5cuL BFDpDP0QD/X6KfWjyUYFYWalftmz9T1VzG6LG4ZNoG65Rznk5KPFl94t7vZGeiKF RIXgW3/dY/jNv7DYCfzcBoFYdYtDoFY50Z6rrlZ2cbdUzaUxDBXkAgGJU+o97ccg n38WnP+wTvHc0ZKO3dapaTv3JapbD7coWwMAezfiIRbRP/3W1qQ= =Fvuv -----END PGP SIGNATURE----- --==-=-=--