-
Notifications
You must be signed in to change notification settings - Fork 73
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
Reduce closure size of executable #392
Conversation
flake.nix
Outdated
# Ditch data dependencies that are not needed at runtime. | ||
# cf. https://github.com/NixOS/nixpkgs/pull/204675 | ||
postInstall = (old.postInstall or "") + '' | ||
${lib.concatStrings (map (e: "remove-references-to -t ${e} $out/bin/emanote\n") disallowedReferences)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to not hardcode $out/bin/emanote
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I'm wondering if this can be upstreamed to https://github.com/srid/haskell-flake (cc @roberth) in some form to make it useful for other projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$out/bin/*
perhaps? However I don't think we should need it. Why are unused references created in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is about data-files
, maybe you need extra-source-files
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$out/bin/*
perhaps? However I don't think we should need it. Why are unused references created in the first place?
Good question. Per NixOS/nixpkgs#204675 (comment) we won't need this after haskell/cabal#8534
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new changes, I suppose another idea is to just upstream removeReferencesTo
to nixpkgs (in pkgs.haskell.lib
). That or wait for that cabal PR to go through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd still have to manually specify all the deps, and look at this example to understand context. I figure at that point it's not much harder to copy + edit.
Makes little difference compared to #295 (comment) ? @edrex Any ideas? ❯ nix path-info -rSh . | sort -rhk2
warning: Using saved setting for 'extra-substituters = https://cache.garnix.io' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=' from ~/.local/share/nix/trusted-settings.json.
/nix/store/lrki677qy2vpa1y4889h7vjxmik1wydj-emanote-1.0.1.0 5.0G
/nix/store/2m3zbpinahd83ki2fdscrlwhqqfsnv8r-pandoc-2.17.1.1 4.5G
/nix/store/8jq127z1bfbs84p80ynpqx6j314wvz93-citeproc-0.6.0.1 3.3G
/nix/store/jzmijwsh6v28pawigacyx84xabjm0xra-skylighting-0.12.3.1 3.2G
/nix/store/zpzf6dq7dzf10balbs48b9z8iwryqniq-tree-diff-0.2.2 3.1G
/nix/store/avb55ygi7g3yw2z2b8fkg602fss48hjp-skylighting-core-0.12.3.1 3.1G
/nix/store/a52ijkcxx8nqdif7y0541z9vhr48wq8x-http-client-tls-0.3.6.1 3.1G
/nix/store/0dmn5n5icw9xzwrjld8s8f52x16xqc07-haddock-library-1.10.0 3.1G
[..] |
Did you try |
Looks like there should be a
|
Oh wait, remove-references-to happened on |
Fix: ddde55a (had to put it in overrides and use Looking good now,
|
Also log it in CI.
Resoves #295
Port of @edrex 's NixOS/nixpkgs#204675