nixpkgs/pkgs
Jörg Thalheim f10b935f84
breakpointHook: add for debugging failing builds
Usuage: Add breakpointHook to your `buildInputs` like this:

  stdenv.mkDerivation rec {
    # ...
    buildInputs = [ breakpointHook ];
  });

When the build fails as show in this example:

  pkgs.hello.overrideAttrs (old: {
    buildInputs = [ breakpointHook ];
    postPatch = ''
      false
    '';
  });

It will halt execution printing the following message:

build failed in patchPhase with exit code 1
To attach to this build run the following command as root:

   cntr attach -t command cntr-/nix/store/ynyb4n82x2r7sldd58pbb405jdqh5f00-hello-2.10

Installing cntr and running the command will provide shell access to the
build sandbox of failed build:

sudo cntr attach -t command cntr-/nix/store/ynyb4n82x2r7sldd58pbb405jdqh5f00-hello-2.10
WARNING: bad ownership on /nix/var/nix/profiles/per-user/root, should be 1000
[nixbld@localhost:/var/lib/cntr]$

At /var/lib/cntr the sandbox filesystem is mounted. All commands and
files of the system are still accessible within the shell.
To execute commands from the sandbox use the `cntr exec` subcommand.
2018-10-25 10:19:41 +01:00
..
applications cntr: init at 1.2.0 2018-10-25 10:19:41 +01:00
build-support breakpointHook: add for debugging failing builds 2018-10-25 10:19:41 +01:00
common-updater
data Merge staging-next into master 2018-10-21 08:37:30 +02:00
desktops dde-session-ui: init at 4.5.1.10 (#48785) 2018-10-21 23:00:55 +02:00
development wlroots: 2018-03-16 -> 0.1 2018-10-22 22:58:44 +02:00
games Merge pull request #48148 from peterhoeg/p/scummvm_games 2018-10-21 09:50:13 +02:00
misc matcha: 2018-10-12 -> 2018-10-21 2018-10-21 13:32:22 -03:00
os-specific linux: Add 4.19 2018-10-22 09:40:22 -04:00
servers samba4: 4.7.9 -> 4.7.10 (#48787) 2018-10-22 02:04:38 +02:00
shells Merge pull request #46152 from Ma27/fix-setxkbmap-completion 2018-10-19 14:33:04 +02:00
stdenv make-derivation: set CMAKE_SYSTEM_* when cross compiling 2018-10-16 21:50:37 -05:00
test Remove openftd 2018-10-21 21:52:20 +02:00
tools Merge pull request #48818 from jokogr/u/lxd-3.0.2 2018-10-22 21:07:52 +01:00
top-level breakpointHook: add for debugging failing builds 2018-10-25 10:19:41 +01:00