about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2020-04-20 05:48:04 +0200
committerPierre Bourdon <delroth@gmail.com>2020-04-20 05:48:04 +0200
commite857e72b7adc067294b6215df87ad319c15861c7 (patch)
tree17e597f95f9e51689399373378cb3eb8e104ffa5 /pkgs/applications
parenta2d9f5843336b00398542448321a497309907d05 (diff)
downloadnixlib-e857e72b7adc067294b6215df87ad319c15861c7.tar
nixlib-e857e72b7adc067294b6215df87ad319c15861c7.tar.gz
nixlib-e857e72b7adc067294b6215df87ad319c15861c7.tar.bz2
nixlib-e857e72b7adc067294b6215df87ad319c15861c7.tar.lz
nixlib-e857e72b7adc067294b6215df87ad319c15861c7.tar.xz
nixlib-e857e72b7adc067294b6215df87ad319c15861c7.tar.zst
nixlib-e857e72b7adc067294b6215df87ad319c15861c7.zip
alacritty: manually strip before running patchelf
patchelf seems to generate an ELF that "strip" cannot process:

  strip: /tmp/stNGAZvd: not enough room for program headers, try linking with -N
  strip:/tmp/stNGAZvd[.interp]: bad value

(This unfortunately does not cause any errors or even error output in
the build log, since the default strip hook redirects them to /dev/null
and ignores failures.)

The lack of stripping ends up leaking paths to the compiler in the debug
symbols. This more than doubles the transitive closure size of
alacritty.

Impact on closure size: 314.5M -> 131.8M.
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/misc/alacritty/default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/applications/misc/alacritty/default.nix b/pkgs/applications/misc/alacritty/default.nix
index b6248b8f6f13..c5d7b19618fd 100644
--- a/pkgs/applications/misc/alacritty/default.nix
+++ b/pkgs/applications/misc/alacritty/default.nix
@@ -104,6 +104,12 @@ rustPlatform.buildRustPackage rec {
     '' else ''
       install -D extra/linux/Alacritty.desktop -t $out/share/applications/
       install -D extra/logo/alacritty-term.svg $out/share/icons/hicolor/scalable/apps/Alacritty.svg
+
+      # patchelf generates an ELF that binutils' "strip" doesn't like:
+      #    strip: not enough room for program headers, try linking with -N
+      # As a workaround, strip manually before running patchelf.
+      strip -S $out/bin/alacritty
+
       patchelf --set-rpath "${lib.makeLibraryPath rpathLibs}" $out/bin/alacritty
     ''
   ) + ''