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

Minimize binary size due to structopt/clap? #37

Closed
rom1v opened this issue Dec 2, 2017 · 2 comments
Closed

Minimize binary size due to structopt/clap? #37

rom1v opened this issue Dec 2, 2017 · 2 comments
Labels
enhancement We would love to have this feature! Feel free to supply a PR

Comments

@rom1v
Copy link

rom1v commented Dec 2, 2017

In a Rust app, I tried to replace my dirty manual command-line parsing by structopt.

It works well and the source code is far better. However, it makes my resulting binary 6× bigger. For instance the release+stripped version grows from 600K to 4M 1.4M, so at least 85% 57% of the binary is related to command-line parsing…

Are there any tips to reduce the final binary size?

EDIT: In fact, 4M is the non-stripped binary, the stripped is 1.4M (this is still bigger than 600K, but this makes a difference).

@TeXitoi
Copy link
Owner

TeXitoi commented Dec 3, 2017

I think there is features in clap to limit the depedencies. Then, structopt have to forward the features.

@TeXitoi TeXitoi added the enhancement We would love to have this feature! Feel free to supply a PR label Dec 3, 2017
@TeXitoi
Copy link
Owner

TeXitoi commented Jan 29, 2018

fixed by #46

@TeXitoi TeXitoi closed this as completed Jan 29, 2018
Eijebong pushed a commit to Eijebong/structopt that referenced this issue Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement We would love to have this feature! Feel free to supply a PR
Projects
None yet
Development

No branches or pull requests

2 participants