NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.48k stars 12.97k forks source link

Build failure: dwarf-fortress on darwin #305141

Open fmoda3 opened 2 months ago

fmoda3 commented 2 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build dwarf-fortress on MacOS (or presumably any non-linux systems listed in the supported platform list)
    export NIXPKGS_ALLOW_UNFREE=1
    nix build "nixpkgs/nixpkgs-unstable#dwarf-fortress" --impure

Build log

error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'darwin-system-24.05.20240417.2e359fb+darwin4.36524ad'
         whose name attribute is located at /nix/store/3vysbx7v008h7473gwfmv6lzqfzsn3q7-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'activationScript' of derivation 'darwin-system-24.05.20240417.2e359fb+darwin4.36524ad'

         at /nix/store/87clbsxcf2wawlhi49k96ffb805sa3v0-source/modules/system/default.nix:95:7:

           94|
           95|       activationScript = cfg.activationScripts.script.text;
             |       ^
           96|       activationUserScript = cfg.activationScripts.userScript.text;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: Package ‘auto-patchelf-hook’ in /nix/store/3vysbx7v008h7473gwfmv6lzqfzsn3q7-source/pkgs/build-support/trivial-builders/default.nix:68 is not available on the requested hostPlatform:
         hostPlatform.config = "x86_64-apple-darwin"
         package.meta.platforms = [
           "aarch64-linux"
           "armv5tel-linux"
           "armv6l-linux"
           "armv7a-linux"
           "armv7l-linux"
           "i686-linux"
           "loongarch64-linux"
           "m68k-linux"
           "microblaze-linux"
           "microblazeel-linux"
           "mips-linux"
           "mips64-linux"
           "mips64el-linux"
           "mipsel-linux"
           "powerpc64-linux"
           "powerpc64le-linux"
           "riscv32-linux"
           "riscv64-linux"
           "s390-linux"
           "s390x-linux"
           "x86_64-linux"
         ]
         package.meta.badPlatforms = [ ]
       , refusing to evaluate.

       a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.

Additional context

I think this is due to the v50 update adding in the autoPatchelfHook dependency, which is linux only:

https://github.com/NixOS/nixpkgs/blob/3610489cd2578b6cd598611695fa00f9a7e67164/pkgs/games/dwarf-fortress/game.nix#L98

Introduced in PR: https://github.com/NixOS/nixpkgs/pull/300402

Notify maintainers

@a1russell @robbinch @roconnor @abbradar @numinit @shazow @ncfavier

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-darwin"`
 - host os: `Darwin 23.4.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.2`
 - channels(fmoda3): `""`
 - channels(root): `"nixpkgs-21.11pre329302.d14ae62671f"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

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

numinit commented 1 month ago

@fmoda3 Can you give https://github.com/NixOS/nixpkgs/pull/317116 a shot? Don't have a Darwin system to test but it at least evals now.

fmoda3 commented 4 weeks ago

@numinit Just posted a comment on your PR with info. It passes eval, but fails at build (seems to be looking for a windows executable).

numinit commented 3 weeks ago

Weirdly OS X actually uses a binary called dwarfort.exe...