Skip to content

Conversation

@notgne2
Copy link
Contributor

@notgne2 notgne2 commented Jan 9, 2023

Description of changes

Since profile_path always looks at a sub-path of the system closure and calls os.path.realpath, this ensures the paths we use always face the exact content we want for systemd-boot, and not a link to them. This solves various issues with https://github.com/serokell/deploy-rs and anything else that may put certain paths behind symlinks.

For when we don't want a specific sub-path, we instead look for the parent of a specific sub-path, by still using profile_path() but wrapping it with os.path.dirname()

Fully resolves serokell/deploy-rs#31 (currently partially hacked around by nuking default out of the file)

Likely resolves serokell/deploy-rs#185 as long as using systemd-boot (others haven't been yet been tested).

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.05 Release Notes (or backporting 22.11 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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@notgne2 notgne2 requested a review from dasJ as a code owner January 9, 2023 05:19
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jan 9, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 9, 2023
@notgne2 notgne2 requested a review from a team as a code owner January 12, 2023 06:06
@github-actions github-actions bot added the 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. label Jan 12, 2023
@notgne2 notgne2 force-pushed the fix/systemd-boot-always-profile-path branch 5 times, most recently from 39238dd to 601cd33 Compare January 12, 2023 08:44
@github-actions github-actions bot removed the 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. label Jan 12, 2023
@tomberek
Copy link
Contributor

Initial testing looks good.

Copy link
Member

@RaitoBezarius RaitoBezarius left a comment

Choose a reason for hiding this comment

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

Apologies for the delay in the review, I wanted to do this when my mental load was low. :)
This seems a clear improvement and I do not see why it would produce any regression, at least, it should introduce new bugs, old ones can still lurk into that code.

@nikstur We should check what we do in lzbt regarding this kind of things.

@RaitoBezarius
Copy link
Member

@notgne2 Can you fix the conflicts please? I think I would be eager to merge this as it has waited long enough.

@figsoda figsoda added the 12.approvals: 1 This PR was reviewed and approved by one person. label Mar 5, 2023
@notgne2 notgne2 force-pushed the fix/systemd-boot-always-profile-path branch from 601cd33 to ca9f068 Compare March 5, 2023 13:14
@RaitoBezarius
Copy link
Member

@ofborg test systemd-boot

@RaitoBezarius RaitoBezarius merged commit ac93edb into NixOS:master Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

systemd-initrd booted NixOS does not activate Default boot entry is never updated

4 participants