Thanks Sir
System Level knowledge
1) Your sudo suggestion is an other way to give to CT the correct user privileges.
Our methodology works on Linux, MacOS, OpenIndiana, Solaris, FreeBSD, NetBSD, OpenBSD and DragonFly.
On all above OSes with CT you can build app and system stuff like sys daemons, sys libraries and modules without problem.
2) We select MacPorts because you can totally remove it from your MacOS,
can you do the same with Homebrew ?
We will test again Homebrew. Tomorrow, I will add this task to LAB To-Do list.
Long time ago I used same method as you, and I were adding myself to sudoers file on every system, until one day my colleague (senior system admin) didn't see what I did on one of our web servers. After very long security lecture I never did that on any system again. So yes, that method works, but it's basically a security hole. I guess it can be used on local machine as long as you remove yourself from sudoers file right after you finish installation.
This method that I suggested is absolutely secure and works fine on Ubuntu and MacOS. It should also works on any other linux distro (unfortunately I didn't test it myself on other distros).
I just remembered something important about homebrew. On Intel, default homebrew path is also /usr/local, so it's same as for MacPorts and everything should work without any modification. But, they decided to use different path for ARM installation and that is /opt/homebrew. Even if you are using Rosetta 2 to install CT (as I did earlier today), since I originally installed brew without Rosetta emulation, my path is different.
Yes, you can uninstall brew at any time. There is an uninstall script.
Installation
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Unistall
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
If you need any help with brew or you need to test anything on brew and/or M1 with or without Rosetta, just let me know in PM.