From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyUu1-0003JW-De for guix-patches@gnu.org; Tue, 20 Mar 2018 23:59:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyUty-0001bT-Bg for guix-patches@gnu.org; Tue, 20 Mar 2018 23:59:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36779) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eyUty-0001bN-8J for guix-patches@gnu.org; Tue, 20 Mar 2018 23:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eyUtx-0006r2-Ru for guix-patches@gnu.org; Tue, 20 Mar 2018 23:59:01 -0400 Subject: [bug#30572] [PATCH 6/7] system: Add "guix system docker-image" command. Resent-Message-ID: From: Chris Marusich In-Reply-To: <877eqal62w.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 17 Mar 2018 22:56:07 +0100") References: <20180222102933.4978-1-cmmarusich@gmail.com> <20180315040915.5556-1-cmmarusich@gmail.com> <20180315040915.5556-7-cmmarusich@gmail.com> <877eqal62w.fsf@gnu.org> Date: Wed, 21 Mar 2018 04:58:35 +0100 Message-ID: <87370u6pw4.fsf@gmail.com> 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: 30572@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> + (define json >> + ;; Pick the guile-json package that corresponds to the Guile used t= o build >> + ;; derivations. >> + (if (string-prefix? "2.0" (package-version (default-guile))) >> + guile2.0-json >> + guile-json)) > > I think we can use =E2=80=98guile-json=E2=80=99 unconditionally here. Good point. Nobody using this new code will be using Guile 2.0, so we can just use guile-json unconditionally. Does that mean we can also clean up the same conditional statement from other places in Guix code now? >> + (mkdir root-directory) >> + (initialize root-directory) >> + (build-docker-image >> + (string-append "/xchg/" #$name) ;; The output file. >> + (cons* root-directory >> + (call-with-input-file (string-append "/xchg/" #$g= raph) >> + read-reference-graph)) >> + #$os-drv >> + #:compressor '(#+(file-append gzip "/bin/gzip") "-9n") >> + #:creation-time (make-time time-utc 0 1) >> + #:transformations `((,root-directory -> ""))))))) > > Am I right that the whole point of passing several file names to > =E2=80=98build-docker-image=E2=80=99 is that here we don=E2=80=99t need t= o copy the whole store > to =E2=80=98root-directory=E2=80=99, right? The primary reason why I made this change was because it was the simplest way I could find to re-use the existing code. The fact that we copy less is a nice secondary effect, but it is not the primary reason why I structured it this way. There might be a simpler way to accomplish this, but this way works, which I think is a good start. I would like to commit this as-is for now. If we can figure out a simpler way to implement the same logic, I'd be all for it, but it seems tricky. The original role of the "PATH" argument was surprising (for example, it was not actually used for adding any paths to the final Docker image!). In addition, the original code assumed that all the paths to add (loaded from the "CLOSURE" graph file argument - not from PATH!) are store paths, which is not true when creating a GuixSD Docker image (unless we try to copy everything created by root-partition-initializer back into the store). So, some of the paths I need to add are store paths, and some of them are paths to special files outside the store, like device files. Maybe we can copy all of this (including device files and socket files) into a single directory in the store (or outside of the store). I don't know. If it's possible, I agree it would be a nice improvement. But I tried various methods, and my latest patch was the simplest method I found that worked. I would definitely be happy if we could simplify it even more, but I also want to move forward with this patch series. Is it OK to commit this as-is (with just the guile-json change you suggested above)? =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlqx2GsACgkQ3UCaFdgi Rp3/+Q/+IWSE0eqtcK1ZsWSKWUcTXliWW2Amd7Lc04lQuFsWGg+sHjXPha0tuDJ3 ANnnU/j0B5HkHQPB9YRTDTvh/iAib+LP46YhDrLI5Cx8J2Iw9er3+N8aIECtF1h6 8viKEjXqg0JtNVbCppsfAJ16Ou48FKds54nGDhuPR1i7kGA/pMbXXcInruoUiOp8 1Yz+cMQgBNOkdYKIUxzKoCQayBP8Sndb6BuTNZH7yqQCGoDikeTTRuhX/SpLGzfJ tyP1M3o8AtADszOXUQQYnPzLn3ZBLVx2LjBMJMshx2I3kmKmAEfrR6eaU2fKdz2a 4PwgemZzCWYHVhN8lyIMeOUJFr/d9+8Hqq0Ro7+wFYR5YKXZFpCmozl0Lt5TqtK7 G3NzV+gVdSHPWLO5DzkHDVitCgaE1FvV/XmsY2KjYrCcL+Xdyv4358e8OO+h2FXp cKd99t7jMvROPy1leZchIPejU04NWXmWMVGPV8pM6MZkDheYR+Mcd4Vj62vnoR5W F3NnMG1v3Lh5/6lMw/xeyGU7sAdCOFV0Zng61ak6mz2LNakTwIiAKIFkTixLFuvo SvUChu/0MNdwyV9m5xymGc1wJpP9hlDPr5SfcgeWb9sdaf6RVbA3tke8Mg3IH9sU 14jnobPoaCq+q6VLxsUw9FzIVMY764Azq9kMbUp7yiYLFg9ngp8= =Fo3l -----END PGP SIGNATURE----- --=-=-=--