Skip to content

NixNAR: cope with compress_num_threads being declared twice - #1837

Open
vmfunc wants to merge 1 commit into
NixOS:masterfrom
vmfunc:nixnar-compress-threads
Open

NixNAR: cope with compress_num_threads being declared twice#1837
vmfunc wants to merge 1 commit into
NixOS:masterfrom
vmfunc:nixnar-compress-threads

Conversation

@vmfunc

@vmfunc vmfunc commented Jul 23, 2026

Copy link
Copy Markdown
Member

Fixes #1389.

Config::General turns duplicate config keys into an array ref. The NixOS module always sets compress_num_threads, so setting it again in extraConfig ended up interpolating ARRAY(0x...) into the pixz command line and broke /nar/ serving with a shell syntax error.

This takes the last declared value, and also refuses to pass anything non-numeric into the shell command. Added a small unit test for the new helper.

Config::General turns duplicate config keys into an array ref, and the
NixOS module always declares compress_num_threads, so a second
declaration in extraConfig ended up interpolating ARRAY(0x...) into the
pixz command line and broke NAR serving with a shell syntax error.

Take the last declared value in that case, and drop anything
non-numeric instead of splicing it into the shell command.

Fixes NixOS#1389
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Field compress_num_threads declared twice break the cache.

1 participant