HACKER Q&A
📣 motsi

MacBook M1 development workflow?


The battery life on the MacBook M1 is pretty amazing but not having Virtualbox has been a pain and we are exploring options for our new team. I have mostly worked for companies with actual teams dedicated to providing build tools.

Past attempts to Dockerize all the infrastructure dependencies (e.g. we run our own database and DNS servers) and tying all of that with the build scripts was deemed more effort than its worth so that never got off the ground. Maybe its different from scratch?

I have tried a bunch of these projects so while interesting I'm not sure about building workflows around them:

https://mac.getutm.app/

https://github.com/KhaosT/SimpleVM

https://github.com/danielrfry/toyvm

https://github.com/evansm7/vftool

https://multipass.run/install

https://github.com/features/codespaces

https://medium.com/@paulrobu/how-to-run-ubuntu-22-04-vms-on-apple-m1-arm-based-systems-for-free-c8283fb38309

I know architecture differences will cause pain, hell here we are already. I think everyone will benefit from crowd sourcing experiences and hopefully we can save each other chunks of life thrown away.

==

    What tool do you use to {edit code, build artifacts, run unit tests, deploy artifacts, run e2e tests}

        Why do you use X?

        What where you using before switching to X?

        When did you switch and how much did it cost you in terms of $ licensing and workflow changes?

        What else did you consider before choosing X?

        What did you not like about about the alternatives?
==

1. I develop primarily in Java for services that get deployed on Linux boxes

2. Sublime Text used to be my default but I begrudgingly accepted IntelliJ in my previous job since we used Java

3. An IntelliJ license was provided by the company so the powers that be handled that side of the equation so I have no $ value.

4. I inherited the previous development setup so not sure what the adoption cost looked like

5. We have scripts that wrap Ant tasks to locally run "integration tests" but so much is mocked out it doesn't match reality so you can't green light anything until you have actually deployed and tested the code in staging

6. We deploy our code to EC2 instances for e2e testing since there are infrastructure services we need as mentioned earlier e.g. the database, memcache etc


  👤 nvln Accepted Answer ✓
1. Editor

   - VS code (working mostly on Typescript projects these days)
   - Emacs for org mode / note taking
   - Jetbrains Rider for Game dev
   - nvim for, well, vi.
2. Build / Test / Deploy

   - My mac is completely managed by a Nix / home-manager[1] setup that delegates to homebrew for some apps.
   - I add a flake.nix to all projects and use the nix devShell[2] with direnv extension to create development environments with custom commands. I played with the flix language[3] (on JVM) briefly and my nix based workflow worked quite well.
   - I use lima with nerdctl[4] for containerization when required. I have a stalled experiment to use VSCode devcontainers[5]. I unfortunately didn't take notes on that experiment so I don't have a lot to share. All I can remember is that the integration to VSCode was quite impressive but trying to get the ergonomics of my local environment replicated required significant effort. 
   - CI: github actions

[1]: https://github.com/nix-community/home-manager [2]: https://github.com/numtide/devshell [3]: https://flix.dev [4]: https://github.com/lima-vm/lima [5]: https://containers.dev/overview

👤 throwaway888abc

👤 mark_l_watson
I use Docker, on rare occasion. If I need to run an Intel based container, that usually works using Rosetta.

Everything else I run native M1 applications: 2 Common Lisp implementations, Python, Jetbrains and VSCode IDEs.

The M1 chip can be an inconvenience but using the M1 specific Homebrew (brew) gets me by and is now the way I install Emacs and many other dev utilities.


👤 lmarcos
Vagrant + vmware plugin + vmware tech preview for m1. Not perfect but it does work.

👤 rajeshp1986
I mostly used Docker and a cloud environment for anything related to VM.