NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.73k stars 13.85k forks source link

unable to build new virtual machine from local clean kernel source #68295

Open contrun opened 5 years ago

contrun commented 5 years ago

Issue description

I tried to build a new vm with NIXOS_CONFIG=/home/e/kernel-dev.nix nixos-rebuild build-vm-with-bootloader. where /home/e/kernel-dev.nix is

{ config, pkgs, ... }: {
  boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linuxManualConfig {
    stdenv = pkgs.stdenv;
    src = pkgs.lib.cleanSource /home/e/Workspace/linux;
    version = "5.3.0-rc7";
    configfile = builtins.path {
      path = /home/e/kernel-config;
      name = "linux-config";
    };
    allowImportFromDerivation = true;
  });
}

/home/e/Workspace/linux is the latest linux source tree obtained by git clone, the commit is 1e3778cb223e861808ae0daccf353536e7573eed, and /home/e/kernel-config is generated by zcat /proc/config.gz > .config && make oldconfig with CONFIG_EXPERIMENTAL=y.

Unfortunately, building failed at postInstall stage

make[1]: Entering directory '/nix/store/l1dd17ji33g91l9gsz9k9ygkipx71y2r-linux-5.3.0-rc7-dev/lib/modules/5.3.0-rc7/build'
  HOSTCC  scripts/basic/fixdep
  GEN     Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.h
  HOSTCC  scripts/kconfig/lexer.lex.o
  YACC    scripts/kconfig/parser.tab.c
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
Kconfig:34: can't open file "Documentation/Kconfig"
make[3]: *** [/nix/store/l1dd17ji33g91l9gsz9k9ygkipx71y2r-linux-5.3.0-rc7-dev/lib/modules/5.3.0-rc7/source/scripts/kconfig/Makefile:73: syncconfig] Error 1
make[2]: *** [/nix/store/l1dd17ji33g91l9gsz9k9ygkipx71y2r-linux-5.3.0-rc7-dev/lib/modules/5.3.0-rc7/source/Makefile:562: syncconfig] Error 2
/nix/store/l1dd17ji33g91l9gsz9k9ygkipx71y2r-linux-5.3.0-rc7-dev/lib/modules/5.3.0-rc7/source/Makefile:660: include/config/auto.conf.cmd: No such file or directory
make[1]: *** [/nix/store/l1dd17ji33g91l9gsz9k9ygkipx71y2r-linux-5.3.0-rc7-dev/lib/modules/5.3.0-rc7/source/Makefile:678: include/config/auto.conf.cmd] Error 2
make[1]: Leaving directory '/nix/store/l1dd17ji33g91l9gsz9k9ygkipx71y2r-linux-5.3.0-rc7-dev/lib/modules/5.3.0-rc7/build'
make: *** [Makefile:179: sub-make] Error 2
builder for '/nix/store/ilcpxhnrxjs5bvjxjmrhzl548qqv0ja2-linux-5.3.0-rc7.drv' failed with exit code 2
cannot build derivation '/nix/store/jps2k2dw7sqbvxlcwp9jy1av3j2s8h0k-firmware.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/px25yd55iysyxqy8fyqqcjlm7xiafvav-kernel-modules.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/jjcgqqyi7wjf9sdpf5axnb5y3cxhq216-linux-5.3.0-rc7-modules.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/9db2mam1i9712ckj347vcx06f9dvzsgl-etc-nixos.conf.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/d8pwcc9rsxy9i08kmskwm1d5v3g2wgdh-linux-5.3.0-rc7-modules-shrunk.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/23mhgdaz7hph4wmb9cw84lvfc0b1amb5-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/63czgs58zf4gcnjzin5qdsxkczbawgxd-stage-1-init.sh.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ldmn51xq45lb5sz5dqv32r6461q14p0f-initrd-linux-5.3.0-rc7.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/svnc3ddgklanqk9j2hvfwm2q8262fcf4-nixos-system-nixos-19.09pre190978.8d1510abfb5.drv': 5 dependencies couldn't be built
cannot build derivation '/nix/store/qdp8560x0jlc7sl4l2k1z1ww4yz8vhmj-nixos-boot-disk.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/wsqxbd9165wqkliph8ha3r74155a1mmd-run-nixos-vm.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/z8vp83lyjkvxyv6sgxj6hmiilv2bgmy1-nixos-vm.drv': 2 dependencies couldn't be built
error: build of '/nix/store/z8vp83lyjkvxyv6sgxj6hmiilv2bgmy1-nixos-vm.drv' failed

It seems the needed Documentation folder is removed here

What shall I do?

Steps to reproduce

See above.

Technical details

stale[bot] commented 4 years ago

Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on irc.freenode.net.
MaxHearnden commented 1 year ago

Fixed by https://github.com/NixOS/nixpkgs/pull/67111