unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Tobias Geerinckx-Rice <me@tobias.gr>
Cc: 53194@debbugs.gnu.org
Subject: bug#53194: System test partition.img differs in size across hosts(?)
Date: Tue, 25 Jan 2022 12:54:50 -0500	[thread overview]
Message-ID: <87r18v4s5x.fsf@gmail.com> (raw)
In-Reply-To: <874k6akqlx.fsf@nckx> (Tobias Geerinckx-Rice's message of "Tue, 11 Jan 2022 20:31:27 +0100")

Hi Tobias,

[...]

> diff --git a/gnu/build/image.scm b/gnu/build/image.scm
> index bdd5ec25a9..81caa424f8 100644
> --- a/gnu/build/image.scm
> +++ b/gnu/build/image.scm
> @@ -3,7 +3,7 @@
>  ;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org>
>  ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
>  ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
> -;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
> +;;; Copyright © 2020, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
>  ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
> @@ -62,8 +62,10 @@ (define (size-in-kib size)
>  
>  (define (estimate-partition-size root)
>    "Given the ROOT directory, evaluate and return its size.  As this doesn't
> -take the partition metadata size into account, take a 25% margin."
> -  (* 1.25 (file-size root)))
> +take the partition metadata size into account, take a 25% margin.  As this in
> +turn doesn't take any constant overhead into account, force a 1-MiB minimum."
> +  (max (ash 1 20)
> +       (* 1.25 (file-size root))))
>  
>  (define* (make-ext-image partition target root
>                           #:key

Looks reasonable to me (although it is interesting that the behavior is
not the same across machines...).

While at it, you may want to fix this docstring:

--8<---------------cut here---------------start------------->8---
 (define (file-size file)
-  "Return the size of bytes of FILE, entering it if FILE is a directory."
+  "Return the size in bytes of FILE, entering it if FILE is a directory."
   (file-system-fold (const #t)
                     (lambda (file stat result)    ;leaf
                       (+ (stat:size stat) result))
--8<---------------cut here---------------end--------------->8---

in guix/build/store-copy.scm.

Thanks!

Maxim




  parent reply	other threads:[~2022-01-25 17:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 19:31 bug#53194: System test partition.img differs in size across hosts(?) Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-01-11 19:44 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-02-04  5:23   ` Leo Famulari
2022-02-04  5:32     ` Leo Famulari
2022-02-04 16:55       ` Leo Famulari
2022-01-25 17:54 ` Maxim Cournoyer [this message]
2022-02-06  4:42   ` Maxim Cournoyer
2022-02-06 17:41     ` Leo Famulari
2022-02-07 21:29       ` Maxim Cournoyer
2022-10-31  8:56     ` Mathieu Othacehe
2022-02-04  4:43 ` Leo Famulari
2022-02-04  5:17 ` Leo Famulari
2022-02-17 16:37 ` david larsson

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=87r18v4s5x.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=53194@debbugs.gnu.org \
    --cc=me@tobias.gr \
    /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).