NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.29k stars 13.54k forks source link

Build failure: libvorbis 1.3.7 does not build on architecture znver4, NixOS 24.05 #317161

Closed hoh closed 3 weeks ago

hoh commented 3 months ago

libvorbis fails to build on architecture znver4, and is required by many packages (sddm, vlc, firefox, ...), making a desktop installation impossible.

Steps To Reproduce

Build libvorbis, or any package that depends on it (sddm, vlc, firefox, ...) on NixOS 24.05 with gcc.arch = "znver4".

Steps to reproduce the behavior:

Example to reproduce on NixOS 24.05:

  1. Use NixOS 24.05

    sudo nix-channel --add https://channels.nixos.org/nixos-24.05 nixos
  2. Create a configuration that uses gcc.arch = "znver4".

    { config, lib, pkgs, ... }:
    let
    zen4Import = moduleArg: import moduleArg {
    config = config.nixpkgs.config // {
      allowUnfree = true;
    };
    };
    unstable = import <nixos-unstable> {};
    unstableZen4 = zen4Import <nixos-unstable>;
    in
    {
    boot.loader.systemd-boot.enable = true;
    #boot.loader.efi.canTouchEfiVariables = true;
    
    fileSystems."/" =
    { device = "/dev/disk/by-uuid/redacted";
      fsType = "btrfs";
    };
    
    boot.kernelPackages = pkgs.linuxPackages_6_9;
    
    networking.hostName = "test"; # Define your hostname.
    
    nix.settings = {
    system-features = [ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++ [ "gccarch-znver2" "gccarch-znver4" ];
    };
    
    nixpkgs.hostPlatform = {
    gcc.arch = "znver4";
    gcc.tune = "znver4";
    system = "x86_64-linux";
    };
    
    environment.systemPackages = with pkgs; [
    libvorbis
    ];
    
    system.stateVersion = "24.05"; # Did you read the comment?
    }
  3. Build the configuration file:

    nixos-rebuild build -I nixos-config=/home/sepal/libvorbis-failing-configuration.nix

Build log

make[2]: Nothing to be done for 'check-am'.
make[2]: Leaving directory '/build/libvorbis-1.3.7/lib'
./test_sharedbook
Dequant test 1... OK
Dequant test 2... OK
Dequant test 3... OK
Dequant test 4... OK
Dequant test 5... OK

make[1]: Leaving directory '/build/libvorbis-1.3.7/lib'
Making check in test
make[1]: Entering directory '/build/libvorbis-1.3.7/test'
  CC       util.o
  CC       write_read.o
  CC       test.o
  CCLD     test
make  test
make[2]: Entering directory '/build/libvorbis-1.3.7/test'
make[2]: 'test' is up to date.
make[2]: Leaving directory '/build/libvorbis-1.3.7/test'
./test

Testing 1 channel

    vorbis_1ch_q-0.5_44100.ogg : make[1]: *** [Makefile:625: check] Segmentation fault (core dumped)
make[1]: Leaving directory '/build/libvorbis-1.3.7/test'
make: *** [Makefile:530: check-recursive] Error 1
error: builder for '/nix/store/z1jz4kppn7wjvlcaf42j1v204srhpf4i-libvorbis-1.3.7.drv' failed with exit code 2;
       last 10 log lines:
       > make[2]: Entering directory '/build/libvorbis-1.3.7/test'
       > make[2]: 'test' is up to date.
       > make[2]: Leaving directory '/build/libvorbis-1.3.7/test'
       > ./test
       >
       > Testing 1 channel
       >
       >     vorbis_1ch_q-0.5_44100.ogg : make[1]: *** [Makefile:625: check] Segmentation fault (core dumped)
       > make[1]: Leaving directory '/build/libvorbis-1.3.7/test'
       > make: *** [Makefile:530: check-recursive] Error 1
       For full logs, run 'nix-store -l /nix/store/z1jz4kppn7wjvlcaf42j1v204srhpf4i-libvorbis-1.3.7.drv'.
error: 1 dependencies of derivation '/nix/store/809xsj4c4w37vdnk7jjkk3klf4zcwsqa-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/hmk52mm4k4s102yi6crfc4kak6f7my85-dbus-1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/m5d4lp215hcincxn5kgflwfv0wcc7n7m-X-Restart-Triggers-dbus.drv' failed to build
error: 1 dependencies of derivation '/nix/store/haiwnwldsbx0k7gjx2xsfxcibdbi955r-unit-dbus.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/pd8am01bbjlk4p8f926ig2f9hyr2dvbb-unit-dbus.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/csyn9xl77bcr54j8vx7i9g7skl3j0ssj-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/nf64pcdp2gb6yqbhm9767069f2h8y99d-user-units.drv' failed to build
error: 4 dependencies of derivation '/nix/store/m5j5b7mwz99nmj406xcgrva4cirjglki-etc.drv' failed to build
error: 2 dependencies of derivation '/nix/store/cirx9xihvqv04l255km2vy0zca4ck4rk-nixos-system-test-24.05.675.805a384895c6.drv' failed to build

Additional context

This worked fine using NixOS 23.11.

Notify maintainers

@ehmry

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.2, NixOS, 24.05 (Uakari), 24.05.675.805a384895c6`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"home-manager-24.05.tar.gz, nixos-24.05, nixos-hardware, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

ehmry commented 3 months ago

It's not my problem if you've over-riced you system. Try a git-bisect to nixos-23.11.

hoh commented 3 months ago

I extracted the logic in a shell.nix file. Interestingly, this works with zen3 and lower, but not with zen4.

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = [
    (pkgs.libvorbis.overrideAttrs (old: rec {
      NIX_CFLAGS_COMPILE = [ "-march=znver4" "-mtune=znver4" ];
    }))
  ];
}

Going to try to bisect based on this...

SuperSandro2000 commented 3 weeks ago

Going to close this as won't fix. Please provide a patch if you happen to have a fix.