Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specialisation: limit the allowed characters in specialisation names #333952

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

r-vdp
Copy link
Contributor

@r-vdp r-vdp commented Aug 11, 2024

Description of changes

Since the systemd boot counting PR was merged, dashes in specialisation names cause issues when installing the boot loader entries, since dashes are also used as separator for the different components of the file name of the boot loader entries on disk.

The assertion avoids this footgun which is pretty annoying to recover from.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Since the systemd boot counting PR was merged, dashes in specialisation
names cause issues when installing the boot loader entries, since dashes
are also used as separator for the different components of the file name
of the boot loader entries on disk.

The assertion avoids this footgun which is pretty annoying to recover
from.
@r-vdp
Copy link
Contributor Author

r-vdp commented Aug 11, 2024

@ofborg test nixos-rebuild-specialisations

Copy link
Contributor

@K900 K900 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@flokli flokli merged commit fc35704 into NixOS:master Aug 12, 2024
23 checks passed
@K900
Copy link
Contributor

K900 commented Aug 12, 2024

This broke the ACME test:

Invalid specialisation names: caddy-change-acme-conf, concurrency-limit, httpd-change-acme-conf, httpd-remove-alias, lego-server, nginx-change-acme-conf, nginx-remove-alias, ocsp-stapling, slow-startup

@flokli
Copy link
Contributor

flokli commented Aug 12, 2024

dashes in specialisation names cause issues when installing the boot loader entries

Looks like we might want to convert these to underscores.

@r-vdp r-vdp deleted the specialisation-name-regex branch August 12, 2024 11:57
@r-vdp r-vdp mentioned this pull request Aug 12, 2024
13 tasks
@vcunat
Copy link
Member

vcunat commented Aug 13, 2024

nixos-unstable channel is blocked because of this. It can't even evaluate, e.g. nix eval -f. nixosTests.switchTest.outPath

EDIT: should get fixed by #334379

@PedroHLC
Copy link
Member

PedroHLC commented Aug 13, 2024

It's interesting this PR, newer than #333857, while having a broken solution, got merged first. And even almost hit nixos-unstable.
What went wrong? No research for duplicates before opening it? Wrong/Unrelated committers tagged for reviewing (here and/or there)? It would be convenient to understand and avoid this in the future.

Release notes would have been cool. Add a test for "rebuilding-specialisations" too.

@flokli
Copy link
Contributor

flokli commented Aug 13, 2024

It's interesting this PR, newer than #333857, while having a broken solution, got merged first. And even almost hit nixos-unstable. What went wrong? No research for duplicates before opening it? Wrong/Unrelated committers tagged for reviewing (here and/or there)? It would be convenient to understand and avoid this in the future.

Release notes would have been cool. Add a test for "rebuilding-specialisations" too.

I already spoke with @JulienMalka in private and apologized for being a bit too trigger-happy here. Didn't expect this to cause a lot of regressions, and I was wrong. Sorry.

ElvishJerricco added a commit to ElvishJerricco/nixpkgs that referenced this pull request Aug 14, 2024
…e-regex"

This reverts commit fc35704, reversing
changes made to c67d90d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants