From: Alyssa Ross <hi@alyssa.is>
To: Demi Marie Obenour <demiobenour@gmail.com>
Cc: Spectrum OS Development <devel@spectrum-os.org>
Subject: Re: [PATCH] Add dontFixup=true to derivations that build images
Date: Tue, 28 Oct 2025 13:57:56 +0100 [thread overview]
Message-ID: <87ikfzmbe3.fsf@alyssa.is> (raw)
In-Reply-To: <20251025-dont-fixup-v1-1-9e10c24efbc3@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2017 bytes --]
Demi Marie Obenour <demiobenour@gmail.com> writes:
> This prevents lengthy and pointless scans of large image files.
> dontFixup is added to the derivations that already used
> unsafeDiscardReferences. Both dontFixup and unsafeDiscardReferences are
> added to a derivation that builds an ext4 filesystem image.
>
> Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
> ---
> host/initramfs/default.nix | 3 +++
> host/rootfs/default.nix | 1 +
> img/app/default.nix | 2 ++
> release/checks/integration/default.nix | 2 ++
> release/combined/default.nix | 3 +++
> release/combined/eosimages.nix | 1 +
> release/live/default.nix | 2 ++
> vm-lib/make-vm.nix | 1 +
> vm/sys/net/default.nix | 2 ++
> 9 files changed, 17 insertions(+)
Good idea!
> diff --git a/release/checks/integration/default.nix b/release/checks/integration/default.nix
> index 570918613e083b0c2d7c82486544b6405ae5ea89..582a4be8df3098ddaf318b7dac60690c2f8b2304 100644
> --- a/release/checks/integration/default.nix
> +++ b/release/checks/integration/default.nix
> @@ -37,6 +37,8 @@ let
>
> userData = runCommand "user-data.img" {
> nativeBuildInputs = [ e2fsprogs tar2ext4 ];
> + unsafeDiscardReferences = true;
> + dontFixup = true;
> } ''
> tar -Pcvf root.tar \
> --transform=s,^${appimage},test.appimage, ${appimage} \
This is not correct, because 1) unsafeDiscardReferences is an attribute
set; 2) it doesn't do anything without __structuredAttrs.
https://nix.dev/manual/nix/2.26/language/advanced-attributes#adv-attr-unsafeDiscardReferences
So I'm going to make a standalone commit first that adds
__structuredAttrs and unsafeDiscardReferences here, and then apply the
rest of this. I'll also tweak it to group __structuredAttrs,
unsafeDiscardReferences, and dontFixup, so it's clear they should be
applied together if being copied.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
next prev parent reply other threads:[~2025-10-28 12:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-25 18:06 [PATCH] Add dontFixup=true to derivations that build images Demi Marie Obenour
2025-10-28 12:57 ` Alyssa Ross [this message]
2025-10-28 22:37 ` Demi Marie Obenour
2025-10-28 13:37 ` Alyssa Ross
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ikfzmbe3.fsf@alyssa.is \
--to=hi@alyssa.is \
--cc=demiobenour@gmail.com \
--cc=devel@spectrum-os.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://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
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 NNTP newsgroup(s).