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

systemd: improve unit script drv naming #43534

Merged
merged 1 commit into from Aug 8, 2018

Conversation

lheckemann
Copy link
Member

Motivation for this change

I don't like having the nix store littered with derivations that all have the name "unit-script", containing nothing but bin/useful-name-here. This is a bit of an RFC since I'm not sure whether this might break any further things. I've run a few nixos tests with this change as a sanity check, but this could probably do with a run of all the tests and some more experienced eyes looking at it.

cc @grahamc since you expressed interest in the question

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@lheckemann
Copy link
Member Author

@GrahamcOfBorg test gocd-server openldap firewall opensmtpd munin taskserver boot peerflix flannel initrd-network

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.openldap, tests.firewall, tests.opensmtpd, tests.taskserver, tests.boot, tests.peerflix

The following builds were skipped because they don't evaluate on aarch64-linux: tests.gocd-server, tests.munin, tests.flannel, tests.initrd-network

Partial log (click to expand)

killing client2 (pid 653)
killing server (pid 627)
killing client1 (pid 639)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/klhh62y9khzlyjld22afbdj07q6cf62y-vm-test-run-openldap
/nix/store/idyafiai5fjficg2jf61i0n4pv4zppi4-vm-test-run-firewall
/nix/store/m4dlzxc0164wlzwcwwav79inw1l2g072-vm-test-run-opensmtpd
/nix/store/wy3l2jjdn930blbsnhmiciifybginxbf-vm-test-run-taskserver
/nix/store/0pm68w3fkzff4q7kr8a02qkx9bnkz54z-vm-test-run-peerflix

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: systemd

Partial log (click to expand)


  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 65  363k   65  236k    0     0   236k      0  0:00:01 --:--:--  0:00:01 1702k
100  363k  100  363k    0     0   363k      0  0:00:01 --:--:--  0:00:01 2359k

fetching path ‘/nix/store/mhjpsx24jwm660rkcf43yrm2kww8q8y9-systemd-238’...

*** Downloading ‘https://nix-cache.s3.amazonaws.com/nar/1swd8lv1r5lr9j7w282pwzzzdb73s3a7w68x7ynrc7syb0pd6r9h.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/mhjpsx24jwm660rkcf43yrm2kww8q8y9-systemd-238’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 3894k  100 3894k    0     0  3894k      0  0:00:01 --:--:--  0:00:01 5752k

/nix/store/mhjpsx24jwm660rkcf43yrm2kww8q8y9-systemd-238

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: systemd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: systemd

Partial log (click to expand)

/nix/store/klhilzy9a7iq4gk8wr4cp9kxjzf427nc-systemd-238

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: tests.gocd-server, tests.openldap, tests.firewall, tests.opensmtpd, tests.munin, tests.taskserver, tests.boot, tests.peerflix

The following builds were skipped because they don't evaluate on x86_64-linux: tests.flannel, tests.initrd-network

Partial log (click to expand)

error: the VM quit before connecting
the VM quit before connecting
cleaning up
killing server (pid 593)
killing client2 (pid 617)
killing client1 (pid 605)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/kkynl75230ighsj5j0bg2ldp7gqad153-vm-test-run-taskserver.drv' failed with exit code 255
error: build of '/nix/store/cic0ys2fdy3j3y4cv75c4rcbhr6ji58m-vm-test-run-opensmtpd.drv', '/nix/store/kkynl75230ighsj5j0bg2ldp7gqad153-vm-test-run-taskserver.drv' failed

@lheckemann
Copy link
Member Author

opensmtpd and taskserver tests worked fine here, so I'm guessing that's a fluke.

@fpletz
Copy link
Member

fpletz commented Jul 15, 2018

👍 on the change in principle, but I wonder if we should keep the unit-script in the name for clarity.

@lheckemann
Copy link
Member Author

That's a possibility, although I think it's somewhat redundant given that the names already contain -start etc. Should I make the change?

@globin
Copy link
Member

globin commented Aug 5, 2018

👍 for this, I'd also prefer having it prefixed with unit-script

Also store scripts directly in the nix store rather than having the
superfluous /bin/ tree.
@lheckemann
Copy link
Member Author

done!

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: systemd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: systemd

Partial log (click to expand)

/nix/store/vlzj5l79c5m5m808s9axgnmy65vq04gf-systemd-238

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: systemd

Partial log (click to expand)

/nix/store/3xgvh1fjc6p586425c3annc03xhzx9is-systemd-238

@lheckemann
Copy link
Member Author

@GrahamcOfBorg test gocd-server openldap firewall opensmtpd munin taskserver boot peerflix flannel initrd-network

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: tests.openldap, tests.firewall, tests.opensmtpd, tests.taskserver, tests.boot, tests.peerflix

The following builds were skipped because they don't evaluate on aarch64-linux: tests.gocd-server, tests.munin, tests.flannel, tests.initrd-network

Partial log (click to expand)

building '/nix/store/1203g3jf2gsdb62ymz4lnjax4lgr3z1s-unit-nixos-upgrade.service.drv'...
building '/nix/store/5i7kiprwh9k2lp3hfdxah03py22x7id4-unit-nscd.service.drv'...
building '/nix/store/877psgdklhbn9aidi8dv44wq2paczlha-unit-nscd.service.drv'...
building '/nix/store/kizz7sv22pbnvzrg18fydak9b91p0p7i-unit-nscd.service.drv'...
building '/nix/store/wqpg2kgwv0b2965hwaq2y512ww417il8-unit-nscd.service.drv'...
building '/nix/store/zxw3w1bi8c57rq0wygycs5f1p1b745fm-unit-nscd.service.drv'...
building '/nix/store/b7p7n58y4bv4j7fv3axl8vclakrshvpm-unit-post-resume.service.drv'...
building '/nix/store/v5bjbj00n9651b5y3vg9629z5pq414cl-unit-post-resume.service.drv'...
error (ignored): aborting transaction: SQL logic error (in '/nix/var/nix/db/db.sqlite')
error: writing to file: No space left on device

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.gocd-server, tests.openldap, tests.firewall, tests.opensmtpd, tests.munin, tests.taskserver, tests.boot, tests.peerflix

The following builds were skipped because they don't evaluate on x86_64-linux: tests.flannel, tests.initrd-network

Partial log (click to expand)

client1: running command: sync
client1: exit status 0
10 out of 10 tests succeeded
test script finished in 46.09s
cleaning up
killing server (pid 600)
killing client2 (pid 624)
killing client1 (pid 612)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty

@globin globin merged commit adba92b into NixOS:master Aug 8, 2018
@lheckemann lheckemann deleted the unit-script-useful-names branch August 9, 2018 10:10
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.

None yet

4 participants