Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS topgrade assumes full brew path - breaks when using Workbrew #1011

Open
4 tasks
mbdmbd opened this issue Dec 31, 2024 · 0 comments
Open
4 tasks

macOS topgrade assumes full brew path - breaks when using Workbrew #1011

mbdmbd opened this issue Dec 31, 2024 · 0 comments
Labels
C-bug Something isn't working

Comments

@mbdmbd
Copy link

mbdmbd commented Dec 31, 2024

Erroneous Behavior

Running Topgrade on macOS with the Workbrew version of Brew installed gives an error:

── 11:39:55 - Brew ─────────────────────────────────────────────────────────────
Error: /opt/homebrew/Cellar is not writable. You should change the
ownership and permissions of /opt/homebrew/Cellar back to your
user account:
  sudo chown -R xxxxxx /opt/homebrew/Cellar
Brew (ARM) failed:
   0: Command failed: `/opt/homebrew/bin/brew update`
   1: `/opt/homebrew/bin/brew` failed: exit status: 1

Expected Behavior

It would be good to have it work; doing the manual steps along the lines of brew doctor, brew update, brew upgrade, etc all function as expected from a terminal.

Steps to reproduce

  1. On a Mac (in my case Apple Silicon/ARM based), install and setup the Workbrew version of Brew (https://workbrew.com)
  2. Run topgrade
  3. See above error output

Possible Cause (Optional)

It looks like line 39 of https://github.com/search?q=repo%3Atopgrade-rs%2Ftopgrade%20ARM_BREW&type=code assumes that the path for Brew for ARM is /opt/homebrew/bin/brew. However, Workbrew, which runs over the top of homebrew and acts as a wrapper is located at /opt/workbrew/bin/brew.

Possible easy fix would be to enable a configuration item to overwrite the path for brew, or have the code detect the location of brew in the path.

Problem persists without calling from topgrade

  • Yes
  • [ X ] No

Did you run topgrade through Remote Execution

  • Yes
  • [ X ] No

If yes, does the issue still occur when you run topgrade directlly in your
remote host

  • Yes
  • No

Additional Details

  • Operation System/Version
    macOS 15.2 (24C101)

  • Installation
    Installed via brew

  • Topgrade version (topgrade -V)
    topgrade 16.0.2

Verbose Output (topgrade -v)

(replaced username with xxxxxx)

topgrade -v
DEBUG Current system locale is en-AU
DEBUG Configuration at /Users/xxxxxx/.config/topgrade.toml
DEBUG Loaded configuration: ConfigFile { include: Some(Include { paths: None }), misc: Some(Misc { pre_sudo: None, sudo_command: None, disable: None, ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, tmux_arguments: None, set_title: None, display_time: None, assume_yes: None, no_retry: None, run_in_tmux: None, tmux_session_mode: None, cleanup: None, notify_each_step: None, skip_notify: None, bashit_branch: None, only: None, no_self_update: None, log_filters: None }), pre_commands: Some({}), post_commands: Some({}), commands: Some({}), python: Some(Python { enable_pip_review: None, enable_pip_review_local: None, enable_pipupgrade: None, pipupgrade_arguments: None, poetry_force_self_update: None }), composer: Some(Composer { self_update: None }), brew: Some(Brew { greedy_cask: None, greedy_latest: None, greedy_auto_updates: None, autoremove: None, fetch_head: None }), linux: Some(Linux { yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, arch_package_manager: None, show_arch_news: None, garuda_update_arguments: None, trizen_arguments: None, pikaur_arguments: None, pamac_arguments: None, dnf_arguments: None, nix_arguments: None, nix_env_arguments: None, apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, suse_dup: None, rpm_ostree: None, bootc: None, emerge_sync_flags: None, emerge_update_flags: None, home_manager_arguments: None }), git: Some(Git { max_concurrency: None, arguments: None, repos: None, pull_predefined: None }), containers: Some(Containers { ignored_containers: None, runtime: None }), windows: Some(Windows { accept_all_updates: None, self_rename: None, open_remotes_in_new_terminal: None, wsl_update_pre_release: None, wsl_update_use_web_download: None }), npm: Some(NPM { use_sudo: None }), yarn: Some(Yarn { use_sudo: None }), deno: None, vim: Some(Vim { force_plug_update: None }), firmware: Some(Firmware { upgrade: None }), vagrant: Some(Vagrant { directories: None, power_on: None, always_suspend: None }), flatpak: Some(Flatpak { use_sudo: None }), distrobox: Some(Distrobox { use_root: None, containers: None }), lensfun: Some(Lensfun { use_sudo: None }), julia: None }
DEBUG Version: 16.0.2
DEBUG OS: aarch64-apple-darwin
DEBUG Args { inner: ["topgrade", "-v"] }
DEBUG Binary path: Ok("/opt/homebrew/bin/topgrade")
DEBUG self-update Feature Enabled: false
DEBUG Configuration: Config { opt: CommandLineArgs { edit_config: false, show_config_reference: false, run_in_tmux: false, cleanup: false, dry_run: false, no_retry: false, disable: [], only: [], custom_commands: [], env: [], verbose: true, keep_at_end: false, skip_notify: false, yes: None, disable_predefined_git_repos: false, config: None, remote_host_limit: None, show_skipped: false, log_filter: "warn", gen_completion: None, gen_manpage: false, no_self_update: false }, config_file: ConfigFile { include: Some(Include { paths: None }), misc: Some(Misc { pre_sudo: None, sudo_command: None, disable: None, ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, tmux_arguments: None, set_title: None, display_time: None, assume_yes: None, no_retry: None, run_in_tmux: None, tmux_session_mode: None, cleanup: None, notify_each_step: None, skip_notify: None, bashit_branch: None, only: None, no_self_update: None, log_filters: None }), pre_commands: Some({}), post_commands: Some({}), commands: Some({}), python: Some(Python { enable_pip_review: None, enable_pip_review_local: None, enable_pipupgrade: None, pipupgrade_arguments: None, poetry_force_self_update: None }), composer: Some(Composer { self_update: None }), brew: Some(Brew { greedy_cask: None, greedy_latest: None, greedy_auto_updates: None, autoremove: None, fetch_head: None }), linux: Some(Linux { yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, arch_package_manager: None, show_arch_news: None, garuda_update_arguments: None, trizen_arguments: None, pikaur_arguments: None, pamac_arguments: None, dnf_arguments: None, nix_arguments: None, nix_env_arguments: None, apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, suse_dup: None, rpm_ostree: None, bootc: None, emerge_sync_flags: None, emerge_update_flags: None, home_manager_arguments: None }), git: Some(Git { max_concurrency: None, arguments: None, repos: None, pull_predefined: None }), containers: Some(Containers { ignored_containers: None, runtime: None }), windows: Some(Windows { accept_all_updates: None, self_rename: None, open_remotes_in_new_terminal: None, wsl_update_pre_release: None, wsl_update_use_web_download: None }), npm: Some(NPM { use_sudo: None }), yarn: Some(Yarn { use_sudo: None }), deno: None, vim: Some(Vim { force_plug_update: None }), firmware: Some(Firmware { upgrade: None }), vagrant: Some(Vagrant { directories: None, power_on: None, always_suspend: None }), flatpak: Some(Flatpak { use_sudo: None }), distrobox: Some(Distrobox { use_root: None, containers: None }), lensfun: Some(Lensfun { use_sudo: None }), julia: None }, allowed_steps: [AM, AppMan, Asdf, Atom, Aqua, Audit, AutoCpufreq, Bin, Bob, BrewCask, BrewFormula, Bun, BunPackages, Cargo, Certbot, Chezmoi, Chocolatey, Choosenim, ClamAvDb, Composer, Conda, ConfigUpdate, Containers, CustomCommands, DebGet, Deno, Distrobox, DkpPacman, Dotnet, Elan, Emacs, Firmware, Flatpak, Flutter, Fossil, Gcloud, Gem, Ghcup, GithubCliExtensions, GitRepos, GnomeShellExtensions, Go, Guix, Haxelib, Helm, HomeManager, Jetpack, Julia, Juliaup, Kakoune, Helix, Krew, Lure, Lensfun, Macports, Mamba, Miktex, Mas, Maza, Micro, MicrosoftStore, Mise, Myrepos, Nix, Node, Opam, Pacdef, Pacstall, Pearl, Pip3, PipReview, PipReviewLocal, Pipupgrade, Pipx, Pixi, Pkg, Pkgin, PlatformioCore, Pnpm, Poetry, Powershell, Protonup, Pyenv, Raco, Rcm, Remotes, Restarts, Rtcl, RubyGems, Rustup, Rye, Scoop, Sdkman, SelfUpdate, Sheldon, Shell, Snap, Sparkle, Spicetify, Stack, Stew, System, Tldr, Tlmgr, Tmux, Toolbx, Uv, Vagrant, Vcpkg, Vim, VoltaPackages, Vscode, Waydroid, Winget, Wsl, WslUpdate, Xcodes, Yadm, Yarn, Zvm] }
DEBUG Cannot find "pwsh"
DEBUG Cannot find "powershell"
DEBUG Path "/Users/xxxxxx/.config/emacs" doesn't exist
DEBUG Path "/Users/xxxxxx/.emacs.d" doesn't exist
DEBUG Cannot find "doas"
DEBUG Detected "/usr/bin/sudo" as "sudo"
DEBUG Step "Brew (ARM)"
DEBUG Detected "/opt/homebrew/bin/brew" as "/opt/homebrew/bin/brew"

── 12:48:32 - Brew ─────────────────────────────────────────────────────────────
DEBUG Executing command /opt/homebrew/bin/brew update
Error: /opt/homebrew/Cellar is not writable. You should change the
ownership and permissions of /opt/homebrew/Cellar back to your
user account:
sudo chown -R xxxxxx /opt/homebrew/Cellar
DEBUG Command failed: Err(
0: Command failed: /opt/homebrew/bin/brew update
1: /opt/homebrew/bin/brew failed: exit status: 1

Location:
src/steps/os/unix.rs:337)
DEBUG Step "Brew (ARM)" failed:
0: Command failed: /opt/homebrew/bin/brew update
1: /opt/homebrew/bin/brew failed: exit status: 1

Location:
src/steps/os/unix.rs:337
Brew (ARM) failed:
0: Command failed: /opt/homebrew/bin/brew update
1: /opt/homebrew/bin/brew failed: exit status: 1

Location:
src/steps/os/unix.rs:337
Retry? (y)es/(N)o/(s)hell/(q)uit

@mbdmbd mbdmbd added the C-bug Something isn't working label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant