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

user-units conflict with packages #33233

Closed
jtojnar opened this issue Dec 31, 2017 · 0 comments
Closed

user-units conflict with packages #33233

jtojnar opened this issue Dec 31, 2017 · 0 comments
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@jtojnar
Copy link
Member

jtojnar commented Dec 31, 2017

When a package contains a directory in one of the systemd directories (like flatpak does), it is symlinked into the *-units derivation:

Then later, the derivation will try to create the directory:

which will fail:

$ nixos-rebuild build-vm -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/afac8c61e9542ad04cd9da0cd53f2e2aaaf1aeab.tar.gz -I nixos-config=dbus-collision.nix
building Nix...
building the system configuration...
these derivations will be built:
  /nix/store/q7iwii64xvgalffh5hc6ri61zr5q04yl-user-units.drv
  /nix/store/jz8761r0akvbja2sqgjxhla2cb5yjdkj-etc.drv
  /nix/store/xq3ldd72j8678icjxc1ja01h1bidkic0-nixos-system-nixos-18.03pre-git.drv
  /nix/store/gl6w1408n7bm37h01hwz85qq4c17a8hh-closure-info.drv
  /nix/store/5pskg6ybx5pflm23ih8x8vbkpvc0jd5p-run-nixos-vm.drv
  /nix/store/d8jiyxbay3v1g8vvmacvvzkv3cq2gmxc-nixos-vm.drv
building '/nix/store/q7iwii64xvgalffh5hc6ri61zr5q04yl-user-units.drv'...
mkdir: cannot create directory '/nix/store/pf3vkdl7nwhh1fvd7cy420jjinqvan5n-user-units/dbus.service.d': File exists
builder for '/nix/store/q7iwii64xvgalffh5hc6ri61zr5q04yl-user-units.drv' failed with exit code 1
cannot build derivation '/nix/store/jz8761r0akvbja2sqgjxhla2cb5yjdkj-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/xq3ldd72j8678icjxc1ja01h1bidkic0-nixos-system-nixos-18.03pre-git.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/gl6w1408n7bm37h01hwz85qq4c17a8hh-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/5pskg6ybx5pflm23ih8x8vbkpvc0jd5p-run-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/d8jiyxbay3v1g8vvmacvvzkv3cq2gmxc-nixos-vm.drv': 2 dependencies couldn't be built
error: build of '/nix/store/d8jiyxbay3v1g8vvmacvvzkv3cq2gmxc-nixos-vm.drv' failed

You can reproduce it with the following configuration:

{ pkgs, ... }:
let
  conflictingDerivation = pkgs.stdenv.mkDerivation {
    name = "conflicting-derivation";
    phases = [ "installPhase" ];
    installPhase = ''
      mkdir -p "$out/lib/systemd/user/dbus.service.d"
    '';
  };
in {
  systemd.packages = [ conflictingDerivation ];
}
@jtojnar jtojnar added 0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Dec 31, 2017
jtojnar added a commit to jtojnar/nixpkgs that referenced this issue Jan 24, 2018
When a package contains a directory in one of the systemd directories
(like flatpak does), it is symlinked into the *-units derivation.
Then later, the derivation will try to create the directory, which
will fail:

mkdir: cannot create directory '/nix/store/…-user-units/dbus.service.d': File exists
builder for '/nix/store/…-user-units.drv' failed with exit code 1

Closes: NixOS#33233
@JohnRTitor JohnRTitor added this to GNOME Jun 20, 2024
@JohnRTitor JohnRTitor moved this to Done in GNOME Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
Status: Done
Development

No branches or pull requests

1 participant