![]() |
|
![]() |
| All the Nix commands that take an 'installable' can take GitHub URLs. For instance:
That command will download nixpkgs from GitHub, evaluate the `hello` flake attribute, build it (or download it from a cache), and run it.> But to find out what the flake exposes at all, reading the flake (or its documentation) is pretty much necessary. If the flake exposes default packages or apps, then you do not need to provide a flake attribute:
So you can run e.g. Alejandra [1], a Nix formatter, like so:
[1]: https://github.com/kamadorueda/alejandraEDIT: For what it's worth, I think this feature can be useful sometimes, but it does also suffer from the same typosquatting problems as we see in other ecosystems. |
![]() |
| The commit message could have answered that question, but instead, it only repeats what the diff already tells us: "Don't allow special characters in sandbox rule paths". It doesn't explain why, or what's special about the particular characters that it disallows. A better message would have said something like "Prevent certain characters in the path because otherwise ... We need to worry about these specific characters but not others because..."
Even if I wrote this code and knew what it did today, if I come across this it a year from now, I'm left scratching my head: why did I make this change? A real world example of a good commit message: https://github.com/git/git/commit/92fe7c7d42cc941ed70d6fce98... |
![]() |
| They noted that and just assume formulae are trustworthy.
> ... These avenues do not necessarily violate Homebrew’s core security assumptions (which assume trustworthy formulae),... |
![]() |
| I’m a bit puzzled by the wording of this blog post, because it says you’ve worked with Homebrew to do this audit, but your name sounds familiar to me, and indeed if we check Homebrew’s README [1]:
> Homebrew's maintainers are […long list of names…] William Woodruff […] [1]: https://github.com/Homebrew/brew Is there any reason this is not mentioned in the blog post? I don’t think it would make a difference, but just to clarify things. |
![]() |
| There's a bunch of TOB-BREW-n listed - are those like CVE numbers just for this project?
Edit: Oh, it's "Trail Of Bits - homeBREW". But probably still yes. |
![]() |
| I cannot reply to your top comment for some reason, so asking here:
What is your personal recommendation for Mac users? Would you suggest a different package manager and, if so, which? |
![]() |
| My dumb brain had to read it 3 times before realizing that by saying "the findings were not inconsistent with what I'd expect" you meant "the findings _were_ consistent with what I'd expect" |
![]() |
| That’s not necessarily what was meant though.
“Not inconsistent” is more cautious and less assertive. It allows for some ambiguity rather than claiming perfect consistency. |
![]() |
| Thanks for the mention!
I just noticed there's a bug with uninstalling. Probably a parsing issue, they must have changed the output of nix for that (this isn't the first time that happened...) |
![]() |
| So do I ;)
I've had some form of `grep '^#h ' $0` in most of my scripts forever. This one is a purity stunt and doesn't use grep, or anything else: https://github.com/bkw777/pdd.sh (the script itself is of no use to you since it only talks to a piece of hardware) The command dispatcher case statement and all the embedded help is in do_cmd() at 2857, and the help reader is help() at 425 I like their explicit #args vs #help One jank in mine is I have a verbosity level setting which affects most messages, and help() uses it to filter some of the help. Normal verbosity shows only the normal help for the normal commands. If verbosity is set higher, then help() shows more commands. The way that's implimented in help() is extra comments that change the behavior of help() as it's scanning the file from top to bottom. When it hits a '#v 2' it starts only displaying the help if the user has currently set verbosity>=2 until further notice. Later down the file it hits a '#v 1' and starts displaying help again... It works but it feels kind of 70's or assembly.
|
![]() |
| > It works but it feels kind of 70's or assembly.
I mean, this is basically all of Bash lol. A very clever idea that has endured since the 70's but also shows it... And yet we get obsessed with "writing perfect Bash" still. The amazing thing is that there are also old "functional shells" like es-shell https://wryun.github.io/es-shell/ (he still works on this and it is indeed very interesting!) |
![]() |
| Workbrew wraps a vanilla, unmodified Homebrew on Macs running it under a ‘workbrew’ user for user privilege separation and better multi-user support. |
![]() |
| Great that there are people looking into this. I wonder if there would be similar findings were they to perform an audit on MacPorts or the Nix package manager. |
![]() |
| A while back I was trying to understand why Homebrew requires pre-built executables to be installed into /home/linuxbrew. I asked about it here[0]. This requirement basically makes it impossible to use homebrew to quickly install programs on systems where you don't have root, or at least have homebrew already configured (not sure if that would solve it but I assume so).
They pointed me to an example program that would break if not run this way: Facebook's Watchman[1]. It bizarrely (to me) has hard coded paths compiled into it, which force you to run it from specific directories. Would love to understand what's going on here and why you would ever make software work this way. I feel I'm missing a fairly obvious Chesterton's Fence. [0]: https://github.com/orgs/Homebrew/discussions/5371 [1]: https://facebook.github.io/watchman/docs/install#prebuilt-bi... |
![]() |
| That makes sense. The weird part to me is that Homebrew would limit their approach and eliminate an entire class of use cases to accommodate programs that work this way. There has to be more to it. |
![]() |
| My short experience with Watchman (a few years ago) indicates this. It’s pretty clearly only technically open-source, without much regard at all paid to third parties actually using it. |
![]() |
| People like beer but also Homebrew had a cute site and made ports simpler than MacPorts. Turns out complexity was maybe not unwarranted. I was among first adopters of brew but now I port for years |
![]() |
| I just tried 1Password and it refused to start not being in `/Applications`. I've seen this happen with one other app (Secretive), although it doesn't quite refuse to run. I can't remember all the details, but I think it has to do with a limitation in newer versions of macOS, where apps that try to register launchd services can only do so if they live in /Applications rather than ~/Applications. The problem with launching those background services from binaries that live in ~/Applications disappears if you disable SIP. When I first encountered it, it made me wonder if ~/Applications is not really supported on modern macOS. I wish I could find the issue for that but I didn't, when I looked just now. :-\
Oh, here's that issue: https://github.com/maxgoedjen/secretive/issues/77 1Password definitely acts weird for me, to where I kind of wonder if the .app folder is malformed somehow. The version installed in the Nix store actually works fine-- but not if I double-click it or open it with the `open` command. In that case it kinda acts like something is going to launch but then it never comes up. But if I manually invoke `/Applications/Nix\ Apps/1Password.app/Contents/MacOS/1Password` from my terminal, it starts up fine! But when I directly launch that executable from Finder, the application does not start and I see that same message about not living in /Applications printed in the terminal. Idk why 1Password refuses to run from anywhere other than /Applications but that seems to be it's message rather than the operating system's. It's a shame 1Password's Mac app can't run from the Nix store. They clearly have at least one Nixer at the company because they have cool integrations like this: https://developer.1password.com/docs/cli/shell-plugins/nix/ I couldn't even get the Docker Desktop package to build from `brew-nix`. OrbStack in the Nix store died on signature errors, but when I visited Security & Privacy in System Preferences after that, there was a little notice that OrbStack had been blocked from running because it was from an unrecognized developer, with the option to allow it. After being allowed, it seemed to work as normal. Same for Podman Desktop. Why do the signatures for those apps end up getting replaced with this setup anyway? |
![]() |
| For people who don't know, pkgsrc works fine on macOS, the complaint was well made: its not the default.
I use brew, and have used pkgsrc in the past. I could go back for low pain. |
![]() |
| That was probably true in homebrew’s first year. At this point I would be shocked if more than a fraction of a percent of homebrew users have ever even heard of macports or fink. |
![]() |
| On reflection I think you are very probably right. I should have thought more about my origin story before posting.
Once, long ago... |
![]() |
| I did not know about the new directory practice, thanks.
From what their site says it looks like it was done this way to keep ARM native stuff separate from old intel code which can still work under Rosetta. But I don't see any indication homebrew stopped linking system libraries as a matter of course (correct me if I'm wrong). MacPorts makes a point of not doing this. /opt/local is its own universe and dependencies can be upgraded more or less aggressively than Apple's. https://trac.macports.org/wiki/FAQ#syslibs |
![]() |
| IMO, it's just counter to what Apple aspires MacOS to be.
If they would do it all over again, I would bet that they would have wanted to make MacOS be like iOS. |
![]() |
| That is provably false from so many angles.
* Apple has no aversion to Ruby, and on the contrary has multiple developers pushing for it. They themselves had MacRuby, a project that allowed one to create Mac OS X (at the time) applications with Ruby.¹ * The reason there’s even an Xcode command line tools package available officially from Apple is because of Homebrew. A third-party made it first by extracting the necessary bits and then Apple officially supported it.² * There’s a liaison between Homebrew and Apple, who helped during the Intel to Apple Silicon transition.³ ¹ https://web.archive.org/web/20100908131627/http://developer.... ² I know this from a reliable source and it is public information, but it was so long ago it’s hard to find. ³ The official Homebrew Twitter account tweeted about this at the time. I no longer have a Twitter account so can’t dig it up. |
![]() |
| I thought it was clear from my comment that I was suggesting Apple would do it better. Think of how useful something like apt, npm, or pip is, and then realize that MacOS has no in-house equivalent. |
![]() |
| I got sick of Homebrew after a while and tried switching to MacPorts, but it feels like an endless uphill battle when so many packages only offer source and Homebrew distributions. |
![]() |
| I mostly just use Nix, but I also have pkgsrc, MacPorts, and (kinda) Homebrew installed on my Mac.
The only ones with any CLI tools installed, though, are Nix and pkgsrc. |
![]() |
| Can you supply supporting evidence (links etc.) regarding "the author was being extremely upset (...) about not passing a Google interview" and "Homebrew having... weird design decisions"? |
![]() |
| I had to dig it up, I'm talking about this.
https://www.reddit.com/r/google/comments/7l5ibp/max_howell_h... Notably, Howell said: > But ultimately, should Google have hired me? Yes, absolutely yes. I am often a dick, I am often difficult, I often don’t know computer science, but. BUT. I make really good things, maybe they aren't perfect, but people really like them. Surely, surely Google could have used that. And a sensible response from Jonathan Blow to the "binary tree" nonsense: > I hate to say it, but counter to most replies you are getting, I see this as an expected outcome. Inverting a binary tree is not some trick interview question. It's a very basic data structure manipulation, and the ideas involved there are applicable to everything. I probably wouldn't hire someone who couldn't solve this, either. It most likely indicates lack of comfort with (or understanding of) recursion, which is kind of serious. This is not to say that the hiring process is good (I have never experienced it) or that they shouldn't have hired you (quite possibly they should have) but maybe instead of getting mad, take this as a cue that you could build up your data-structure-manipulation muscles a bit more and become better for it -- as that stuff applies everywhere. |
![]() |
| > I personally wouldn't hold that against him (or Homebrew).
No one should hold that against Homebrew. Max was already not part of it when that happened and he does not speak for the remaining team. |
I know it’s not the focus of a code review like this, but I’m interested to hear your views on the general supply chain lifecycle problems inherent to open-source package management platforms. Principally, are vetting processes appropriate to ensure that new formulas refer to the correct source? How does the user gain confidence that their brew update is still referencing a trusted source? What happens when a domain is taken over? How quickly can the team respond to untrusted sources from formulas?
I know these aren’t all Homebrew problems to solve, but they’re important ecosystem considerations.
(These problems also exist in the winget and choco platforms, but less so in commercially supported repos like apt and yum. For me, and many other admins, they are a major concern when it comes to the Windows Store.)
Edit: lastly, in case the homebrew team are watching: an npm-style vulnerability notice would be awesome