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

Go-Package-Store should know how to update itself #34

Open
Netherdrake opened this issue Mar 1, 2015 · 6 comments
Open

Go-Package-Store should know how to update itself #34

Netherdrake opened this issue Mar 1, 2015 · 6 comments

Comments

@Netherdrake
Copy link

It should run go build && go install on itself.

@dmitshur
Copy link
Member

dmitshur commented Mar 1, 2015

A general solution would be to get rid of the -d flag when executing go get -u -d some/package/....

But I'm worried that might install too many unwanted binaries into $GOPATH/bin. Thoughts?

@dmitshur
Copy link
Member

dmitshur commented Mar 1, 2015

By the way, until this issue is closed, updating Go Package Store manually is as easy as:

go get -u github.com/shurcooL/Go-Package-Store

@dmitshur
Copy link
Member

dmitshur commented Dec 7, 2015

I could special-case the Go Package Store import path, and do something differently for it. But I feel that isn't as great as a more general solution.

Perhaps binstale can be used for a more general solution. Its functionality can be used to determine which Go binaries you have installed, and whether something package you're installing contains binaries that would need to be updated.

Or maybe it can be a separate tab in Go Package Store. The current page can be considered a page for source code updates. The other tab can be a page for binary updates.

Maybe it's better to keep the two more connected; updating the source of a binary perhaps should update the binary too.

Thoughts on this are welcome.

@dmitshur
Copy link
Member

But I'm worried that might install too many unwanted binaries into $GOPATH/bin. Thoughts?

Oooh, I have a great idea!

I could do the following. When updating repos that contain commands (Go packages with name "main"), I can check if such a binary exists in $GOPATH/bin already. If so, I can go install that command.

That way, it would update existing binaries in $GOPATH/bin but not install new, unwanted ones.

The only downside is that it's possible to mistakenly overwrite the wrong binary, in case of a command naming ambiguity. For example, imagine you've installed a command foo via go get -u example.com/user/foo and later update another repo example.com/some/repo/... that happens to contain example.com/some/repo/something/no/one/uses/called/foo and that other binary foo replaces your original foo.

@dmitshur
Copy link
Member

dmitshur commented Jul 6, 2016

The only downside is that it's possible to mistakenly overwrite the wrong binary, in case of a command naming ambiguity.

It might be possible to resolve that ambiguity by using debug/gosym to extract the exact import path from binary. See shurcooL/binstale#6 for details.

This needs to be investigated and confirmed, but it's a great lead! Thanks @FiloSottile for the original idea!

@dmitshur
Copy link
Member

This is a feature I'd like to implement someday, and I'm using this issue to track the progress towards that. It's not done yet. I'd like to keep it open until it's done, if that's okay with you @Netherdrake.

@dmitshur dmitshur reopened this Aug 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants