1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00
nixpkgs/pkgs
Alexey Shmalko 0172558e82 buildEnv: build the whole tree of directories to pathsToLink
This patch fixes #16614 and #16741.

The first issue was caused by the fact that both `/share` and
`/share/fish/vendor_completions.d` end in the `pathsToLink`. The
`pkgs/build-support/buildenv/builder.pl` creates `/share`, then links
`/share/fish` under `/share` and then tries to create the directory
`/share/fish/vendor_completions.d` and fails because it already exists.

The simplest way to reproduce the issue is to build the next Nix
expression:

```nix
let pkgs = import <nixpkgs> { };
in pkgs.buildEnv {
  name = "buildenv-issue";

  paths = [
    pkgs.fish
    pkgs.vim
  ];

  pathsToLink = [
    "/share"
    "/share/fish/vendor_completions.d"
  ];
}
```

The second issue is more critical and was caused by the fact findFiles
doesn't recurse deep enough. It stops at first unique directory for the
package (e.g., "/share" or even "/") and later the scripts decides it
shouldn't link it as it doesn't match pathsToLink (e.g., "/share/fish"),
so the result is empty.

The test:
```nix
let pkgs = import <nixpkgs> { };
in pkgs.buildEnv {
  name = "buildenv-issue";

  paths = [
    pkgs.fish
    pkgs.vim
  ];

  pathsToLink = [
    "/share/fish/functions"
  ];
}
```

or

```nix
let pkgs = import <nixpkgs> { };
in pkgs.buildEnv {
  name = "buildenv-issue";

  paths = [
    pkgs.vim
  ];

  pathsToLink = [
    "/share"
  ];
}
```
2016-07-13 03:54:11 +03:00
..
applications Merge pull request #16839 from frlan/Update/Geany/1.28 2016-07-12 16:21:02 +02:00
build-support buildEnv: build the whole tree of directories to pathsToLink 2016-07-13 03:54:11 +03:00
data geolite-legacy: 2016-07-04 -> 2016-07-08 2016-07-08 20:15:02 +02:00
desktops mate-icon-theme-faenza: 1.15.0 -> 1.15.1 (#16859) 2016-07-11 17:48:02 +02:00
development ncurses: revert to 5.9 on Darwin (only) 2016-07-12 22:00:11 +02:00
games factorio: 0.12.35 -> 0.13.8 2016-07-12 05:03:51 -07:00
misc vimPlugins: updating plugin and adding floobits plugin 2016-07-11 22:49:16 +02:00
os-specific Merge branch 'master' into staging 2016-07-12 22:00:10 +02:00
servers gpsd: 3.10 -> 3.16 2016-07-10 18:48:13 +02:00
shells oh-my-zsh: 2016-06-18 -> 2016-07-05 (#16874) 2016-07-12 09:55:17 +02:00
stdenv darwin make-bootstrap-tools: Document reason for special coreutils 2016-07-09 17:23:43 +03:00
test Remove cruft 2016-04-26 17:31:54 +02:00
tools Merge branch 'master' into staging 2016-07-12 22:00:10 +02:00
top-level Merge branch 'master' into staging 2016-07-12 22:00:10 +02:00