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

vlc: shrink runtime closure size by removing CONFIGURE_LINE #49315

Merged
merged 2 commits into from
Oct 28, 2018

Conversation

andrew-d
Copy link
Contributor

Motivation for this change

Shrink the runtime closure size for VLC by removing the ./configure flags from compiled binaries.

Before/after sizes, tested on NixOS 18.09:

/nix/store/fw6gpwlcdj6j4796biglvwv7wkjn1y5p-vlc-3.0.4 1273486712
/nix/store/js9fhzp2fhyzv0nzcn33k98cf2xzzaln-vlc-3.0.4 892909424

(about 1.2GiB to 0.83GiB)

Fixes #49287

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@andrew-d
Copy link
Contributor Author

cc @cleverca22 (reported #49287)

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100 labels Oct 27, 2018
@joachifm
Copy link
Contributor

@GrahamcOfBorg build vlc

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: vlc

Partial log (click to expand)


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

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


@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: vlc

Partial log (click to expand)

strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/wi65cy2pz8icl1y3qa5a3lvqinzqpkf7-qtsvg-5.11.1-bin/lib
patching script interpreter paths in /nix/store/wi65cy2pz8icl1y3qa5a3lvqinzqpkf7-qtsvg-5.11.1-bin
checking for references to /build in /nix/store/wi65cy2pz8icl1y3qa5a3lvqinzqpkf7-qtsvg-5.11.1-bin...
postPatchMkspecs
fixQtModulePaths: Fixing module paths in `/nix/store/ljhnb0bzmv5kgnvhiq1l2d50qy48icms-qtsvg-5.11.1-dev/mkspecs/modules/qt_lib_svg_private.pri'...
fixQtModulePaths: Fixing module paths in `/nix/store/ljhnb0bzmv5kgnvhiq1l2d50qy48icms-qtsvg-5.11.1-dev/mkspecs/modules/qt_lib_svg.pri'...
postPatchMkspecs
cannot build derivation '/nix/store/fjrlk6qgdby135ddfk8ynxlmwvvp55b4-vlc-3.0.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/fjrlk6qgdby135ddfk8ynxlmwvvp55b4-vlc-3.0.4.drv' failed

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-linux (full log)

Attempted: vlc

Partial log (click to expand)

[ 64%] Building CXX object lib/Target/ARM/MCTargetDesc/CMakeFiles/LLVMARMDesc.dir/ARMMCAsmInfo.cpp.o
[ 64%] Building CXX object lib/Target/ARM/MCTargetDesc/CMakeFiles/LLVMARMDesc.dir/ARMMCCodeEmitter.cpp.o
[ 64%] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64AsmPrinter.cpp.o
[ 65%] Building CXX object lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86InstructionSelector.cpp.o
[ 65%] Building CXX object lib/Target/ARM/MCTargetDesc/CMakeFiles/LLVMARMDesc.dir/ARMMCExpr.cpp.o
building of '/nix/store/j1yzzw5jg9dpxlrcp5mj8awfgh755byb-rustc-1.30.0.drv' timed out after 1800 seconds
cannot build derivation '/nix/store/amvxhnkmn7szrbgp5k6zrd9nrms8i7cj-cargo-1.30.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/s45nfy009nwq82bh7k6440z6q1ga7d82-librsvg-2.42.4.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/59c1zq5bhsmn6k81h0q7ws0n6g7viack-vlc-3.0.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/59c1zq5bhsmn6k81h0q7ws0n6g7viack-vlc-3.0.4.drv' failed

@andrew-d
Copy link
Contributor Author

After a bit of digging, we can also shrink the closure size by patching some error messages that reference the Qt development headers. With the latest commit, we have:

/nix/store/4dpp6igacx29yj9jz2cl9kkyhnbp0l5i-vlc-3.0.4	  652923328

Or about 623MiB, which is just about half of the original size!

@joachifm - The build times appears to time out, but I can confirm that it works locally on NixOS 18.09 - the build (including the new commit) succeeds and VLC starts successfully.

@joachifm joachifm added the 6.topic: closure size The final size of a derivation, including its dependencies label Oct 28, 2018
@joachifm joachifm merged commit aa4005f into NixOS:master Oct 28, 2018
@joachifm
Copy link
Contributor

LGTM. Thank you

@andrew-d andrew-d deleted the andrew/vlc-shrink-closure branch October 28, 2018 01:36
@andrew-d
Copy link
Contributor Author

And thank you for the quick response 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: closure size The final size of a derivation, including its dependencies 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants