Multiuser brew not supported during azure-cli install
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
**Describe the bug**
Install script or brew fails to alter user ownership as my setup is for multiple mac users.
I use *brew* across multi-users in macos, so my brew cellar (`ls -l /usr/local/Cellar/`) has various owners such as _python@3.8_ is owned by userB whereas _python@3.9_ is owned by userA. Note: `brew` works fine and `brew doctor` too.
When I try to install **azure-cli** via *brew* I see an ownership error as the ownership is different than my current user.
```
cp: utimes: /usr/local/Cellar/python@3.8/.: Operation not permitted
cp: chmod: /usr/local/Cellar/python@3.8/.: Operation not permitted
```
To prove this, I changed user ownership of _python@3.8_ with `sudo chown userA /usr/local/Cellar/python@3.8`. Re-run the install script as userA and it proceeds until the next ownership issue of
```
cp: utimes: /usr/local/Cellar/glib/.: Operation not permitted
cp: chmod: /usr/local/Cellar/glib/.: Operation not permitted
```
**To Reproduce**
1. Open terminal as userA
2. $ `brew install azure-cli`
3. See error ```cp: chmod: /usr/local/Cellar/python@3.8/.: Operation not permitted``` as python@3.8 is owned by userB
**Expected behavior**
1. Open terminal as userA
2. $ `brew install azure-cli`
3. Successful addition of **az** command tool
**Environment summary**
macos BigSur 11.2 using terminal.app with two mac users on laptop
**Additional context**
It seems to work if all brew cellar bottles are owned by the current owner
This is similar to [how my multi-user is setup with brew](https://stackoverflow.com/a/56686602/4262979)
Contributor guide
Assessment
This issue has not been assessed yet.