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/systemd: don't require network-online.target for multi-user.target #258680

Merged
merged 41 commits into from
Jan 19, 2024

Conversation

lf-
Copy link
Member

@lf- lf- commented Oct 2, 2023

Previously we required network-online.target for multi-user.target. This has made a lot of people very angry and has been widely regarded as a bad move (or at least, very nonstandard):
15d761a#commitcomment-128564097

This was done because of fragile tests and services declaring dependencies on multi-user.target when they meant network-online.target.

Let's rip off the bandaid and fix our tests.

I have not yet run any tests locally, and this is probably going to break a bunch of stuff. We should get some hydra resources and gather a list of the broken tests.

cc @NixOS/systemd

Previous related PRs/attempts in vain to execute this change:

Description of changes

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.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.

@lf-
Copy link
Member Author

lf- commented Oct 2, 2023

Tests I managed to run and failed prior to something starting to compile firefox and me realizing this is absolutely a hydra-requiring task:

  • /nix/store/0604s4qllgbidl8lk1s1landm0wx8dad-vm-test-run-qemu-vm-restrictnetwork.drv
  • /nix/store/06b20phngwjph1hx34fvzj0q73lgiq7a-vm-test-run-rss2email.drv
  • /nix/store/06phq00lx028ca6zxfl47r2iva6qp6ww-vm-test-run-systemd-networkd-dhcpserver.drv
  • /nix/store/07pz2q32lhy0dqdcs63pgwqx805g4cy0-vm-test-run-paperless.drv
  • /nix/store/094cnijjhv78yjcz4ia9wbrxidjr1nq8-vm-test-run-zrepl.drv

Tests that seem to just be flaky/unrelated broken?

  • /nix/store/1l9ws129lraf63k1mvvb8pk1cnimh0vy-vm-test-run-pgjwt.drv
  • /nix/store/1x1bnhnjlr00gv10vv6nlwvjrj89mm68-vm-test-run-ec2-nixops-userdata.drv
  • /nix/store/23z9h56svc6y7a3npn0lnd8rxx0gn94z-vm-test-run-pipewire-0.3.80.drv
  • /nix/store/3hch77akk3b83yd4kr67kagnjkskzady-vm-test-run-seafile.drv

@Artturin
Copy link
Member

Artturin commented Oct 3, 2023

Firefox shouldn't have to be built if you use a revision where it's built, rebase onto nixos-unstable to not require hydra to build anything else than the tests.

@lf-
Copy link
Member Author

lf- commented Oct 3, 2023

Firefox shouldn't have to be built if you use a revision where it's built, rebase onto nixos-unstable to not require hydra to build anything else than the tests.

Yes, but the tests themselves are also very annoying and resource intensive to build hahaha.

@lf-
Copy link
Member Author

lf- commented Oct 3, 2023

Summary of discussion on Matrix with uep, Raito and others regarding this: our first goal is to get a Hydra run of all the tests with this PR applied. Then we can start fixing ones we know of and apply this change by default to all tests for the 23.11 release.

In 24.05 we may be able to roll this out to all systems, and it will plausibly cause some breakage. Another suggestion was to apply it to all systems right after branch-off; this seems also plausible.

@vcunat
Copy link
Member

vcunat commented Oct 3, 2023

https://hydra.nixos.org/jobset/nixos/pr-258680-systemd_network-online.target

@lf- lf- requested a review from mweinelt as a code owner October 3, 2023 08:05
@lf- lf- force-pushed the jade/remove-multiuser-netonline-dep branch from 5a505bf to 01e3196 Compare October 3, 2023 20:46
@lf-
Copy link
Member Author

lf- commented Oct 3, 2023

rebased against nixos-unstable so hydra can be more useful. should have done that earlier.

@vcunat
Copy link
Member

vcunat commented Oct 3, 2023

It was quite close from the start, if I looked right.

@lf- lf- force-pushed the jade/remove-multiuser-netonline-dep branch from 01e3196 to 82a4bac Compare October 4, 2023 05:24
@lf- lf- force-pushed the jade/remove-multiuser-netonline-dep branch from 82a4bac to 66b449b Compare October 4, 2023 06:24
@K900
Copy link
Contributor

K900 commented Oct 4, 2023

Pipewire tests are known broken in the VM currently.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/why-does-multi-user-target-depend-on-network-online-target/33565/11

lf- added 13 commits January 19, 2024 00:11
This was done by generating a truly hilarious configuration:

rg 'services\.[^.]+\.enable\t' opts-tags | cut -f1 > allonconfig.nix

The following were not tested due to other evaluation errors. They
should probably be manually audited.
services.amule
services.castopod
services.ceph
services.chatgpt-retrieval-plugin
services.clamsmtp
services.clight
services.dante
services.dex
services.discourse
services.dwm-status
services.engelsystem
services.foundationdb
services.frigate
services.frp
services.grocy
services.guacamole-client
services.hedgedoc
services.home-assistant
services.honk
services.imaginary
services.jitsi-meet
services.kerberos_server
services.limesurvey
services.mastodon
services.mediawiki
services.mobilizon
services.moodle
services.mosquitto
services.nextcloud
services.nullmailer
services.patroni
services.pfix-srsd
services.pgpkeyserver-lite
services.postfixadmin
services.roundcube
services.schleuder
services.self-deploy
services.slskd
services.spacecookie
services.statsd
services.step-ca
services.sympa
services.tsmBackup
services.vdirsyncer
services.vikunja
services.yandex-disk
services.zabbixWeb
@lf- lf- force-pushed the jade/remove-multiuser-netonline-dep branch from 14dcc64 to 1323e31 Compare January 19, 2024 08:11
@mweinelt mweinelt merged commit c2853e2 into NixOS:master Jan 19, 2024
20 checks passed
@vcunat
Copy link
Member

vcunat commented Jan 19, 2024

I disabled the Hydra jobset now.

e-nikolov added a commit to e-nikolov/golink that referenced this pull request Jan 21, 2024
network-online.target must now be explicitly depended on
lf- added a commit to lf-/nixpkgs that referenced this pull request Jan 22, 2024
lf- added a commit to lf-/nixpkgs that referenced this pull request Jan 22, 2024
This flakiness might have been exposed by
NixOS#258680 but it definitely was buggy
before, since rss2email finishes its job and exits, which means the unit
would be considered stopped if it completed. It's not (and shouldn't be)
a oneshot service, so we need to use a different method to detect its
completion state.
@vcunat vcunat mentioned this pull request Jan 24, 2024
13 tasks
@lf-
Copy link
Member Author

lf- commented Jan 25, 2024

Committing to reverting, since we did not have much of any test coverage of network-manager (!!!!!) and thus didn't catch the regression #71151

This is evidence that we need to do another revision of this.

ElvishJerricco added a commit to ElvishJerricco/nixpkgs that referenced this pull request Jan 25, 2024
…r-netonline-dep"

This reverts commit c2853e2, reversing
changes made to a237397.

There were several modules, critically including NetworkManager, which
were not prepared for this change. Revert until those are all fixed.
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.