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

conftest: return to less ldflags #104293

Closed

Conversation

06kellyjac
Copy link
Member

@06kellyjac 06kellyjac commented Nov 19, 2020

Motivation for this change

Go back to just injecting the version

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS (x86_64)
    • 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.

@06kellyjac
Copy link
Member Author

Result of nixpkgs-review pr 104293 1

1 package built:
  • conftest

@SuperSandro2000
Copy link
Member

Go back to just injecting the version

This explains what you are doing but not why. Do you just want to clean it up or is it causing issues? Just curious.

@06kellyjac
Copy link
Member Author

06kellyjac commented Nov 19, 2020

-s is an ld flag to strip but the patch phase (or maybe a different phase) does that anyway. -w is a flag I've seen a lot but I wasn't super knowledgable about.
Apparently the ldflag -s can strip a bit more thoroughly than strip so I guess it could be left in. -w apparently removes "DWARF generation" which would save a small amount too.

I'm mainly removing them because I was asked to document them but if they're not worth having may as well drop them

I guess they could stay in...
I'll try compare the two sizes with and without


Edit:

with -s -w: 29.4 MB
without: 34.7 MB

I guess 5.3 MB or a 15.3% size reduction is nothing to stick your nose up at.

Extra testing:
with just -s: 29.4 MB
just -w: 34.7 MB

Seems like -s is the one doing the heavy lifting

@SuperSandro2000
Copy link
Member

size reduction is nothing to stick your nose up at.

It is. If we would that treewide it would be a bad decision.

-s -w strip debugging information we don't need. It is fine to have them. We have them 103 times in nixpkgs (https://github.com/NixOS/nixpkgs/search?q=-ldflags%3D-s+-w) and it should probably be a default.

This PR should be closed.

@06kellyjac
Copy link
Member Author

06kellyjac commented Nov 19, 2020

size reduction is nothing to stick your nose up at.

Means it is a significant size reduction

Yeah it'd be nice to have them default but I think you should be able to turn them off to

@06kellyjac 06kellyjac closed this Nov 19, 2020
@06kellyjac 06kellyjac deleted the conftest_remove_excess_flags branch November 19, 2020 19:36
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

2 participants