Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alacritty: link binary inside .app on darwin #89737

Closed
wants to merge 1 commit into from

Conversation

bouk
Copy link
Contributor

@bouk bouk commented Jun 7, 2020

Otherwise you end up with two binaries, only one of which is stripped.
This causes an extra 4.3MB, because 'make app' does another cargo build
and copies that binary into the .app.

Motivation for this change

Installing alacritty on darwin right now causes two binaries to be created, only one of which is stripped.

tree -h /n/s/zqyw2yx0j4w5b6syh0adf79xm5wdb18l-alacritty-0.4.3
.
├── [  96]  Applications
│   └── [  96]  Alacritty.app
│       └── [ 160]  Contents
│           ├── [2.4K]  Info.plist
│           ├── [  96]  MacOS
│           │   └── [4.3M]  alacritty
│           └── [  96]  Resources
│               └── [650K]  alacritty.icns
├── [  96]  bin
│   └── [3.7M]  alacritty
├── [  96]  nix-support
│   └── [  69]  propagated-user-env-packages
└── [ 192]  share
    ├── [  96]  bash-completion
    │   └── [  96]  completions
    │       └── [1.8K]  alacritty.bash
    ├── [  96]  fish
    │   └── [  96]  vendor_completions.d
    │       └── [1.9K]  alacritty.fish
    ├── [  96]  man
    │   └── [  96]  man1
    │       └── [1.3K]  alacritty.1.gz
    └── [  96]  zsh
        └── [  96]  site-functions
            └── [1.3K]  _alacritty

16 directories, 9 files

In this PR I'm overwriting the binary inside the .app with a link to the binary inside bin/. The build still compiles the binary twice, but preventing that would require a patch to the Makefile

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Otherwise you end up with two binaries, only one of which is stripped.
This causes an extra 4.3MB, because 'make app' does another cargo build
and copies that binary into the .app.
@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jun 7, 2020
@ofborg ofborg bot requested review from cole-h, Mic92, Ma27 and Br1ght0ne June 7, 2020 12:45
@Mic92
Copy link
Member

Mic92 commented Jun 7, 2020

@GrahamcOfBorg build alacritty

@marsam
Copy link
Contributor

marsam commented Jul 4, 2020

addressed in cb11ab3bf64

@marsam marsam closed this Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants