78 points · by nikolay · 4y ago · 102 comments
ie. I would love for users to be able to just do:
$ bingo install hugo
... installing github.com/gohugoio/hugo
I don't really want the concept of any project _owning_ a name, so in the cases where multiple projects were mapped/discovered for a given name, we'd want to ask the user which one they wanted to install.1: This needs a copy-pastable 1-5 lines at the top of the readme for installing it (which installs the binary, and adds it to your PATH, and appends to your .bashrc or .zshrc or whatever).
2: Please support metapackages, so that I can publish a list of all packages I want/use and "bingo install" that.
3: Consider a "bingo selfinstall" command that appropriately detects .zshrc/.bashrc/whatever and appends the magic PATH-munging. (cf "nextdns install")
4: That is an excellent name for a utility. (Much better than this cargo/crate/gem/bundle/beer/cask/tap crap.)
1: re: copy-paste install script: I'll definitely grind on this and see what we can do. Bingo requires my Run[1] package, which itself is written in go and can be installed via `go install github.com/TekWizely/run` -- Additionally, once you have Bingo installed, you can use IT to re-install Run and then manage your Run installation via Bingo itself ! A self-running install script for Bingo that installs a temporary version of Run, then installs Bingo, then uses Bingo to install a permanent version of Run would actually be quite clever !
2: re: metapackages: Bingo's goal is to be a useful wrapper on top of Go's built-in, and highly useful, install feature. Go's auto compile+install features are already getting pretty complex (ie code generation, specifying tags, etc)... The fact that you can download and install hugo with `--tags extended` from the command line is pretty sweet. That said, I would say any additional support (ie metapackages) might first start as a request against go install proper -- That said, it might be a nice addition to maybe fetch some kind of `go.install` file that contains basic steps for installing a complex package. If it was going to be a non-sanctioned idea, I would still want the format of the file/spec to stand on its own and be useful outside of Bingo.
3: re: shell/path setup script: PRs always appreciated ;)
4: Graci ! I am quite pleased with myself for the name - BTW: The idea for the tool came first. I then brainstormed the name ...
Thanks again and please lemme know if you have any further comments/questions! If nothing else please consider opening Issues for these ideas to help me keep track of them :)
-TW
$ bingo install package-url
you don't need to maintain any package information.I'm not sure if nix can install (+ manage) golang binaries from the command line using _just_ the package url / binary name?
for the record, the project idea came first, and the brainstorming for names came after.
But it was definitely a eureka moment that made me double-excited to create and share the project !
Thanks [for] the comment,
-TW
Bingo is basically a wrapper over `go install` that makes it easier to manage the binary after installation. ABI and Distro etc issues are resolved however Go resolves them internally.
For example a project might mix Java, JavaScript, and Python. Should the project use all three package managers? When should the operating system package managers (rpm, yum) be used? What package manager is a good choice for languages without first-class package managers (like Ada or Fortran)? When is a developer portal package manager, like Backstage.io description format (https://backstage.io/docs/features/software-catalog/descript...), the way to go?
Wow what a nice random surprise - Thanks OP for the call out!
Go already makes installing go apps extremely easy, ie:
go install package-url
What Bingo tries to do is make _managing_ that installed binary just as easy.Once installed, you can then manage the installation by the binary's name.
An example I personally use:
$ bingo install github.com/gohugoio/hugo
# ... two versions later
$ bingo update hugo
I'm happy to try to answer any questions - else I'll be perusing the comments looking for places to chime in.Thanks again,
-TW
go mod init
touch main.gohttps://github.com/boourns/scaffold - generates a SQL select/insert/update layer, currently specifically for SQLite.
https://github.com/boourns/go-gql-typescript-example - an example project using scaffold for the model layer, https://gqlgen.com to generate the graphql layer, and typescript.
This is my currently preferred stack. Currently in my second year of working on a 25k LOC project in this stack and it has scaled up to meet those demands.
Regarding MacPorts:
> MacPorts distributes source code that is compiled on install, so Macports is generally much slower to install packages. Macports installs packages under “/opt/local”. Macports uses root, which can lead to users goofing up their system or workplace policy issues
Sounds horrifying
At this point I only use Homebrew for casks and Nix for everything else on macOS, which is far more up to date, reproducible, and cross-platform.
When you do that, do you also need to compile the applications during installation…? (E.g. stuff written in Rust/C/C++)
Do you need to edit the “recipes” a lot or do they generally Just Work?
It's straightforward enough that the software devs I work with consider it "painless" to use.
asdf describes itself as "asdf is a CLI tool that can manage multiple language runtime versions on a per-project basis. It is like gvm, nvm, rbenv & pyenv (and more) all in one!"
Since 2009. There is no package manager younger. But it sure has a lot of hype.
> I've never seen a better alternative for macOS
Because you've never looked. Every other package manager available on macOS is better than Homebrew. pkgsrc. Nix. Fink. All of them are better. Homebrew is dead last in features and stability. After using Homebrew for only a short time, you'll have a mess on your file system. Good luck cleaning it up.
MacPorts will install pre-built binaries with the -b option, if you want. But building from source is superior. It's called rolling your own, because what you build is yours and yours alone, and it is more secure, allowing review of the code, has the advantage of customizing with specific variants and deeper customizations, and allows installing the most recent version of the code. With binary installs, your're stuck with whatever you get. Also, MacPorts is more compatible, will install and build from Tiger on up, anc works for all users on the system with sudo access. Homebrew abandons older systems rapidly, and only works for one user. But the most obnoxious thing about Homebrew is what it does to /usr/local, which is to say it fubars the directory and everything that lives there.
Been using Homebrew for a decade and haven’t had serious problems with it in a very long time. I do use asdf for versioning language runtimes though. I’m not saying it doesn’t have these problems, just that it’s possible to use without running into them, which is why I haven’t felt compelled to switch.
> But building from source is superior.
Not if you value your time. Also Homebrew supports it with --build-from-source, so this is really just a question of defaults. Homebrew values my time.
Let's break this down.
> Macports is generally much slower to install packages
MacPorts and Homebrew are both source-based package managers. Distributing source code to be compiled on install is the basic design of both. And both also have binary caches. I think compared to the size of each package collection, Homebrew's binary cache is more complete, so it might save you some time sometimes.
(As package managers go, though, Homebrew is extremely slow.)
> Macports installs packages under “/opt/local”
This is much better behavior than taking over /usr/local, which is generally for packages you install manually. It's much more portable and much less prone to compatibility problems.
> Macports uses root, which can lead to users goofing up their system or workplace policy issues
Homebrew uses root and it just hides from you that it uses root by giving ownership of /usr/local to your particular user, which constitutes a system policy issue. It's a security problem and it's also just a disgusting thing to do on a nominally multi-user operating system.
The only one of these issues where Homebrew wins is with the binary cache size (which has apparently come at the cost of reducing customizability for many Homebrew packages, if the comments of longtime Homebrew users on GitHub and HN are to be believed).
Isn't using `/usr/local` pretty standard for BSDs? I remember that on FreeBSD the package manager installs things there, and I _think_ NetBSD and OpenBSD might also, but it's been so long that I've played around with them that I can't remember for sure.
[1]: https://saagarjha.com/blog/2019/04/26/thoughts-on-macos-pack...
I'm quite enjoying Nix as a *nix + mac package manages. Plus using direnv really makes things a breeze. Although Nix has a __very__ steep learning curve... I still recommend it greatly!
https://www.tecmint.com/nix-package-manager-for-linux/
There may be bugs with packages though, so I use it for what works for me. Not when it breaks with local dynamic libraries. It's a nice addition to get more recent packages than the distro offers.
Guix can be used as additional package manager as well.
NixOS (the distro) is steep though, like driving madly along a cliff steep. Guix even more so but with less speed.
I've found these three options to be very valuable:
export HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED=1 # only list updates to installed software
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_AUTO_UPDATE=1False. Binaries, built from source, are used by default.
Me too. It embeds Google spyware without consent, sending a unique identifier from your machine every time you use it.
It's disturbing seeing people say "just run `brew install $PACKAGE`" where $PACKAGE is privacy or local-first software without including the requisite `brew analytics off` on the line above it.
If you would be so kind to elaborate? I’m curious what the pain points or issues are with homebrew.
I personally can't use it anymore now that my MacOS version (Mojave) is not supported so everything has to build from source and Rust fails.
Ask HN: Best Alternative to Homebrew in 2021? https://news.ycombinator.com/item?id=29079096
This is pretty interesting, that Homebrew abandons recent systems. I am running MacPorts on Mojave with no issues (yet). However, I am strongly considering going back to High Sierra for it's ability to build 32-bit packages, which Mojave won't do (though it will still run 32-bit applications with a warning). The only thing that keeps me from doing so immediately is that I have macOS install exhaustion. I'm a little beat up because I am doing custom macOS installs, and it takes a little effort to prevent the installer from installing all the crap I don't want. The easier way to do it is just to let it install, then remove it. I'm a little something that I prefer to go the other route, and I'm not aware of anyone else fighting the default system install to assist. I have no doubt that MacPorts runs flawlessly on High Sierra, because I have it running flawlessly on Mountain Lion, and I have a functional but frozen install of MacPorts on Snow Leopard, but I am aware there are others that have live and functional MacPorts running on Snow Leopard with a minimal amount of effort, and I'm pretty sure the same is true of Leopard, Tiger and Jaguar, though the number of users gets smaller the further back we go. It can not be overstated how awesome that is, that no system version is completely left behind. This exposes that MacPorts has some seriously resiliant development.
The Homebrew package registry is fresher but not bigger than MacPorts. 5901 packages in homebrew-core versus about 11000 ports in MacPorts (not counting subports).
Package freshness depends on contributions. A bigger collection is inherently harder to maintain, yet MacPorts has fewer active contributors than Homebrew.
> It also supports GUI apps
MacPorts doesn't have a separate cask-like feature, but there are some GUI apps in the aqua category, most of which are built from source with binary cache.
If you need to manage proprietary and/or binary GUI apps with a package manager, you could still use Homebrew casks for that and MacPorts for everything else.
Good to know that it is still actually bigger, but that’s really only relevant to me if it’s a superset of Homebrew’s registry, and in the past I have found packages I needed that were in Homebrew but not MacPorts. If I had to guess I would bet MacPorts has a lot of older stuff in it.
> Package freshness depends on contributions.
Of course, I understand this. It’s the main reason I have to use Homebrew. I don’t want to have to maintain my own packages.
> If you need to manage proprietary and/or binary GUI apps with a package manager, you could still use Homebrew casks for that and MacPorts for everything else.
This is what I mean about being ideological. What benefit do I get from installing two different package managers when one would suffice? It’s definitely not enough to merit doing so.
MacPorts has 28,082 active ports.[1] I'm not sure if that includes subports.
Linux OS package managers are, almost by necessity, full of outdated packages which are not the versions I want to use for day-to-day CLI applications. Snaps, Flatpaks and AppImages all have their own downsides due to half-baked isolation goals and the associated usability compromises. Language-specific package managers are a mixed bag, but too narrow in scope when thinking about usage of tools rather than development based on libraries. Maybe Nix or the Arch AUR are a better option, but they come with a learning curve and/or stability compromise. I don't care how the packages are arranged on my Mac; the system is too locked down for me to really have the level of control I'd like anyway, so better to just accept the usability advantages and get on withy life.
This is a valuable perspective. I wonder how much macOS primes users in general to value usability over other dimensions of good design.
(I also wonder how much better a time I'd have on macOS if I adopted this attitude.)
It is the de facto default package manager as most installation instructions default to it if they mention a package manager on MacOS
> It is a recent development
1. It's been around for 12 years already
2. Being more recent doesn't preclude it from being a de facto default
> Why the constant advertisement for adoption
It's not "constant advertisement". This is what being the de facto default means: people are using the de facto default and not something that you perceive as the default
It's not a package manager
> Homebrew is worse than forgoing package management and just using git
So you're using AppStore as your package manager?
> Homebrew is pure hype, and without the hype, it has nothing.
Ah yes, the well-known decade-old hype that everyone keeps advertising.
The various tools included in MacOS are often old or BSD versions instead of GNU tools. There's lots of gotchas when writing scripts on MacOS that will run as part of a Linux build pipeline.
Yes I am referring to the certified POSIX userspace on macOS.
Portable UNIX software should use POSIX anyway not GNUisms.
It really does!
Homebrew was written to take some shortcuts to reduce compilation time vs. MacPorts at that time. It was also written to be simpler to hack on and package for, since the author found MacPorts harder to work with than he'd have liked.
I think it takes the metaphor too far but I've seen Homebrew fans praise it as making things like repo management accessible to them when they started using Homebrew without prior experience with other package managers. So maybe it's useful.