patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: Alyssa Ross <hi@alyssa.is>
Cc: Spectrum OS Development <devel@spectrum-os.org>
Subject: Re: [PATCH] Add dontFixup=true to derivations that build images
Date: Tue, 28 Oct 2025 18:37:56 -0400	[thread overview]
Message-ID: <d9f2d87e-a23d-4c43-8844-6371d5337e46@gmail.com> (raw)
In-Reply-To: <87ikfzmbe3.fsf@alyssa.is>


[-- Attachment #1.1.1: Type: text/plain, Size: 2243 bytes --]

On 10/28/25 08:57, Alyssa Ross wrote:
> 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!

Thank you!

>> 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.

That worked great!  I should read the Nix manual next time.
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-10-28 22:38 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
2025-10-28 22:37   ` Demi Marie Obenour [this message]
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=d9f2d87e-a23d-4c43-8844-6371d5337e46@gmail.com \
    --to=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    --cc=hi@alyssa.is \
    /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).