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

Huge dependency graph #21

Closed
zellyn opened this issue Aug 26, 2021 · 2 comments
Closed

Huge dependency graph #21

zellyn opened this issue Aug 26, 2021 · 2 comments

Comments

@zellyn
Copy link

zellyn commented Aug 26, 2021

go mod graph | wc -l
     259

It transitively pulls in etcd, prometheus, protobuf and grpc. I believe this is all because of the warthog618/config library used in the commandline tools.

My poor little Raspberry Pi Zero W gets overwhelmed just trying to download everything.

Would you be open to a PR that converts to plain Go flag handling and removes that dependency?

@warthog618
Copy link
Owner

The use of config is more pervasive than you think - it is in the examples as well and also uses config files not just flags.
I have a couple of patches locally where I looked at switching to spf13/pflag and spf13/viper, as those are commonly used for configuration, but that makes the dependency situation worse:

go mod graph | wc -l
2371

I also considered using the standard Go flags for the tools, but the intent was to emulate the libgpiod command line and output as closely as possible and if I recall correctly that wasn't possible with the Go flags.

I recommend cross-compiling for your Pi Zero on a different platform - that is what I do.

@zellyn
Copy link
Author

zellyn commented Aug 27, 2021

Yeah, I started cross-compiling. Definitely much better.

fwiw, I've started migrating to alecthomas/kong. I really like it, and it's quite lightweight. And if you want config files, there's kong-hcl or kong-yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants