bitprophet,
@bitprophet@social.coop avatar

What's the 2024 state of the art for local macOS+arm64 development nonsense?

Without spending TOO much time combing my (halfhearted because I've been developing via headless Linux since 2020 & it's actually very nice) notes, the last I recall hearing is:

  • Homebrew still "is what it is” & its entire world has since been updated for arm64?
  • Actual-Docker works now, but still via a (Virtualization.framework? emulating Intel??) Linux VM?
  • ISTR other non-Docker VM/container tools exist?
  • ???
Elucidating,
@Elucidating@mastodon.social avatar

@bitprophet I don't think "actual docker" works.

bitprophet,
@bitprophet@social.coop avatar

@Elucidating like, it's not even a thing, or just, it's bad? because obviously it's bad.

Elucidating,
@Elucidating@mastodon.social avatar

@bitprophet Using docker on OSX is like installing a battery assassin.

bitprophet,
@bitprophet@social.coop avatar

@Elucidating is this because the docker client and/or server components just generally run like shit, or because it requires running a VM in the background?

Eg, if one were to use say Colima + containerd, is that better on the battery, or nah?

daaain,
@daaain@fosstodon.org avatar

@bitprophet @Elucidating Docker still runs in a VM, but it keeps getting a better virtualisation framework every couple years, so runs much better now.

Also, ARM64 support in Linux got much better, so you can actually compile a lot more stuff natively, or if you're lucky even get precompiled binaries in packages!

That said, emulation of AMD64 via Rosetta 2 does work, but it's really slow, so to be avoided as much as possible, but useful to be able to quickly check if an image works.

bitprophet,
@bitprophet@social.coop avatar

@daaain @Elucidating thanks! can you expound a bit on the 'better virtualisation frameworks over time' angle? I thought the native Virtualization.framework (or w/e it's called) was the only serious game in town, with other options still using the same low level guts and having a more experimental UI, as well)

daaain,
@daaain@fosstodon.org avatar

@bitprophet @Elucidating yes, I meant actually using the latest Apple provided Virtualization.framework rather than earlier Hypervisor / HyperKit, VirtualBox, etc. But also, VirtioFS which mostly solved file system woes.

Honestly, having Docker and a container running doing nothing doesn't really add any extra CPU load. Of course you still wouldn't want to run stuff like LLMs in Docker because you can't benefit from Metal, but for a web server and a database it's perfectly fine.

Elucidating,
@Elucidating@mastodon.social avatar

@daaain @bitprophet even with that feature it just halves battery life though.

My lousy framework+linux battery life exceeds a modern M3 Air if I run a docker container that just leaves a socket open.

daaain,
@daaain@fosstodon.org avatar

@Elucidating @bitprophet I haven't really noticed that much power draw from idle Docker, but just checking OrbStack recommended elsewhere in the thread and they actually measured the draw to be 123mW which isn't terrible: https://docs.orbstack.dev/benchmarks#power-k8s

Elucidating,
@Elucidating@mastodon.social avatar

@daaain @bitprophet This methodology is ridiculous and irrelevant because it doesn't measure overall draw.

Even trivial loads can increase power draw substantially because of how the kernel reacts to them.

daaain,
@daaain@fosstodon.org avatar

@Elucidating @bitprophet I was talking about power draw when idle as most of the stuff I work on isn't complicated enough to be doing much work without file system changes or requests, but I can imagine that any substantial work inside Docker vs natively can be very different, so depends a lot on the use case.

For me the bottom line is, running browsers with multiple tabs and an IDE will have much bigger impact than Docker vs native so it's not my greatest worry.

blaise,
@blaise@fosstodon.org avatar

@daaain @Elucidating
Fwiw,
(and I acknowledge a certain level of privilege)
I bought a used server for $300; 128G ram, 20/40 Xeon cores, and I used it for builds and docker images, to extend battery life. 🤣
@bitprophet

bitprophet,
@bitprophet@social.coop avatar

@blaise @daaain @Elucidating At the moment I'm exploring all this for dayjob reasons, which is Mac/Win only, alas! (I.e.: granting work credentials to a personal Linux box likely Not Okay. Maybe later?)

bitprophet, (edited )
@bitprophet@social.coop avatar

Related to above question, tangents:

env management. I’m told PDM is current state-of-the-art, Hatch also good, uv if you're not allergic to VC money, Poetry if you can stomach its bug surface, or the evergreen "just use pip-tools”.

Or use a polyglot tool like mise (fka rtx) or asdf (or haha-only-joking-unless, Determinate System's installer + flakes).

Also curious about on macOS arm64, even though that's getting ahead of myself.

offby1,
@offby1@wandering.shop avatar

@bitprophet For my part, leaving aside our permanent emacs vs Vim differences:

  • homebrew is still "the way" to get most software. V4 is much improved over the original and it's generally pretty good
  • docker is good, so is colima. I use docker.
  • python env management -- these days, I'm using mise, I'd been using asdf for years.
  • pdm and hatch are okay, but I don't use env management wrappers; uv is even snazzier. All are fine.

Caveat: my brain and nix do not work together, so I avoid nix

bitprophet,
@bitprophet@social.coop avatar

@offby1 ah yea, Colima is one of the tools I knew I'd heard of but didn't seem to have in my notes anywheres, thanks! Sounds like it's basically the same VM-host approach Docker Desktop uses, except, it's not by Docker and it's open source?

offby1,
@offby1@wandering.shop avatar

@bitprophet roughly, yeah; I think any "docker on mac" is going to be VM-ish; you can't really avoid it because the host OS doesn't have the Linux kernel.

bitprophet,
@bitprophet@social.coop avatar

@offby1 of course, I was just quietly hoping that the last 4-5 years saw some sort of actual migration to “oh we can run vaguely container-shaped things on macOS arm64 directly now”, but no, of course not 🤣

hynek,
@hynek@mastodon.social avatar
raiderrobert,
@raiderrobert@mastodon.social avatar

@hynek @bitprophet @offby1 what was that url again? I didn't hear you the first time 😅

ghickman,
@ghickman@mastodon.social avatar

@hynek @bitprophet @offby1 cosigned. It’s so great, I don’t ever have to think about whether its updates will work.

hynek,
@hynek@mastodon.social avatar

@ghickman @bitprophet @offby1 It’s such a weird thing to be excited about yet here we are

offby1,
@offby1@wandering.shop avatar

@hynek @ghickman @bitprophet The bar is extraordinarily low.

hynek,
@hynek@mastodon.social avatar
hynek,
@hynek@mastodon.social avatar

@offby1 @bitprophet YOU TELL ME NOW YOU’RE NOT USING ORB!?!? Call Helen to pick me up at the SEA Centurion lounge pronto!

offby1,
@offby1@wandering.shop avatar

@hynek @bitprophet Dude, I don't even know what ORB is. Is it this?

hynek,
@hynek@mastodon.social avatar

@offby1 @bitprophet I NEED URGENT AIRPORT PICKUP whole body twitching

glyph,
@glyph@mastodon.social avatar

@hynek @offby1 @bitprophet he's convulsing and screaming so I assume ORB like as in CORBA, that's the main place I've seen that sort of reaction to an ORB

hynek,
@hynek@mastodon.social avatar

@glyph @offby1 @bitprophet speaks in tongues

bitprophet,
@bitprophet@social.coop avatar

@hynek @offby1 Hynek, we already know you speak some weird mashup of German/Czech/English!

hynek,
@hynek@mastodon.social avatar

@bitprophet @offby1 That není Wahrheit!!!

mpirnat,
@mpirnat@mas.to avatar

@offby1 @bitprophet Colima fucks up my work laptop less than Docker ever did, FWIW, so I’m pretty happy with it.

daaain,
@daaain@fosstodon.org avatar

@bitprophet after suffering with a lot of these tools and Poetry seemingly generating a new failure mode every few months, I concur with these article series (just use venv, pip and python -m): https://www.bitecode.dev/p/back-to-basics-with-pip-and-venv

bitprophet,
@bitprophet@social.coop avatar

@daaain Literally what I've been doing on top of NixOS the last 4 years for personal kit 😂 Nix for the interpreters, -m venv and my old reliable pip shell aliases and requirements.txt’s…

That said, the hygiene of the Cargo/Poetry/etc approach - or at /least/ using pip-tools for a lockfile - is increasingly table stakes.

daaain,
@daaain@fosstodon.org avatar

@bitprophet ah, you mean like generating a comprehensive requirements.txt with all the subdependencies pinned too? https://adaptiware.company/en/blog/how-to-lock-requirements-using-pip-tools/

bitprophet,
@bitprophet@social.coop avatar

@daaain basically, though having distinct "acceptable versions" (requirements,txt) and "exact versions" (lockfile) files can be handy in some situations.

daaain,
@daaain@fosstodon.org avatar

@bitprophet I got let down by too many libraries not following semver so routinely pin everything and then use Snyk and other SBOM scanners to let me know if a library has a CVE and needs to be patch updated. In other words, the only acceptable version is the known working one 😅

bitprophet,
@bitprophet@social.coop avatar

@daaain a completely legitimate viewpoint! Thus why I said the separation makes sense /sometimes/ 😂

tek,
@tek@freeradical.zone avatar

@bitprophet I like Poetry, with pyenv for maintaining multiple pythons. I’ve been playing with mise recently but don’t see it as a poetry replacement (yet). There’s Armin’s rye if you want to play with something that intends to do All The Things.

bitprophet,
@bitprophet@social.coop avatar

@tek Looks like uv has absorbed rye, for better/worse, FYI

nebucatnetzer,
@nebucatnetzer@emacs.ch avatar

@bitprophet I personally use Nix + Poetry.
I like the way Poetry manages dependencies(groups and lock files) and it works with Renovate Bot we use at work.

PDM would make sense because of the one PEP but last I checked Renovate didn’t support it.

bitprophet,
@bitprophet@social.coop avatar

@nebucatnetzer so do you mean poetry2nix, or simply "nix for the interpreter and poetry on top"?

nebucatnetzer,
@nebucatnetzer@emacs.ch avatar

@bitprophet At the moment just the latter. However I probably have to look into the former as well when I want to build container images.
I already tried but it is a bit of a pain depending on your dependencies you have to write a lot of overrides.

bitprophet,
@bitprophet@social.coop avatar

@nebucatnetzer yea I’ve heard mixed things about poetry2nix (if also that it’s currently the least-bad option if one seriously wants to try and nix-ify one’s Python packages) so for now haven’t tried it. Thanks for the additional anecdata 😄

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • DreamBathrooms
  • khanakhh
  • magazineikmin
  • InstantRegret
  • tacticalgear
  • thenastyranch
  • Youngstown
  • rosin
  • slotface
  • modclub
  • everett
  • kavyap
  • Durango
  • JUstTest
  • osvaldo12
  • normalnudes
  • cubers
  • ethstaker
  • mdbf
  • provamag3
  • GTA5RPClips
  • cisconetworking
  • Leos
  • tester
  • megavids
  • anitta
  • lostlight
  • All magazines