NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.04k stars 14.09k forks source link

building error with fish and bumblebee #58240

Closed SchrodingerZhu closed 4 years ago

SchrodingerZhu commented 5 years ago
copying path '/nix/store/j760dlcln1vdqxcgbh38sgxl1lm3kswv-source' from 'https://cache.nixos.org'...
building '/nix/store/y2qc432vmn9spfgd24d3p9jg9xa9hinq-hugin-2018.0.0.drv'...
building '/nix/store/fh0bxmkj7vsbb5wmmiyv3s15ywajvdvp-options-db.xml.drv'...
building '/nix/store/p89bkk0p8hgwg6xfrw4x3pbf2nmw3la2-primus-lib-2015-04-28.drv'...
while setting up the build environment: executing '/nix/store/vqq275dnd5lbjfdxffa8864w4mxrinx2-bash-4.4-p23/bin/bash': Exec format error
building '/nix/store/gcg4iiga6812j4cw0vbgvi6nqqc4y35k-pycharm-professional-2018.3.4.drv'...
building '/nix/store/z6a03l628m4gpfbcxp5w06df2p31d9n6-reload-container.drv'...
building '/nix/store/ix2hcsdlcjqrab17m49897vlfgds4dd7-ssh-askpass-wrapper.drv'...
builder for '/nix/store/p89bkk0p8hgwg6xfrw4x3pbf2nmw3la2-primus-lib-2015-04-28.drv' failed with exit code 1
cannot build derivation '/nix/store/091r4kz6gaph6y2wj00jsfaxcmha0hhr-primusrun.drv': 1 dependencies couldn't be built
building '/nix/store/ikqhdcj98fyz24xbx76dpp9inckhr3ig-strace-5.0_fish-completions.drv'...
building '/nix/store/1ijvfhp470dnf3y793a3kdg19yd87ggk-sudo-1.8.27_fish-completions.drv'...
cannot build derivation '/nix/store/qidbrmjr5090qmnbhy260f12cv586d91-primusrun_fish-completions.drv': 1 dependencies couldn't be built
infinisil commented 5 years ago

Provide the command you used, and the output of nix-info -m, as the issue template says. I can't reproduce this like that.

SchrodingerZhu commented 5 years ago

system info is here

I got into this problem when running nix-rebuild boot --upgrade

infinisil commented 5 years ago

Then we need your configuration.nix, or at least the relevant parts.

SchrodingerZhu commented 5 years ago
{ config, pkgs, ... }:

{
  imports = [ ./hardware-configuration.nix ];
#  systemd.services.nix-daemon.environment = {
#    https_proxy = "socks5://127.0.0.1:1080";
#  };
#  unstable = import <unstable> {
#        config = {
#            allowUnfree = true;
#            allowUnsupportedSystem = true;
#            allowBroken = true;
#        };
#  };

  ### Services

  services.fstrim = {
    enable = true;
    interval = "tuesday";  
  };

  nix.gc = {
    automatic = true;
    dates = "thursday";
    options = "--delete-older-than 8d";
  };

  powerManagement.powertop.enable = true;

  services.printing.enable = true;

  # Don't start a getty behind my graphical login
  systemd.services."autovt@tty1".enable = false;

  ### Random software

  nixpkgs.overlays = [ (self: super:
    { sarasa-gothic = self.callPackage ./sarasa-gothic.nix {}; }) ];

  environment.systemPackages = with pkgs; [
    fcitx-configtool wget emacs shadowsocks-libev proxychains elixir_1_8 erlangR21 jdk11 dotty fstar gcc8 clang_7 firefox git python37Full sbt scala_2_12 vscode jetbrains.clion jetbrains.idea-ultimate jetbrains.pycharm-professional qt5Full qtcreator julia deepin.deepin-gtk-theme neofetch file lolcat commonsCompress
    # Password manager for KDE
    kdeFrameworks.kwallet
    kdeApplications.kwalletmanager
    kwalletcli

    # Allow automatic unlocking of kwallet if the same password. This seems to
    # work without installing kwallet-pam.
    #kwallet-pam

    # ssh-add prompts a user for a passphrase using KDE. Not sure if it is used
    # by anything? ssh-add just asks passphrase on the console.
    #ksshaskpass

    # Archives (e.g., tar.gz and zip)
    ark

    # GPG manager for KDE
    kgpg
    # This is needed for graphical dialogs used to enter GPG passphrases
    pinentry_qt5

    kdeplasma-addons

    # Screenshots
    kdeApplications.spectacle

    # Bluetooth
    bluedevil

    # Text editor
    kate

    # Torrenting
    ktorrent

    # Connect desktop and phone
    kdeconnect

    # Drop-down terminal
    yakuake

    # Printing and scanning
    kdeApplications.print-manager
    simple-scan

    # Document readers
    okular

    # Browsers
    firefox
    chromium

    # Email
    #kmail
    thunderbird

    # Office suit
    libreoffice

    # Photo/image editor
    gwenview
    gimp
    #gimpPlugins.resynthesizer
    #gimpPlugins.ufraw
    digikam5

    # Media player
    vlc

    # KDE apps
    kdeFrameworks.kconfig
    kdeFrameworks.kconfigwidgets
    konsole
    dolphin
    kdeApplications.dolphin-plugins
];
  programs.mtr.enable = true;

  nix.extraOptions = ''
    keep-outputs = true
    keep-derivations = true
  '';

  programs.ssh = {
    startAgent = true;
  };

  ### Graphical

  services.xserver = {
    enable = true;
    layout = "us";

    libinput.enable = true;

    displayManager.sddm = {
      enable = true;
      extraConfig = ''
        [X11]
        ServerArguments=-nolisten tcp -dpi 200
        MinimumVT=1
      '';
    };

    desktopManager.plasma5.enable = true;

    xkbOptions = "terminate:ctrl_alt_bksp,caps:ctrl_modifier";
  };

  i18n.inputMethod = {
    enabled = "fcitx";
    fcitx.engines = with pkgs.fcitx-engines; [ libpinyin rime ];
  };

  fonts.fonts = with pkgs; [
    sarasa-gothic
  ];

  fonts.enableFontDir = true;

  fonts.fontconfig.defaultFonts = {
    monospace = [ "Sarasa Mono SC" ];
    sansSerif = [ "Sarasa UI SC" ];
    serif = [ "Sarasa UI SC" ];
  };

  ### Boot and kernel
  boot.kernelPackages = pkgs.linuxPackages_latest_hardened;
  boot.loader.systemd-boot.enable = true;
  boot.loader.timeout = 10;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.kernelParams = [ "i915.fastboot=1" "quiet" "acpi_osi=!" "acpi=\"windows2009\""];

  boot.extraModulePackages = [ pkgs.linuxPackages_latest_hardened.nvidia_x11_beta pkgs.linuxPackages_latest_hardened.perf];

  boot.kernel.sysctl = {
    "vm.swappiness" = 5;
    "vm.vfs_cache_pressure" = 50;
  };

  hardware.cpu.intel.updateMicrocode = true;

  ### Networking

  networking.hostName = "homura";
  networking.networkmanager.enable = true;

  networking.firewall.allowedTCPPorts = [ 12345 ];
  networking.firewall.logRefusedConnections = false;

  ### Users
  users.defaultUserShell = pkgs.fish;
  users.users.schrodinger = {
    isNormalUser = true;
    useDefaultShell = true;
    uid = 1000;
    extraGroups = [ "wheel" "vboxusers" "docker" ];
  };

  ### Misc

  boot.earlyVconsoleSetup = true;

  i18n.consolePackages = [ pkgs.terminus_font ];
  i18n.consoleFont = "ter-132n";
  i18n.consoleKeyMap = "us";
  i18n.defaultLocale = "en_US.UTF-8";

  time.timeZone = "Asia/Shanghai";

  sound.enable = true;
  hardware.pulseaudio.enable = true;

  nix.trustedUsers = [ "root" "schrodinger" ];

  # This value determines the NixOS release with which your system is to be
  # compatible, in order to avoid breaking some software such as database
  # servers. You should change this only after NixOS release notes say you
  # should.
  services.flatpak.enable = true;
  programs.fish.enable = true;
  #programs.zsh.autosuggestions.enable = true;
  hardware.bumblebee.enable = true;
  hardware.bumblebee.connectDisplay = true;
  system.autoUpgrade.enable = true;
  system.autoUpgrade.channel = https://nixos.org/channels/nixos-unstable-small;
  nixpkgs.config.allowUnsupportedSystem = true; 
  nixpkgs.config.allowBroken = true; 
  nixpkgs.config.allowUnfree = true;
  virtualisation.docker.enable = true;
  services.emacs.install = true;
  services.emacs.enable = true;
  services.emacs.defaultEditor = true;
  boot.plymouth.enable = true;
  system.stateVersion = "19.09"; # Did you read the comment?
}
SchrodingerZhu commented 5 years ago

@Infinisil /nix/store/p89bkk0p8hgwg6xfrw4x3pbf2nmw3la2-primus-lib-2015-04-28.drv This thing depends on /nix/store/vqq275dnd5lbjfdxffa8864w4mxrinx2-bash-4.4-p23/bin/bash, while the latter is not executable. It is a 32-bit program.

/nix/store/vqq275dnd5lbjfdxffa8864w4mxrinx2-bash-4.4-p23/bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /nix/store/sjsvwd9sqxjflmslnf8xs48aqpkb2sjy-glibc-2.27/lib/ld-linux.so.2, for GNU/Linux 2.6.32, not stripped

This default bash is 64-bit

/nix/store/mcyvp1s45scjkkhyb1m16aqlsb8wr6hs-bash-interactive-4.4-p23/bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped
infinisil commented 5 years ago

Hmm, so I can't reproduce this, the failing derivation is /nix/store/p89bkk0p8hgwg6xfrw4x3pbf2nmw3la2-primus-lib-2015-04-28.drv as seen from your logs, which is pkgsi686Linux.primusLib in 07b42ccf2de451342982b550657636d891c4ba35 (latest nixos-unstable), referenced from https://github.com/NixOS/nixpkgs/blob/07b42ccf2de451342982b550657636d891c4ba35/pkgs/top-level/all-packages.nix#L20008-L20013 Building this myself (I'm on x86_64 too) works without problems:

``` $ nix-build -A pkgsi686Linux.primusLib --check remotes/channels/nixos-unstable ✭ ◼ checking outputs of '/nix/store/p89bkk0p8hgwg6xfrw4x3pbf2nmw3la2-primus-lib-2015-04-28.drv'... unpacking sources unpacking source archive /nix/store/w9269dhydjdl6q3clzs19pjkxp0a9xhr-source source root is source patching sources applying patch /nix/store/wi0rn8p88nrd00g6pvvm2kh0k319rlvd-2f429e232581c556df4f4bf210aee8a0c99c60b7.patch patching file libglfork.cpp configuring no configure script, doing nothing building build flags: SHELL=/nix/store/vqq275dnd5lbjfdxffa8864w4mxrinx2-bash-4.4-p23/bin/bash LIBDIR=\$\(out\)/lib PRIMUS_libGLa=/nix/store/bxjgqcz24cjmw7jarc7w0fp9inn7g86c-libglvnd-1.0.0/lib/libGL.so PRIMUS_libGLd=/nix/store/3dllgjhps0q8w44z3vrlwr8qh4wh8q23-libGL-1.0.0/lib/libGL.so PRIMUS_LOAD_GLOBAL=/nix/store/9a8wml7sg26y3h7wvsyl64yr6srdn484-mesa-noglu-18.3.4/lib/libglapi.so mkdir -p /nix/store/ya554yqwkx1wxkhbrg271wpcnpnsvf46-primus-lib-2015-04-28/lib g++ -Wall -g -Werror=missing-declarations -Werror=attributes -DBUMBLEBEE_SOCKET='"/var/run/bumblebee.socket"' -DPRIMUS_SYNC='"0"' -DPRIMUS_VERBOSE='"1"' -DPRIMUS_UPLOAD='"0"' -DPRIMUS_SLEEP='"90"' -DPRIMUS_DISPLAY='":8"' -DPRIMUS_LOAD_GLOBAL='"/nix/store/9a8wml7sg26y3h7wvsyl64yr6srdn484-mesa-noglu-18.3.4/lib/libglapi.so"' -DPRIMUS_libGLa='"/nix/store/bxjgqcz24cjmw7jarc7w0fp9inn7g86c-libglvnd-1.0.0/lib/libGL.so"' -DPRIMUS_libGLd='"/nix/store/3dllgjhps0q8w44z3vrlwr8qh4wh8q23-libGL-1.0.0/lib/libGL.so"' -fvisibility=hidden -fPIC -shared -Wl,-Bsymbolic -o /nix/store/ya554yqwkx1wxkhbrg271wpcnpnsvf46-primus-lib-2015-04-28/lib/libGL.so.1 libglfork.cpp -lX11 -lpthread -lrt libglfork.cpp:1024:2: warning: #warning Enabled workarounds for applications demanding more than promised by the OpenGL ABI [-Wcpp] #warning Enabled workarounds for applications demanding more than promised by the OpenGL ABI ^~~~~~~ libglfork.cpp: In function 'void* readback_work(void*)': libglfork.cpp:551:29: warning: 'height' may be used uninitialized in this function [-Wmaybe-uninitialized] primus.afns.glReadPixels(0, 0, width, height, GL_BGRA, GL_UNSIGNED_BYTE, NULL); ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libglfork.cpp:551:29: warning: 'width' may be used uninitialized in this function [-Wmaybe-uninitialized] installing post-installation fixup shrinking RPATHs of ELF executables and libraries in /nix/store/ya554yqwkx1wxkhbrg271wpcnpnsvf46-primus-lib-2015-04-28 shrinking /nix/store/ya554yqwkx1wxkhbrg271wpcnpnsvf46-primus-lib-2015-04-28/lib/libGL.so.1 strip is /nix/store/jnky2ba7kb4rq494g5kgdprhxkrb40l7-binutils-2.31.1/bin/strip stripping (with command strip and flags -S) in /nix/store/ya554yqwkx1wxkhbrg271wpcnpnsvf46-primus-lib-2015-04-28/lib patching script interpreter paths in /nix/store/ya554yqwkx1wxkhbrg271wpcnpnsvf46-primus-lib-2015-04-28 checking for references to /build/ in /nix/store/ya554yqwkx1wxkhbrg271wpcnpnsvf46-primus-lib-2015-04-28... /nix/store/ya554yqwkx1wxkhbrg271wpcnpnsvf46-primus-lib-2015-04-28 ```

Pinging @abbradar as the main author of the bumblebee and primus stuff

SchrodingerZhu commented 5 years ago

Is there any method to overcome this failure. It has blocked me from upgrading for a long long time.

gloaming commented 5 years ago

See #51097

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.
gloaming commented 4 years ago

This should be resolved by #82006 - please reopen if there's still a problem.