Onboarding with an M1

2021-04-1710:48165161authzed.com

My experience starting at Authzed and setting up an M1 MacBook Pro.

This is my first week at Authzed as a software engineer and I’ve been provided with a new M1-based MacBook Pro as my primary development machine. Apple’s new M1 chip has been receiving high praise for being quiet, battery efficient, and performant, so naturally I was excited to use my new laptop. Turns out, I wasn’t the only one excited to start using M1 MacBook Pros…

Thus far, Authzed’s services have been built and deployed on x86-based machines. The Apple M1 is an ARM based system on a chip. If someone were to find a way to build and run our tools and services on an M1, then presumably any Authzed engineer (especially those who have older Intel-based laptops with loud fans) could do their work building software while enjoying all the nice features of Apple’s new laptop. My teammates graciously volunteered me to be that person 😅.

Introducing our application stack

At Authzed, we primarily use Python and Go for our backends,Typescript and React for our frontends, and gRPC to communicate between services. We build containers and deploy to Kubernetes, using Docker Desktop on our development machines. We maintain client libraries in several other languages but this stack is our bread and butter (or rice and kimchi if you prefer).

My first step was to install basic tools: homebrew, git, and docker. Thankfully now that a few months have passed since the M1 launch, most popular tools have added native support. For the few tools that don’t have an ARM build, I’ve found no noticeable difference in performance when run through Rosetta translation. And for the more niche tools, such as my terminal of choice Kitty, I found these compatibility tracking sites helpful:

Note about Docker for Mac: A preview of M1 support was only recently released on Feb 21. All of my tests were run on preview version 3.1.0 but release candidate versions have been posted since the experiences documented here.

Update: As of April 15, the GA release for M1 support is now available in Docker for Mac 3.3.1 and our containers continue to build and run on the latest version!

Next up was installing Python and Go. My initial attempt to install Python 3.8.3 failed with the error:

./Modules/posixmodule.c:9221:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ret = sendfile(in, out, offset, &sbytes, &sf, flags);

Others had encountered this and some used a patch to get v3.8.3 building:

$ pyenv install --patch 3.8.6 <<(curl -sSL https://raw.githubusercontent.com/Homebrew/formula-patches/113aa84/python/3.8.3.patch\?full_index\=1)

I wanted to avoid depending on a one-off patch and found that Python 3.9 builds natively. A quick run of our tests using 3.9 were successful so we were able to upgrade to 3.9 safely. Go added native M1 support in 1.16 so I simply installed the latest, 1.16.2, using homebrew:

$ brew install go

All of our required tools had been installed successfully! So far so good.

Building our services

We use Docker to build containers for our services. Fingers crossed, I ran docker build . in one of our service directories in hopes that it would just work…it did not. Without revealing too much about our internal projects, the build errors fell into 2 categories: missing build dependencies and incompatible binaries.

An example of a missing build dependency issue was attempting to install the grpcio-1.34.0 package. The poetry install step in our Dockerfiles was failing with the error:

	FileNotFoundError: [Errno 2] No such file or directory: 'c++'

This indicated that the docker image was missing a C++ compiler and/or headers. The simplest solution was to change from a slim base image to a more full image.

-FROM python:3.8-slim
+FROM python:3.9

An example of incompatible binaries was attempting to install the psycopg2-binary package. The installation would fail with:

	Error: pg_config executable not found.

I didn’t dig into whether the executable was actually missing or not executable on my machine. Again, the simple solution was to update base images by specifying ARM-specific Docker images.

-FROM node:14.11-alpine3.12
+FROM arm64v8/node:14.16-alpine3.12

After making the above changes to all of our Dockerfiles, voila: our containers built successfully!

One thing to remember: the initial goal was to test whether we could build and run our services for development and testing. A future step will be to set up multi-architecture builds to be able to share x86 builds as well.

Deploying to a M1 MacBook Pro

✅ Tools installed✅ Containers built

❓ Services deployed

Tools are installed, containers are built, but what good are they if I couldn’t run them? I’ll save you the suspense and show that our full application deploys and runs on Kubernetes 1.19.7 through Docker Desktop.

A screenshot of the File sharing setting
Remove directories included by default under “File Sharing”

The result

I set out to find out if Authzed’s tools and services would build and run on a M1 MacBook Pro and after much Googling and some trial and error, I happily reported a simple, “IT WORKS!” back to my teammates.

The first 24 hours using my laptop were filled with video chats, building containers, and Kubernetes running for most of the day, yet it was still going strong with 28% battery remaining. I didn’t hear the fan turn on once and in fact, I don’t think the internal temperature went over 130F even in the middle of builds. (The temp is running at a cool 71F as I write this post).

Safe to say, I think my teammates will be shopping for new MacBooks in the near future.

I’m just getting started here at Authzed but if you’re also interested in these tools and want to help build our fast, flexible, and scalable permissions API, check out our jobs page and join us!

Epilogue

One downside to the M1 MacBook Pros I discovered much too late is that it only supports one external monitor, although there are some workarounds using docks and proprietary display drivers. Despite my idle second monitor, I’ve found the benefits of the M1 MacBook Pro heavily outweigh this one downside.


Read the original article

Comments

  • By clashmoore 2021-04-1711:379 reply

    As mentioned in the epilogue regarding single monitors, I feel that Apple was a little too silent regarding that limitation.

    It also caught me off guard especially as I purchased the LG 4K thunderbolt/usb-c monitors from the Apple website with the hope of connecting everything via daisy chain.

    I haven’t yet definitively found a DisplayLink hub that can output its video via thunderbolt and/or USB-C so whenever I see articles about M1’s and developer setups I happily check in to see if anybody has found a setup.

    • By mistersquid 2021-04-1715:483 reply

      I understand the lack of multi-monitor support in the M1s is an issue. But just after the launch of the M1, I came across a video that demonstrated an M1 Mac mini driving six monitors. [0] There is also a short write up about that workaround, for those who don’t want the video. [1]

      There are similar workarounds for the M1 MacBoooks. [2]

      Is this a reasonable workaround until Apple provides M1 hardware that can run more than 1 monitor out of the box?

      [0] https://www.youtube.com/watch?v=5jLAwSvs7vE

      [1] https://www.slashgear.com/m1-macs-can-run-up-to-six-displays...

      [2] https://www.youtube.com/watch?v=gzPKfn746Zs

      • By n42 2021-04-1719:18

        DisplayLink is a software encoded and compressed video stream that the hardware dongle decompresses on display. The experience is not great on my M1 MacBook Air. Sometimes it doesn't work and I have to plug/unplug, DisplayLink doesn't support refresh rates higher than 60hz, and you have to keep their software running in my task bar for it to work, and there are occasional visual artifacts. If you're planning to use your M1 in a multi-monitor setup, I suggest waiting for Apple to support it natively, especially if you're doing any kind of design work.

        If you occassionally just want to plug in to multiple displays, it can bridge the gap. It's no substitute for a dedicated workstation.

      • By runjake 2021-04-1716:05

        #2 is using a DisplayLink device to run multiple monitors. I presume the other videos do too.

        There's no trick or way around this on an M1-equipped Mac. Something else will be handling the graphics.

        DisplayLink generally works excellent for running most apps. It does not work well where you’re pushing a bunch of bits at the screen rapidly, eg. First person shooters or high definition video.

        That said, one of my DisplayLink monitors is used for IP camera feeds, and while the little traffic light on the USB dongle is blinking incredibly fast, I don’t notice any stutters.

        Everyone already knows about this and the author mentions this in their post.

      • By clashmoore 2021-04-182:07

        I've seen these too, but the LG 4k monitors that Apple sells on their website, and suggests as a display purchase along with the M1, have only Thunderbolt and USB-c IO. All these example setups use monitors with HDMI, etc.

    • By aulin 2021-04-1713:271 reply

      I suffered more about having to trash my perfectly fine fullhd monitor(s) that worked great with linux until the day before, just because they decided to drop subpixel hinting with latest macos versions. Now I need 5-6 times more pixels to get comparable font rendering

      • By eyelidlessness 2021-04-1718:331 reply

        I’m also still mourning the loss of subpixel AA with my primary display being 4k@1x. For several versions of macOS it was removed from the System Preferences UI but still available with a defaults command, but I’m pretty sure that’s gone now too.

        • By aulin 2021-04-187:032 reply

          right, you're not even supposed to use those 4k at native resolution if you want good fonts! some sources still list a couple of manual commands that supposedly enable antialiasing again but I don't think they do anything anymore.

          • By eyelidlessness 2021-04-1815:05

            It’s 43” haha. It has roughly the same pixel density as a 27” at 2560x1440.

          • By ixacto 2021-04-1816:02

            32” 4k on a m1 mini at a scaled resolution of 2560x1440 looks great.

    • By misnome 2021-04-1712:054 reply

      Yes, very silent. We ordered a replacement for my old work machine and only realised that limitation after - too slow to stop the purchase order. We’ve ordered an ultrawide monitor to compensate.

      I feel the “Pro” label is somewhat misleading, and has definitely damaged my trust further.

      • By FroshKiller 2021-04-1713:042 reply

        The specs page for the Pro on Apple's site was up front about this and still is. Check it out here: https://www.apple.com/macbook-pro-13/specs/

        Scroll down to Video Support and see: "One external display with up to 6K resolution at 60Hz."

        When I was making a buying decision back in November, the limited external display support came up in every analysis & review I read. I'm not trying to give you a hard time here, but I genuinely don't know how you missed this.

        • By nsxwolf 2021-04-1713:434 reply

          A lot of people missed it. No one expects features to be removed from the latest and greatest model.

          • By barkingcat 2021-04-1714:293 reply

            It's called wishful thinking with blinders.

            What? The M1 MacBook Pro is not the magical device with no compromises???

            People were way too enthusiastic and purposely skipped over any weaknesses of the form factor.

            People were claiming that it was capped at 16G ram because there were no purpose for having 32G ram (it was amazing to see the hacker news technical set reclaim Bill Gate's "640K ought to be enough for anybody" and "1 monitor is enough for every use case").

            There are no perfect computers. Even Apple has to compromise. They were clearly stated but people just didn't want to accept that the M1 isn't a perfect computer that could do everything.

            • By hobs 2021-04-1714:482 reply

              Apple didnt have to compromise here, but did - they've definitely sold customers on the "everything just works" approach, and so updating those details and then expecting all the customers who were literally sold on the concept of not having to check on all the details to check them... interesting approach.

              My mother bought a new macbook m1 with me telling her about the monitor stuff and she cant even get her 1080p normal external to work with the dock that the apple store sold her.

              • By supermatt 2021-04-1714:55

                Take the dock back. I’ve tried 4 or 5 different ones, and the only one that was any good is the caldigit ts3+. If it’s not DisplayPort/usb-c video output then the dock is using some converter internally that messes everything up.

                It’s definitely an Apple issue, but the specific problem can be worked around by basically not using hdmi (I appreciate we don’t all have that luxury :/)

              • By barkingcat 2021-04-1715:19

                This is an extremely entitled viewpoint. I'm not sure which "Apple" you are talking about, but as far as my experience has been for the last 20 years of Apple computers, Apple is the king of forcing consumers to compromise.

                Do you want 256G ssd size or do you want the upgraded processor or memory size? Do you want 2 usb-c ports or 4 usb-c ports? do you want touchbar or no touchbar?

                Apple has market segmentation and compromise down to a science. Apple computers have been forcing people into a compromise for their entire history. Want more features? Give more money. need that money for rent? ok buy the 256G version instead that you can't upgrade because everything is soldered in.... you have more money? pay for 512G version.

                And in the dock's case - that's always been the case where apple will happily charge you more money to get certain accessories to work properly. (want this accessory to work? you gotta get the right adapter! oh that old adapter won't work, you gotta get a new one for 80$! oh sorry even with an adapter that old dock won't work anymore, you gotta get the right interface! usb-c vs thunderbolt vs firewire vs usb-c 4!)

            • By supermatt 2021-04-1714:484 reply

              I’m not aware of anyone (except those using VMs) who are complaining about the memory. I personally went from 16gb to 8 and don’t miss it. Do you actually own/use an m1 Mac?

              • By eertami 2021-04-1715:542 reply

                If it works for you, it works for you.

                However in 2021 I am not interested in a computer with less than 32GB ram. Sure, I could work around the limitations and close not in use programs/tabs to avoid going OOM, or using swap, but life is short and memory is cheap. I'd rather not have to worry about it.

                • By fiddlerwoaroof 2021-04-1716:591 reply

                  I was similarly skeptical, but my old laptop died on me so I had to replace it. My M1 MacBook Pro is a better laptop for me as developer: my 16” 2019 MBP with 32GB of RAM I got from work has performance and memory issues (mostly too many open browser tabs) more frequently than my personal M1 laptop.

                • By supermatt 2021-04-1716:04

                  So why did you buy one?

              • By barkingcat 2021-04-1715:121 reply

                Yes I am using one.

                There are workloads that don't fit into 16G ram. Even with paging, there are legitimate needs for 32G and beyond memory sizes.

                • By supermatt 2021-04-1716:092 reply

                  What specific workloads? If you bought a 16GB machine to keep 32GB of data in RAM then clearly you bought the wrong machine. But I am able to run WAY more applications in 8GB than the 16GB intel Mac I had previously.

                  • By rovr138 2021-04-1717:401 reply

                    > But I am able to run WAY more applications in 8GB than the 16GB intel Mac I had previously.

                    Then your limitation clearly wasn’t RAM.

                    • By supermatt 2021-04-1719:521 reply

                      Memory management is different on the M1. This has been widely discussed.

                      • By rovr138 2021-04-1721:231 reply

                        "management" is important.

                        It can't make it appear out of thin air. If you need 16GB of ram and only have 8GB, you will run out of memory.

                        • By supermatt 2021-04-1819:26

                          Which is why I asked for specific workloads in the comment you decided to reply to. I also say in the same comment this very thing you are reiterating...

                  • By vondro 2021-04-197:20

                    It can swap to ssd real fast.

              • By dijit 2021-04-1721:161 reply

                I am not using VMs (unless you count the JVM or something) and I regularly exceed 16GiB of ram. I offloaded my docker VM to another machine because it was so bad.

                For context I regularly have open (what I consider to be standard apps):

                * IntelliJ IDEA (Pycharm or Clion, never both)

                * Slack

                * Chrome

                * kitty (20 or so terminals)

                * Outlook

                * yabai & bartender

                * littlesnitch & adguard

                • By superchink 2021-04-1722:24

                  Have you gotten yabai to work on the M1?

              • By smoldesu 2021-04-1720:471 reply

                I have an M1 Macbook Air with 8 gigs of memory, and it's definitely a bottleneck for me. I haven't even thought about trying a VM on it...

                • By megablast 2021-04-182:431 reply

                  In what way? I run xcode, firefox, safari, gimp, mail and a few other things. It is so much better than my last 16gb macbook pro. And this is an air.

                  • By supermatt 2021-04-196:12

                    Same here, i am running intellij IDEA, 3 vscode instances concurrently - all autobuilding on change. I also have 2 ios simulators and an android simulator running, as well as chrome, safari (with MANY tabs) and Firefox. Mail, slack, QBServe, Datagrip and affinity designer also all running. The machine is fully responsive, flicking between apps, running both the internal display and an external 43" 4k monitor.

                    The ONLY time I run out of memory (or leave the "green" memory pressure) is when i use Figma - but that is a known memory hog. And it does crash, it just warns me that im running out of memory and asks to close something.

                    This is all on an 8GB machine. Previously I had 16GB intel macbook pro (2015) and it simply wasn't possible to run this quantity of applications.

                    Obviously (as i have said, and keep getting downvoted for), if you are using VMs or you have a specific memory requirement, then you need to account for that.

            • By NetOpWibby 2021-04-1715:57

              Thank you

          • By Tagbert 2021-04-1715:51

            These first M1 models replace the very low end of the MacBook Pro line, not the full line. They replace the versions with the slowest processor and only two USCB-C ports. That is why the rest of the MacBook Pro line still exists waiting for the next performance version of the M-series chips.

          • By tasogare 2021-04-1714:19

            Looking at the number and type of ports is a pretty good indication that features are being removed. I love the 2015 form factor: retina, good keyboard, thin enough, 2 USB-A, 2 Mini-DisplayPort, 1 HDMI, jack, SD card port, MagSafe. I wish a M1 model with an equivalent enclosure would be produced.

          • By FroshKiller 2021-04-1713:582 reply

            No one expects a brand-new hardware platform to have different capabilities from other devices in its class?

            • By numpad0 2021-04-1714:02

              A lot of people weren’t aware that multiple displays through single DisplayPort connector is hardware, not software, capability

            • By e-clinton 2021-04-1716:521 reply

              It’s not “brand new hardware”, it’s just another MacBook Pro. Being a MacBook Pro, I expect a keyboard, trackpad, screen... and the ability to plug-in monitors, just like every other MacBook Pros has for however many years.

              They shouldn’t have called it a pro.

              • By brokenmachine 2021-04-193:56

                The logic of a 𝚃̶𝚛̶𝚞̶𝚖̶𝚙̶ Apple supporter: "He didn't say that. And if he did, he didn't mean that. And if he did, you didn't understand it. And if you did, it's not a big deal".

                Apple apologists have been regularly redefining what "pro" means every year, along with a lot of other things that aren't a big deal.

      • By themolecularman 2021-04-1720:21

        Same here. Even right now as a type this I have my 2nd external monitor sitting next to the one I'm staring it, it's just off though.

        Another commenter mentioned finding a video showing that it could in fact be "hacked" to use more than one external monitor. I tried purchasing the specific DisplayLink products in the video and still wasn't able to have success :(

      • By pmarreck 2021-04-2514:38

        FWIW I've been quite happy with a UWQHD ultrawide for both work and play

      • By Tagbert 2021-04-1715:57

        If you get the ultra wide and have trouble getting the resolution setup you might need SwitchResX. It let’s you override the default resolutions with custom ones. Some of the ultra wide monitors support resolutions that are not expected in the default setup.

    • By Closi 2021-04-1711:423 reply

      Agreed, as an M1 user and usual multi monitor user this is a big limitation!

      Realistically I’ll look at investing in an ultra wide soon to offer similar screen real estate.

      We also have a Lenovo laptop that we bought two of for our admin staff in our office to only find out afterwards multi monitor support was missing (despite having enough ports for it)... it’s a shame that this isn’t considered standard.

      • By MobileVet 2021-04-1711:561 reply

        This was such a pain... we tried several combos and dongles. In the end we found this to work for driving the 2nd monitor.

        Startech Dual Display Port adapter https://www.amazon.com/gp/product/B07C69HG33/

        We have noticed that the refresh rate on the second monitor isn’t great... but it works and isn’t horrible for developers.

        Edit: and we also have this due to the lack of ports (Thanks Jony)

        HyeperDrive USB C Hub https://www.amazon.com/dp/B01MUAEI7J/

        • By waheoo 2021-04-1713:21

          +1 for startech. Thunderbolt should be able to drive dual 4k at 60. Haven't used with the M1 but have with ThinkPads.

      • By wslh 2021-04-1713:392 reply

        That is why I think Dell XPS 13 is top: three external monitors via a Thunderbolt TB16 and a desktop experience only plugging a single cable.

        This is not to say that the XPS 13 is perfect (need to change battery every two years in all the notebooks at the office and the notebook gets hot) but the notebook is great in many other factors.

        • By dijit 2021-04-1714:002 reply

          FWIW (and, anecdotally); my company just started rolling out XPS 13's and had to stop as they are overheating constantly.

          Instead, people are going to be getting latitudes.

          • By andrewmackrodt 2021-04-1715:42

            I have the XPS 13 2-in-1 and the thermals under Windows leave a lot to be desired. It's possible to apply a small undervolt and increase the Intel turbo limits which significantly improves performance while being able to run with the balanced fan profile. If anyone wants my ThrottleStop config I can upload it to pastebin.

            I run Ubuntu day to day and it has much better performance and less fan noise (presumed better thermals) than Windows.

          • By tinco 2021-04-1722:02

            Our product has a webgl component, and the XPS13 would constantly crash Ubuntu when the webgl view was open. It was so unworkable the developer switched to windows with WSL2 just to have a stable environment.

            Which is annoying because the whole reason I was buying XPS laptops for our devs was supposedly good Linux support. Maybe the laptop was overheating?

        • By ClumsyPilot 2021-04-1811:19

          I have given up on 13" laptops for performance demanding work, you just can't stuff cooling into that package.

      • By rainbowzootsuit 2021-04-1712:031 reply

        Perhaps a EGPU via thunderbolt would work? (Not that GPUs are so readily available right now, but just to get N monitor ports as needed offloaded) Have you investigated that at all?

        I recently ran into something somewhat similar of needing "active" displayport adapters to connect more than two monitors at a time to a video card.

    • By rvz 2021-04-1715:392 reply

      > I feel that Apple was a little too silent regarding that limitation.

      That's the whole point. It's about what Apple doesn't tell you that matters, which I have said before [0]. Especially for a new product announcement and release, which is why I don't immediately buy their products because everyone else is hyping it everywhere.

      Now they are discovering the pitfalls and foot-guns later on after purchasing it, whilst I enjoy my trusty old Intel Macbook that can connect to more than one monitor.

      I guess when Apple announces a M1X / M2 Macbook, the reviewers will be telling you that 'It's not worth buying if you already bought into M1'. If that's the case, they are right, since you're now at a sunk cost IF you wanted multi-monitors on your M1 Macbook Air.

      What's better is that you wait for the next generation so that you don't fall for buying into Apple's limitations in their new products.

      [0] https://news.ycombinator.com/item?id=26327064

      • By rgbrenner 2021-04-1715:48

        They did tell us though. It’s listed on the tech specs: one monitor on the m1 laptops; 2 on the mini. That’s why I bought a mini.

      • By clashmoore 2021-04-182:06

        If I could describe why I've been an Apple laptop user since their Powerbook days, it's because I didn't want to worry about fiddly computer setups and stuff - just purchasing a machine that works and an afternoon to get my environment up and running (for dev).

        In all my previous experiences, purchasing into newly released products has always been a step forward in every measurement. I would say dongles have been the only pain points when moving to new generations.

        This is the first product that took a step back in an important way and I wasn't expecting it. And it doubly hurt me as Apple's website store suggested these LG 4k monitors to go along with my new M1 and their store showcased the awesome thunderbolt daisy chain and driver support out of the box.

        So while DisplayLink technologies do allow for an inferior multi-display setup - I haven't found one yet to drive dual LG 4k monitors that Apple sells.

    • By Nextgrid 2021-04-1712:232 reply

      If your objective is to use two monitors side by side, couldn't you find a device that presents itself as an ultra-wide monitor (combined width of both monitors) and allows you to connect two monitors on the other end?

      • By MertsA 2021-04-1714:23

        No, that'd be a problem with the dock and menu bar straddling the two monitors. Not to mention maximizing a window would split it between monitors.

      • By hpoe 2021-04-1713:58

        Couldn't the newest generation of a device not remove what are considered standard features from their device especially when it costs more than anything on the market and it's big selling point is that it "just works"?

    • By Stratoscope 2021-04-1722:29

      I wonder if the single monitor limitation is a hardware or software issue?

      The reason I ask is that my ThinkPad X1 Extreme can only handle a single external monitor running any recent version of Ubuntu, but on Windows 10 I run it with two or three external monitors with different scaling factors. I've used either a ThinkPad Thunderbolt dock or currently a Cable Matters mini-dock with two DisplayPorts and one HDMI.

      So I gave up on Linux on the hardware and run it in a VMware VM under the Windows 10 host, or under WSL2 depending on what I'm doing.

    • By hedgehog 2021-04-1716:20

      There are also compatibility issues with ultrawide monitors and DDC support is missing (so there's no way to do brightness or volume for external displays). The new machines are still better for most people but as always evaluate before upgrading.

  • By tastyminerals2 2021-04-1715:5112 reply

    I always wonder why ppl do not use MacPorts? There was a great article on HN which basically drew a pretty clear picture how brew can easily mess your system up. Yet, being a new Mac user, wherever I go, I only see a reference to brew installs. I am using M1 for a over a month and it’s been a very smooth ride so far. Installing everything via MacPorts where I only had an issue with rabbitmqd which failed to build because of erlang.

    • By havernator 2021-04-1716:033 reply

      I switched to Brew back in... oh, 2012 or 2013, I think, because I was sick of MacPorts breaking itself horribly during normal operations (installing/uninstalling) every 3-6 months. Brew’s huge package selection, rare breakage (sometimes on OS upgrades, usually easy to fix), decent UI, and ability to also manage nearly all the closed-source software I install, have kept me from bothering to look at MacPorts again.

      • By rcthompson 2021-04-1717:25

        I had a similar experience. I started out with macports, which seemed more familiar to me as a user of Linux package managers. But macports kept breaking in weird ways, until I finally tried homebrew, which didn't break. That was years ago, so maybe macports is better now, but homebrew has never given me a reason to switch away from it.

      • By anaerobicover 2021-04-1717:341 reply

        I have completely the opposite experience; brew would screw something up every other time I upgraded a package, and didn't cross OS updates very well at all. MacPorts has been rock-solid, possibly because it is more careful about making sure that ports have exactly the right deps.

        • By havernator 2021-04-1717:411 reply

          Weird. Macports is the one I was always having to edit packages for to un-break them, with a totally normal installation. Seemed like their packages were poorly-maintained. Must have gotten better I guess.

          • By kergonath 2021-04-1721:38

            I think this might have changed a bit over the years. I can’t remember last time I had to tinker to build a port. But you’re right, it wasn’t uncommon around 2010.

      • By kitsunesoba 2021-04-1717:18

        Similar here. I'm sure MacPorts has improved since then and I should probably give it a spin next time I have a fresh macOS install, but back in the late 00s and early 10s not only did I have issues with it breaking itself, but also constant issues with packages not compiling/installing, or if they did crashing due to some dependency issue.

        At that point in time I was a lot less technically capable, so on the rare occasion googling the issue would turn up a relevant mailing list archive, I usually wasn't able to act on it and I'd wind up procuring the package in question through some other method or just doing without.

        So when Homebrew came along and most things installed and ran fine with the rare issue that cropped up getting fixed fairly quickly, it easily stuck.

    • By lucideer 2021-04-1717:191 reply

      I switched from brew to macports recently, so here are my thoughts:

      - before, I had generally heard of homebrew a lot, and macports very little. Brew's marketing is better. I think this is intentional (as in Macports doesn't really do any)

      - The docs for macports are very poor. They are comprehensive, but barely navigable. Keyword search doesn't work well. They're obtuse.

      Further context: I also find brew docs poor, but they're much more user-focused (how to install packages), whereas macports' seem more packager-focused.

      - Requiring sudo is a security feature, but Macports doesn't advertise this well, so brew "seems" more secure on first impression

      - Most software with cli install instructions recommend brew up top (even when there's a macports option). i.e. there's no evangelization of macports by maintainers who package for it. I don't really know why this is, but it's something macports maintainers could/should look into.

      • By SkyMarshal 2021-04-1717:382 reply

        Interesting observations. Why does Brew seem more secure on first impression?

        • By lucideer 2021-04-1721:13

          As the sibling mentioned, using sudo gives the process root, with the implication being it has full access to your system and can potentially do a lot more damage. Extend this to any arbitrary installer you're running and it becomes scary. So brew's sudo-less model seems more secure in this context.

          In reality however, macports uses "privilege separation" which drops privileges for each individual install to a separate "macports" user. This is more secure than brews sudoless approach because not only does the installer not have root access, it doesn't have full access to your own user either (e.g. your HOME). Privilege separation isn't possible without initially having root privileges.

        • By eyelidlessness 2021-04-1718:22

          Because not using sudo implies you’re not giving anything escalated privileges. I’m aware there’s a contrary view (which I can’t recall, but will dutifully refresh my memory after I post this answer) but this reasoning still feels more intuitive to me.

    • By fiddlerwoaroof 2021-04-1716:43

      I switched to brew because it goes out of its way to avoid breaking your system. I recently gave macports another try and the experience involved editing Portfiles over and over again to try to get applications to work.

      The most common complaint (changing permissions on /usr/local) isn’t a problem with the arm64 version which now uses /opt/brew but, also, as far as my trust model goes, it isn’t a problem for me: I already have $HOME/bin on my path and, so, any local exploit that relies on overwriting system executables has multiple ways of tricking me into running a malicious program.

    • By kergonath 2021-04-1721:35

      I’ve been using Macports for years, trying Homebrew every now and then without finding a good reason to jump. From my point of view Homebrew would need a serious advantage to overlook the issues caused by its architecture. I also like the fact that Macports builds are (mostly) deterministic because they depend on as many tools from Macports as possible, and not moving target frameworks from the OS itself.

      Homebrew was the cool new kid at the right time, when Macs popularity amongst webdevs was growing exponentially. OTOH, Macports is still working fine; there is room for two package managers on macOS.

    • By asimpletune 2021-04-1716:051 reply

      Or for that matter I’m looking forward to learning more about nix which promises sort of the holy grail in these matters

      • By samatman 2021-04-1721:371 reply

        I tried using nix on a Mac, because I really respect what they're trying to do and it seems like a "right thing" kind of platform which I want to support.

        I wasn't able to get it to work, and it left a bunch of users (like ten??) and other various junk which was a pain to clean up. This was in 2017 I think.

        I keep hoping someone will chime in and say "I use nix on my Mac, and it's dreamy, everything Just Works you should try it!" because until that happens I'm going to stick with brew.

        While I'm on the subject, I was also a macports user until hmm, 2013 I think. Don't recall exactly why I switched, just that I was having some kind of intractable problem, messaged a friend who knows what he's talking about, and he said "just use brew dude". So I did.

        • By bobbylarrybobby 2021-04-1723:32

          I use nix on my Mac, and it's dreamy, everything Just Works you should try it!

          Well, it works now that I've set it up. But the setup is not exactly trivial. Here are the steps I used last time I set it up, a year or two ago, to get a single-user install working:

          ```bash

          sudo vim /etc/synthetic.conf

          # Insert the following line in vim (the file should be three bytes long):

          nix

          # Save and exit vim

          echo "LABEL=Nix /nix apfs rw" | sudo tee -a /etc/fstab

          # Reboot computer

          sudo diskutil apfs addVolume disk1 APFSX Nix -mountpoint /nix

          sudo diskutil enableOwnership /nix

          sudo chown -R "$(whoami)" /nix

          # Reboot computer

          sh <(curl https://releases.nixos.org/nix/nix-2.3.10/install) --no-daemon ```

          So not exactly pretty, but it works. And it works great. Nothing every breaks -- installations/updates may fail, but they leave the previously working version in place so that everything works as if I hadn't tried to install/update in the first place. I wouldn't want to have to set it up again, but now that I have, I don't want to use anything else to manage my packages.

    • By novok 2021-04-1718:48

      I was using macports before brew really existed and switched over the brew because you didn't have to waste time compiling everything all the time and dealing with breakage. The CLI was also much nicer to use with little bits of whimsy.

      Brew was a big timesaver back then (maybe now too if macports is still in 'compile everything' mode) and that is the key reason why it became the dominant package manager. Nobody has 'moved back' because macports isn't 'better enough' to induce people to switch over like they did with brew originally.

    • By jdonaldson 2021-04-1717:341 reply

      Homebrew starts from the MacOS CLI apps provided through XCode. It's a usermode package manager built on top of XCode components. MacPorts builds everything from scratch, which grants more power and optimization opportunities, but comes with many, many more rough configuration edges to deal with.

      The optimization opportunities for some packages are typically on the order of 2x-5x faster, which isn't enough to deal with the headache of extra config for a personal dev box. So, my rule of thumb is, unless I know exactly the performance trade off I am trying to take advantage of by going with MacPorts, I will be better served by using Homebrew. I will wind up spending more time fixing config then I will have saved on execution processing time.

    • By rubyn00bie 2021-04-1720:09

      > failed to build because of erlang.

      That specific issue sounds like a MacPorts problem where it (MacPorts) is using an outdated version of Erlang; because Erlang works just fine on the M1.

    • By otterley 2021-04-1717:23

      I think the reason is simply that Homebrew works fine for most people, including myself. I too have an M1 Mac and had no problems with it, although this may be a reflection of significant improvements made in Homebrew related to Apple Silicon in the past few months. That's the thing about software: things that break today can be fixed the next (or, worse, vice versa).

    • By IshKebab 2021-04-1813:05

      Brew has more packages and is more popular so stuff is more likely to be available and more likely to work. I rarely have issues with it though I do wish it wasn't so slow and good luck trying to uninstall something.

    • By Toutouxc 2021-04-1717:331 reply

      For me it was that I heard about Homebrew first, installed it, never had any problem with it. So, marketing?

      • By eyelidlessness 2021-04-1718:30

        Not necessarily even marketing. It’s also just the de facto Mac package manager most commonly mentioned in docs/READMEs for Mac install instructions. This is probably more a matter of convenience than anything, and anyone using other package managers can easily mentally map the instructions to their own usage.

    • By atkbrah 2021-04-1718:12

      I've always considered macports/brews as last possible solution for problems on macos because you eventually end up with broken system. Luckily you can run most of the stuff on a remote linux with containers.

  • By f6v 2021-04-1712:311 reply

    M1 is such a smooth ride. I didn’t expect everything would just work. I use R and Python for computational biology and didn’t have a single issue with installing packages.

    • By vetinari 2021-04-1713:521 reply

      Did you try pandas? Anything that requires cffi?

      • By f6v 2021-04-1714:451 reply

        Pandas works fine for me. But it’s a moderately sized data, below 100k rows. Dask works as well, though I can’t judge the speed.

        • By Jcowell 2021-04-1715:092 reply

          How did you install pandas without any work around? (Mini forge, building from source, making a Rosetta terminal)

          • By stu2b50 2021-04-1716:461 reply

            (Not OP btw)

            While I'm not sure if it's building from source or pulling a binary, just pip3 install pandas seems to work just fine. Not a Rosetta terminal.

            Just ran a fresh install from a new poetry venv, seemed to work fine. This was the poetry output

            Using version ^1.2.4 for pandas

            Package operations: 3 installs, 0 updates, 0 removals

              • Installing numpy (1.20.2)
              • Installing pytz (2021.1)
              • Installing pandas (1.2.4)

            • By vetinari 2021-04-1719:181 reply

              Since there's no arm64 binary on pypi, it downloads source and builds locally.

              For some reason, the pip building is failing for me (python@3.9 from homebrew, all non-brew packages in --user). However, if I download the source and do the bdist_wheel manually, it succeeds and produces installable wheel.

              Cffi is unbuildable without a patch, it is failing on symbol ffi_prep_closure being non-existant.

              • By stu2b50 2021-04-1720:18

                Huh. I haven't had any issues with libraries that use CFFI.

                I've had issues with pip and building from source being incredibly fragile before (in general, not an M1 specific thing), so I'm not that surprised, but unfortunately I don't really have any answers here.

                The scientific calc package + cffi have installed normally since I got the M1 (mid February).

                I did have an issue with PyQt5, where I had to link qmake in my .zshrc before it would build properly (and it had an incredibly unhelpful wheels error message), but that's been it so far.

          • By f6v 2021-04-1717:19

            I just used conda and it sort of get installed? I don’t remember any issues around it. My only observation was that conda resolved dependencies lightning fast compared to MBP 2019.

HackerNews