Skip to content

buildPerlModule broken on Darwin due to shebang character limit #35353

@boronine

Description

@boronine

Issue description

Executables produced by buildPerlModule use the shebang as a way of injecting dependent module paths. This goes over the shebang character limit which results in the shebang being ignored. On Darwin, the limit appears to be 512 characters. See my investigation here.

Steps to reproduce

  1. Be using MacOS
  2. Make default.nix:
rec {
  pkgsOriginal = import <nixpkgs> {};
  pkgs = import (pkgsOriginal.fetchzip {
    url = "https://github.com/NixOS/nixpkgs/archive/1869e7e5b0580e9398529dbebde7e983193c445e.zip";
    sha256 = "00cnbmfnznbjlw95cmiarns2qy4w4z0lkp07rxz6jfhk78vkv8yv";
  }) {};
  biber = pkgs.biber;
}
  1. Run:
nix-build -A biber
result/bin/biber
  1. See output (file parsed by Bash):
result/bin/biber: line 3: use: command not found
result/bin/biber: line 4: use: command not found
result/bin/biber: line 5: use: command not found
result/bin/biber: line 7: use: command not found
result/bin/biber: line 8: EXIT_OK: command not found
result/bin/biber: line 9: EXIT_ERROR: command not found
result/bin/biber: line 10: syntax error near unexpected token `}'
result/bin/biber: line 10: `};'
  1. How many characters is the shebang?
$ head -n 1 result/bin/biber | wc -c
   17370

Technical details

  • system: "x86_64-darwin"
  • host os: Darwin 17.4.0, macOS 10.13.3
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 1.11.16
  • channels(root): "nixpkgs-18.03pre126880.360e0195500"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixpkgs

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.topic: darwinRunning or building packages on Darwin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions