10 ms·
Bingo – The missing package manager for Go binaries (Homebrew for “go install”)
- whateveracct 5y agoI just use Nix and nixpkgs' Go infrastructure
- dmitriid 5y agoDevelopers should stop using the word "just".
- whateveracct 5y agoFor me, using Nix is "just" that easy :)
- chana_masala 5y agoCan you explain more? I've looked at Nix but haven't extensively used it
- siraben 5y agoI recently packaged fq (written in Go) in Nixpkgs[0] and it was a breeze. You just have to specify the vendor and source hashes (which can be done automatically), and you get reproducibility for free (at least in the build environment.) [0] https://github.com/NixOS/nixpkgs/pull/151871/files https://github.com/NixOS/nixpkgs/pull/151871/files
- trulyrandom 5y agoWhat is the proper automated way to get vendorSha256? Currently I always set it to lib.fakeSha256 first, then run the build and obtain the hash from the error message.
- whateveracct 5y agoThat's honestly not a bad way to do it. To speed things up a little, you can evaluate exactly what you need in the REPL to trigger the error. You can even paste the Nix expression with the fake sha in and it'll be quicker than evaluating your entire build. There's probably a CLI out there that fetches it a la nix-prefetch-url/git/etc
- wintorez 5y agoI love the name!
- ireflect 5y agoWhen a name fits a project so well, you have to wonder whether they thought of the name first, and that dictated the project concept. Either way, awesome.
- TekWizely 5y agoLOL I know right! 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
- Maursault 5y agoI sure wish Homebrew would cease being cited as a standard or defacto package manager for macOS. It is a recent development, leaves so very much to be desired while also leaving a mess, boxes permissions, takes its annoying metaphor too far and has no advantage over any other package manager. Why the constant advertisement for adoption? Give me MacPorts any day of the week and twice on Sunday.
- pjmlp 5y agoCall me old fashioned, I just use the UNIX that is already on the box.
- bloopernova 5y agoI'm assuming you're still referring to MacOS? 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.
- pjmlp 5y agoUse Linux to target Linux. Yes I am referring to the certified POSIX userspace on macOS. Portable UNIX software should use POSIX anyway not GNUisms.
- chana_masala 5y ago> takes its annoying metaphor too far It really does!
- Maursault 5y agoI think Homebrew's entire reason for existence is its metaphor, and was possibly developed by alcoholics for alcoholics.
- pxc 5y agoWhen Homebrew was written, neither it nor MacPorts had widespread binary caching by default like they do today. 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.
- chana_masala 5y agoThe name reminds me of the Krazam sketch "Microservices" [1] [1] https://invidious.osi.kr/watch?v=y8OnoxKotPQ https://invidious.osi.kr/watch?v=y8OnoxKotPQ
- grenoire 5y agoI thought it was gonna' query everybody's name-o!
- TekWizely 5y agoLOL Actually one my hopeful future additions is to maintain (or use discovery) a list of name-to-repo mappings. 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.
- mch82 5y agoHow come there is so much fragmentation in package managers? Is the on-boarding experience for dev contributors bad for existing options?
- ErikCorry 5y agoWhat I learned from this article is that it's now a good thing when the package manager you use depends on which compiler was used to compile the program you are installing.
- Spivak 5y agoI mean yeah? Cargo works the same way. You have to bootstrap with something and avoiding a dependency outside your language ecosystem is a good way to ensure that the lifetime of your package manager is as long as the language it supports.
- mch82 5y agoFor single language projects that seems like a clear choice. I’m more curious about multi-language projects… 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/descriptor-format https://backstage.io/docs/features/software-catalog/descript...), the way to go?
- pyjarrett 5y ago> languages without first-class package managers (like Ada Ada has a package manager, which also handles toolchain install across multiple platforms: https://alire.ada.dev/ https://alire.ada.dev/
- siraben 5y agoLooking at bingo’s features, you already get most of them for free in Nix, such as multiple package versions, isolation and naming binaries to what you want. But the key difference is that Nix’s dependency specification is exact, not nominal like in bingo (so two packages of the same version and name but slightly different dependencies wouldn’t be confused in Nix.)
- TekWizely 5y agoThe beauty of Bingo is that it uses Go's built-in project install feature, ie. its as easy as as replacing `go` with `bingo` : $ 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?
- hit8run 5y agoMaybe a bit off-topic but does someone know of a good code scaffold generator for go? Something like rails new, and rails generate?
- halpert 5y agogo mod init touch main.go
- sofixa 5y agoGo generate if I'm understanding you correctly?
- dahx4Eev 5y agoSomething like spf13/cobra?
- tekstar 5y agoIt really depends on what you want to scaffold, but I took a minimal approach and use: https://github.com/boourns/scaffold https://github.com/boourns/scaffold - generates a SQL select/insert/update layer, currently specifically for SQLite. https://github.com/boourns/go-gql-typescript-example https://github.com/boourns/go-gql-typescript-example - an example project using scaffold for the model layer, https://gqlgen.com 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.
- sneak 5y agoFeedback: 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.)
- TekWizely 5y agoGreetings! Thanks a lot for taking the time to look at Bingo. 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 [1]https://github.com/TekWizely/run https://github.com/TekWizely/run
- xena 5y agoI wonder how they are going to handle ABI conflicts in Linux distros or if they even have that as a concern.
- TekWizely 5y agoHi! 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.
- TekWizely 5y ago(I was on xmas vacay so missed the initial post) 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