Allow installation without sudo access - #1148
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
馃煛 Changes recommended
There are a couple of concrete installer UX/logic issues in the changed install.sh block that should be addressed before approving.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
This PR updates the installer to better support running without administrator membership by preferring writable prefixes and reducing reliance on sudo, while adding documentation and automated coverage for non-admin/provisioned-prefix scenarios.
Changes:
- Adjusts macOS group selection and installer behavior to allow installs into writable/provisioned prefixes without requiring admin membership.
- Adds conservative
sudocapability detection and makesexecute_sudoattempt operations without elevation before retrying withsudowhen necessary. - Adds permission-focused tests and CI coverage, plus README guidance for no-sudo installs.
| File | Description |
|---|---|
install.sh |
Implements sudo-less flow, conservative sudo failure detection, and conditional /etc/paths.d creation. |
tests/鈥媡est_install.py |
Adds unit tests covering sudo detection, probing behavior, and group selection for non-admin installs. |
README.md |
Documents no-sudo installation expectations and HOMEBREW_NO_SUDO. |
.github/鈥媤orkflows/鈥媡ests.yml |
Runs the new installer permission tests in CI and adds a provisioned-prefix no-sudo install scenario. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
MikeMcQuaid
force-pushed
the
homebrew-user-access
branch
7 times, most recently
from
September 22, 2026 14:32
e557d8c to
7e34898
Compare
p-linnane
approved these changes
Sep 22, 2026
- Allow writable prefixes without administrator membership. - Keep macOS's admin group for members and use the primary group otherwise, allowing group changes without elevation. - Remove group and other write access when falling back to `staff`, including existing files, and restrict the umask for new files. - Honour `HOMEBREW_NO_SUDO` and detect known privilege failures. - Probe sudo without refreshing cached credentials. - Try filesystem operations before requesting elevation. - Skip Command Line Tools without sudo and make their installation failures non-fatal when a usable Git is available. - Validate Git before downloading Homebrew, accepting PATH and Xcode installations without invoking Apple's developer-tool stubs. - Recommend the macOS package for MDM and identify the release requirement for installation without Git or developer tools. - Cover permissions and optional tools with Ruby tests and verify installation and package use as a real non-admin account in CI. - Use the test account's login environment to avoid inheriting the runner's inaccessible working directory.
MikeMcQuaid
force-pushed
the
homebrew-user-access
branch
from
September 23, 2026 03:38
7e34898 to
add09cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

HOMEBREW_NO_SUDOand detect known privilege failures.