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

nixos/bird: rename bird2 to bird, switch to bird3 by default #366190

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

herbetom
Copy link
Member

@herbetom herbetom commented Dec 18, 2024

Now that there is a version 3 of bird i think we should cleanup some bird2 stuff and change the default bird package to v3.

In light of that i'm proposing to do a couple of things:

  • renaming the current bird package to bird2
  • introducing a bird3 package
  • having an bird package alias which points to bird3
  • renaming the services.bird2 options to services.bird
  • introducing a services.bird.package option to allow changing the new bird3 default

I would still keep bird2 around because as of now it seems to have a lower memory footprint and users could be required to adjust their config. And with both versions beeing supported officially (as of now, no word yet how long this will last), we might as well have both for the time beeing to enable a smooth transition.

The bird project has some notes on the migration to v3 here:
https://gitlab.nic.cz/labs/bird/-/blob/v3.0.1/doc/migration-bird3.md

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog 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 labels Dec 18, 2024
@herbetom herbetom mentioned this pull request Dec 19, 2024
13 tasks
@herbetom herbetom marked this pull request as ready for review January 2, 2025 00:42
@herbetom herbetom changed the title nixos/bird: rename bird2 to bird nixos/bird: rename bird2 to bird, switch to bird3 by default Jan 11, 2025
@herbetom
Copy link
Member Author

Not sure wheter this should be classified as a significant or a major or breaking change. I would appreciate input in that regard.

@herbetom herbetom force-pushed the bird-service branch 2 times, most recently from 8ab364a to 1a6976e Compare January 12, 2025 15:53
@herbetom

This comment was marked as outdated.

@snaakey
Copy link
Member

snaakey commented Jan 14, 2025

Defaulting to bird3 will break the configuration of some people. I would suggest to default to bird2 for now and throw a warning when the package option is not explicitly set and checkConfig is disabled. So that people get notified that the default package will change in the future and break their configuration if they don't explicitly specify the package.

@herbetom
Copy link
Member Author

herbetom commented Jan 14, 2025

@snaakey Thanks for taking a look! Having a check requiring Users to set the package option when checkConfig is set to false sounds like an intersting idea. I'll look into it.

My worry with keeping bird2 as the default is that it's unclear how long both versions will be maintained. Probably long enough for the rather short stable window of NixOS, but still, i would prefer to do the switch for 25.05 and be done with it.
And with us switching from services.bird2 to services.bird it already requires manual intervention by every single user and that should already be quite a warning that something is happening. Switching later doesn't have that same benefit and Users with checkConfig enabled would be less informed that the switch is happening.
Edit: I've extended the info text of lib.mkRemovedOptionModule to also include that there is a switch to bird3.

@herbetom herbetom force-pushed the bird-service branch 2 times, most recently from 89817ad to 52b10b5 Compare January 14, 2025 12:36
@herbetom
Copy link
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 366190


x86_64-linux

✅ 1 test built:
  • nixosTests.bird
✅ 2 packages built:
  • bird2
  • bird3

@@ -68,36 +69,38 @@ in
};

imports = [
(lib.mkRemovedOptionModule [ "services" "bird" ] "Use services.bird2 instead")
(lib.mkRemovedOptionModule [ "services" "bird6" ] "Use services.bird2 instead")
(lib.mkRemovedOptionModule [ "services" "bird2" ]
Copy link
Member

Choose a reason for hiding this comment

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

Why not use mkRenamedOptionModule and make package depending on stateVersion?

Copy link
Contributor

Choose a reason for hiding this comment

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

Using mkRenamedOptionModule is arguable but it can not give a custom user message.
Depending on stateVersion is strange as the user has to handle the change anyways and the added package option seems to be enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

because its not renamed but actually changed in this case. and having a general services.bird makes more sense in the first place as thats the general practice on nixpkgs in general, this is just bikeshedding imo and preventing useful things from happening on nixpkgs.

nixos/modules/services/networking/bird.nix Outdated Show resolved Hide resolved
pkgs/by-name/bi/bird3/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/bi/bird3/package.nix Outdated Show resolved Hide resolved
@snaakey
Copy link
Member

snaakey commented Jan 15, 2025

Edit: I've extended the info text of lib.mkRemovedOptionModule to also include that there is a switch to bird3.

I think this should be enough.

This is done to enable us to introduce bird3 without causing confusion.
This is done to allows to easier change which bird package should be used
This is done in view of the Release of the new v3 of Bird.

Switch to the bird3 package for the `services.bird.package` option.

Switch the `bird` package alias to bird3.
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants