Skip to content

nixos/bcachefs: soft-deprecate 'linuxPackages_testing_bcachefs'#267640

Merged
RaitoBezarius merged 4 commits intoNixOS:masterfrom
Madouura:pr/bcachefs
Nov 18, 2023
Merged

nixos/bcachefs: soft-deprecate 'linuxPackages_testing_bcachefs'#267640
RaitoBezarius merged 4 commits intoNixOS:masterfrom
Madouura:pr/bcachefs

Conversation

@Madouura
Copy link
Copy Markdown
Contributor

@Madouura Madouura commented Nov 15, 2023

Description of changes

It's time. Somewhat of a follow-up to #267195.
@amjoseph-nixpkgs Let me know if you don't want to be co-authored for the bcachefs-tools commit; Added you to it because this is more or less stealing your PR. Wanted to update everything bcachefs at once.
bcachefsEncrypted test will not pass until #256638 is out of staging and in master.
I am running this PR on my main machine currently, so encryption DOES work.
There shouldn't be any truly breaking changes AFAICT.

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/)
  • 23.11 Release Notes (or backporting 23.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.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: kernel The Linux kernel 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 15, 2023
@ofborg ofborg bot added the 8.has: clean-up This PR removes packages or removes other cruft label Nov 15, 2023
@ofborg ofborg bot requested a review from davidak November 15, 2023 10:41
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 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 Nov 15, 2023
@chayleaf
Copy link
Copy Markdown
Contributor

shouldn't it be possible to completely remove the Cargo.lock now that it's checked into git upstream?

Copy link
Copy Markdown
Member

@thoughtpolice thoughtpolice left a comment

Choose a reason for hiding this comment

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

Oh drat, I'm sorry. I'm already running testing and I merged #265820 as I wanted bcachefs-tools, I didn't realize this PR also included it. This otherwise looks great; I'm happy to sign off on it and merge it if you don't mind pulling that one out. Thank you!

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Nov 15, 2023
@Madouura Madouura force-pushed the pr/bcachefs branch 2 times, most recently from d16664f to b0361f8 Compare November 16, 2023 05:11
@Madouura
Copy link
Copy Markdown
Contributor Author

Oh drat, I'm sorry. I'm already running testing and I merged #265820 as I wanted bcachefs-tools, I didn't realize this PR also included it. This otherwise looks great; I'm happy to sign off on it and merge it if you don't mind pulling that one out. Thank you!

Done. Went ahead and added an update script and updated to 1.3.3.

@delroth delroth removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Nov 16, 2023
@YellowOnion
Copy link
Copy Markdown
Contributor

@thoughtpolice was that PR needed with my PR waiting in staging?

I feel a little bit blind since I'm not being mentioned in some of the maintenance of the code base, especially since I did a lot of work on the PR, I was hoping my PR would get through quicker, maybe I should cherry pick the commits that add me as a maintainer and merge them to master?

@Madouura we probably need to consider snapshots at some point as well, just been sleeping on it till my PR is merged. How did you get it working on your current system, did you endure the recompile times or something else?

Feel free to @ me on NixOS matrix as woobilicious I think most talk is happening in the System Programming area. My sleep schedule is chaotic so I'll try to get reply when I can.

@Madouura
Copy link
Copy Markdown
Contributor Author

@Madouura we probably need to consider snapshots at some point as well, just been sleeping on it till my PR is merged. How did you get it working on your current system, did you endure the recompile times or something else?

I'm not sure exactly what you're referencing, but I just have my nixos config flake set to this PR's branch and it works.

@Madouura
Copy link
Copy Markdown
Contributor Author

Madouura commented Nov 16, 2023

maybe I should cherry pick the commits that add me as a maintainer and merge them to master?

I think that would be the best option. linux_bcachefs_testing is now deprecated with this PR so I would suggest taking everything except changes to that and the util-linux changes and put it into master.
IIRC the util-linux changes are the blocking factor, and I imagine the reason why it's not in master yet is because of the cryptsetup testing issues.
Speaking of which, when is util-linux getting official bcachefs support? It's in linux-next now so I can't imagine it's too far from now...

@YellowOnion
Copy link
Copy Markdown
Contributor

@Madouura Oh I thought you had my PR running, the ordering of your comments had me thinking that.

There's a few misconceptions you seem to have:

  1. cryptsetup breaking is a bug triggered by building and running the cryptsetup tests on a bcachefs file system, moving /tmp off bcachefs, or use another system to build it fixed the issue for me.

  2. updating util-linux fixes the failing test, somewhere between 23.05 and 2.11 util-linux was updated, with broken bcachefs UUID support, nixos-generate-config output started generating /dev/disks/by-uuid paths, but a bug in util-linux only detects UUIDs with a freshly formatted FS (when running nixos-generate-config), once the superblock has grown (after installation) util-linux fails to read the UUID from the super block and setup /dev/disks/by-uuid. That is why the test fails, because the kernel can't find the device, and panics (panic on error).

  3. The changes in util-linux and the changes in bcachefs.nix are both required for unlocking an encrypted multi-disk system using UUID= syntax, by-uuid symlinks don't work for multi device systems, the current tests fail to account for this scenario, and we have no boot.initrd.luks.devices.<name>.device equivalent for bcachefs file systems, the included dynamic script that works directly on the UUID using the patched util-linux, is also far more robust to reboot reordered device paths (something driving me nuts for ages) and adding/removing devices from the bcachefs file system.

  4. The util-linux patches are official patches that are from the 2.39 branch, they plan on releasing a .3 release with a few other bug fixes.

  5. This PR was pushed in to staging due to the fact that util-linux is a system wide dependency, and requires a huge subset of Nixpkgs to be rebuilt.

  6. The reason why it works on your system is because you're using a single device, and ran nixos-generate-config with an old util-linux.

@Madouura
Copy link
Copy Markdown
Contributor Author

@Madouura Oh I thought you had my PR running, the ordering of your comments had me thinking that.

There's a few misconceptions you seem to have:

1. `cryptsetup` breaking is a bug triggered by building and running the cryptsetup tests on a bcachefs file system, moving /tmp off bcachefs, or use another system to build it fixed the issue for me.

2. updating `util-linux` **fixes the failing test**, somewhere between 23.05 and 2.11 util-linux was updated, with broken bcachefs UUID support, nixos-generate-config output  started generating  `/dev/disks/by-uuid` paths, but a bug in util-linux _only_ detects UUIDs with a freshly formatted FS (when running nixos-generate-config), once the superblock has grown (after installation) `util-linux` fails to read the UUID from the super block and setup `/dev/disks/by-uuid`. That is why the test fails, because the kernel can't find the device, and panics (panic on error).

3. The changes in `util-linux` and the changes in `bcachefs.nix` are both required for unlocking an encrypted multi-disk system using UUID= syntax, by-uuid symlinks don't work for multi device systems, the current tests fail to account for this scenario, and we have no `boot.initrd.luks.devices.<name>.device` equivalent for bcachefs file systems, the included dynamic script that works directly on the UUID using the patched util-linux, is also far more robust to reboot reordered device paths (something driving me nuts for ages) and adding/removing devices from the bcachefs file system.

4. The `util-linux` patches are official patches that are from the `2.39` branch, they plan on releasing a `.3` release with a few other bug fixes.

5. This PR was pushed in to staging due to the fact that `util-linux` is a system wide dependency, and requires a huge subset of Nixpkgs to be rebuilt.

6. The reason why it works on your system is because you're using a single device, and ran nixos-generate-config  with an old util-linux.

I appreciate the reply, that answered a few questions/misconceptions I had.

The reason why it works on your system is because you're using a single device, and ran nixos-generate-config with an old util-linux.

I'm not sure where you got this from. My setup is multi-device and encrypted.
My config also regenerates the (hardware) config every time I run make, so I don't think that's the case, since if it was, I would have been unable to boot several iterations ago.

@Madouura
Copy link
Copy Markdown
Contributor Author

To be clear, before this PR I actually was running your PR, as a test.

@YellowOnion
Copy link
Copy Markdown
Contributor

@Madouura Oh you must be using colon separated multi device system? I think I incorrectly assumed that wasn't possible on master for some reason. I moved away from that due to devices constantly swapping order and 5 by-id devices being too long for systemd to handle.

Were you using an old version? or perhaps only specific parts of my PR?

I'm now curious why it doesn't break, do you mind sharing?

@Madouura
Copy link
Copy Markdown
Contributor Author

@Madouura Oh you must be using colon separated multi device system? I think I incorrectly assumed that wasn't possible on master for some reason. I moved away from that due to devices constantly swapping order and 5 by-id devices being too long for systemd to handle.

Were you using an old version? or perhaps only specific parts of my PR?

I'm now curious why it doesn't break, do you mind sharing?

There's not much to say, I cherry-picked your PR's commits into a branch I used to have on my nixpkgs fork, disabled cryptsetup tests, did the correct overlays in my config, and it ran.

@Madouura Madouura mentioned this pull request Nov 16, 2023
13 tasks
@thoughtpolice
Copy link
Copy Markdown
Member

@thoughtpolice was that PR needed with my PR waiting in staging?

Perhaps it was not; I had not checked staging recently, which was my fault — I instead searched for open bcachefs patches but missed yours since it would have already been merged. I apologize for jumping the gun here! I should have left it to y'all.

I feel a little bit blind since I'm not being mentioned in some of the maintenance of the code base, especially since I did a lot of work on the PR, I was hoping my PR would get through quicker, maybe I should cherry pick the commits that add me as a maintainer and merge them to master?

Yes, my apologies. Please do add yourself as a maintainer so you can be CC'd on all this!

@Madouura
Copy link
Copy Markdown
Contributor Author

Staging finally got merged into master. 🎉
All tests pass. Running on my machine. 👍

@github-actions github-actions bot removed the 6.topic: kernel The Linux kernel label Nov 18, 2023
@github-actions github-actions bot added 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes labels Nov 18, 2023
@Madouura Madouura changed the title linux_testing_bcachefs: deprecate in favor of 'linux_testing' nixos/bcachefs: soft-deprecate 'linuxPackages_testing_bcachefs' Nov 18, 2023
@Madouura
Copy link
Copy Markdown
Contributor Author

Madouura commented Nov 18, 2023

All tests pass. Is this set of commits satisfactory?

/nix/store/xsrjql2kq7wiwr3l8k95q8nwxiqn5gn9-vm-test-run-bcachefs
/nix/store/26cwv970fxslanvwkj7jw2pg42k1cf78-vm-test-run-installer-bcachefs-simple
/nix/store/swglwmhv5l8yp8if33disv75zv2nh9h3-vm-test-run-installer-bcachefs-multi
/nix/store/59l2yyyyqyz2ypxdr2kzkigs203xrams-vm-test-run-installer-bcachefs-encrypted
/nix/store/57d15zga689bi56sndzjgid130c45ldy-vm-test-run-installer-bcachefs-linux-testing
/nix/store/3r5kfnp6mbqg0ylbjdxvpxswr30vp6pb-vm-test-run-installer-bcachefs-upgrade-to-linux-testing

'bcachefs' is included in the linux kernel since 6.7-rc1
nixos/tests/installer: add bcachefsLinuxTesting and bcachefsLinuxTesting tests

bcachefs-tools: add bcachefsLinuxTesting and bcachefsLinuxTesting tests
@Madouura
Copy link
Copy Markdown
Contributor Author

283996926-6fd43839-b6d6-42eb-8c7b-8efbdf7da1c0

The error in this image is likely fixed by koverstreet/bcachefs@19cf4df.

Madouura added a commit to Madouura/nixpkgs that referenced this pull request Dec 5, 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: changelog This PR adds or changes release notes 8.has: clean-up This PR removes packages or removes other cruft 8.has: documentation This PR adds or changes documentation 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. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants