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

Suggestion: Introduce a CLI to allow synchronization and easy maintenance of project binaries #21

Open
brian-dlee opened this issue Sep 8, 2024 · 2 comments

Comments

@brian-dlee
Copy link

I found your project and thought it was a nice solution for managing standalone tools for golang projects. One case we have in our project is compiling SQL to Go using sqlc. This binary requires pinning. If one developer has a different version than another then building the project could cause unnecessary or unintended changes to project files.

Currently we install sqlc inside a Justfile using go install .... We also use air and golangci-lint. What'd I'd like to do is make an easy way to manage these external dependencies. I currently use direnv to construct an ignored directory .bin in the project. Your tool fit right into this as I can just use curl to install the binaries into the .bin directory and update the PATH accordingly. The only problem I have is automatically installing updates when we bump the version.

I figured there was a solution to this with some scripting. I put together a little CLI script to download binaries via Goblin and keep track of what's installed with a .goblin and .goblin.lock files. I wrote it in python so I can slap it together relatively quickly to test out the idea. I'm happy to port it over to Go or some other language. I figured I'd drop by here, let you know my use case, and see if this project is interested in expanding its footprint by including something like this. I can surely maintain this separately on my own, so please feel free to tell me this doesn't belong here.

It's a bit hacky at the moment as it extracts the resolved version from the shell script returned by goblin.run. Should this be something more official or relied on, I'd probably want to add an API endpoint to return this information to improve stability. Here's the a brief setup for a project with this configured.

I dropped my tool into a GitHub repository here: https://github.com/brian-dlee/goblin-cli.

@barelyhuman
Copy link
Owner

I like the idea of goblin maintaining the versions but it’s a slightly more bigger in scope and might take time. I consider it a valid feature and have thought of doing so myself but with a tad bit more functionality where if the builds are already available for a app it would download instead of build.

As for the version extraction, the resolution part of goblin can be exposed as an API if needed, it’s easier to add that and i’ll do that first

@barelyhuman
Copy link
Owner

As for the version extraction, the resolution part of goblin can be exposed as an API if needed, it’s easier to add that and i’ll do that first

This should be closed by #25 and will be a part of the next nightly docker build. I'll deploy that evening tomorrow (28th Sep, IST)

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