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

Self-Update #9

Open
kemitchell opened this issue Jun 30, 2018 · 8 comments
Open

Self-Update #9

kemitchell opened this issue Jun 30, 2018 · 8 comments

Comments

@kemitchell
Copy link
Member

https://licensezero.com/cli-version
https://licensezero.com/install.sh

@derhuerst
Copy link

I'd love to upgrade the CLI using Homebrew!

(I tried writing a Homebrew Formula, but failed to get the make-based build working.)

@kemitchell
Copy link
Member Author

@derhuerst could the Homebrew formula pull down the install script at https://licensezero.com/install.sh? That script in turn downloads binaries from GitHub releases.

@derhuerst
Copy link

Maybe, but it doesn't sound like it:

We don’t like tools that upgrade themselves

Software that can upgrade itself does not integrate well with Homebrew’s own upgrade functionality. The self-update functionality should be disabled (while minimising complication to the formula).

We don’t like install scripts that download unversioned things

We don’t like install scripts that are pulling from the master branch of Git repositories or unversioned, unchecksummed tarballs. These should use resource blocks with specific revisions or checksummed tarballs instead. Note that we now allow tools like cargo, gem and pip to download specifically versioned libraries during installation.

The only benefit (that I see) of using the hosted install.sh in the Formula would be that nobody has to update the Formula on new releases. A major disadvantages I can think of is non-reproducible brew installs.

@kemitchell
Copy link
Member Author

Ah. So I opened this issue to remind myself to think about self-update. But the CLI doesn't do any self-update right now.

The script I linked to automatically finds and downloads the latest GitHub release binary for the platform and system. But you could probably pull out the binaries just for Mac/x86-64 and package however Homebrew typically packages standalone binaries.

@derhuerst
Copy link

But you could probably pull out the binaries just for Mac/x86-64 and package however Homebrew typically packages standalone binaries.

Yeah, I'm not sure if this is appreciated (or even allowed). AFAIK, but I might be wrong, the preferred setup is to write a fomula that builds from source, let the Brew Test Bot build binaries (bottles) and add their hashes to the fomula.

@derhuerst
Copy link

So I opened this issue to remind myself to think about self-update. But the CLI doesn't do any self-update right now.

The licensezero cli could obviously self-update itself, but there many things to get right about this (handling proxies, downloading to a temp var, replacing the binary atomically), and many convenience features that devs are used to (allowing to "pin" to an old version, updating all tools with a single command like apt upgrade -y, signed binaries to prevent download servers from being compromised, unattended upgrades).

By leveraging existing update channels, you could support all of these with a lot less effort, but on the other handy, probably not everyone has brew/apt/pacman/go/nuget installed.

@derhuerst
Copy link

@kemitchell
Copy link
Member Author

I'm currently building this repo with Travis, not for any particular reason, except Travis existed when I started the project.

If you'd like to send a PR over building with Actions instead, and implementing whatever it is that you need to do for Homebrew, that would be very welcome!

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