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

Support Homebrew installation on Apple Silicon machines #574

Closed
ldennington opened this issue Dec 15, 2021 · 12 comments
Closed

Support Homebrew installation on Apple Silicon machines #574

ldennington opened this issue Dec 15, 2021 · 12 comments
Assignees
Labels
enhancement New feature or request installation Specific to installation and uninstallation platform:osx Specific to the macOS platform

Comments

@ldennington
Copy link
Contributor

ldennington commented Dec 15, 2021

Feature description

The default HOMEBREW_PREFIX is /usr/local on non-Apple silicon machines, and our macOS scripts assume that GCM will be installed in the \share sub-directory located in this path. However, it looks like for Apple Silicon it's been updated to /opt/homebrew. We should update our scripts to account for this scenario. For additional context, see #568.

@ldennington ldennington added the enhancement New feature or request label Dec 15, 2021
@mjcheetham mjcheetham added installation Specific to installation and uninstallation platform:osx Specific to the macOS platform labels Dec 16, 2021
@ldennington ldennington self-assigned this Mar 9, 2022
@Datamance
Copy link

What is the workaround for this in the meantime?

@ldennington
Copy link
Contributor Author

You can install this manually: gcm-osx-arm64-2.0.785.pkg.

@wesleyhamburger-okta
Copy link

Unfortunately manual installation doesn't work for me in this case. Taken from the log - sorry I appreciate the log is not that helpful

An error occurred while running scripts from the package “gcm-osx-arm64-2.0.785 (1).pkg”." UserInfo={NSFilePath=./postinstall, NSURL=file://localhost/Users/whamburger/Downloads/gcm-osx-arm64-2.0.785%20(1).pkg#com.microsoft.gitcredentialmanager.component.pkg, PKInstallPackageIdentifier=com.microsoft.gitcredentialmanager, NSLocalizedDescription=An error occurred while running scripts from the package “gcm-osx-arm64-2.0.785 (1).pkg

@ldennington
Copy link
Contributor Author

Ah yes - I imagine this is related to the changes I'm making here:

https://github.com/GitCredentialManager/git-credential-manager/pull/798/files

However, it's hard to be sure since I unfortunately do not have an M1 Mac 😬.

@wesleyhamburger-okta
Copy link

I'll wait till the release and see how it goes then and re-post here. I also seemed to have posted the wrong log as thats the arm installation 😢 but it was still the same outcome

@ldennington
Copy link
Contributor Author

Completed with:

mjcheetham/update-homebrew#10
#798
microsoft/homebrew-git#66

@solrevdev
Copy link

solrevdev commented Nov 18, 2022

So, Homebrew did upgrade it but I did get an error that may be of interest

Update

Actually homebrew didn't update it at all but running brew reinstall --cask git-credential-manager-core did sort it.

Error:

==> Upgrading 1 outdated package:
microsoft/git/git-credential-manager-core 2.0.785 -> 2.0.877
==> Upgrading git-credential-manager-core
==> Downloading https://github.com/GitCredentialManager/git-credential-manager/releases/down
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2
######################################################################## 100.0%
==> Running uninstall script /opt/homebrew/share/gcm-core/uninstall.sh
==> Purging files for version 2.0.877 of Cask git-credential-manager-core
Error: microsoft/git/git-credential-manager-core: uninstall script /opt/homebrew/share/gcm-core/uninstall.sh does not exist.
==> Casks with 'auto_updates true' or 'version :latest' will not be upgraded; pass `--greedy

Version:

git-credential-manager-core --version
2.0.785+6074e4e3d3

System:

neofetch --off
solrevdev@macmini-2020.local
----------------------------
OS: macOS 13.0.1 22A400 arm64
Host: Macmini9,1
Kernel: 22.1.0
Uptime: 23 mins
Packages: 339 (brew)
Shell: zsh 5.8.1
Resolution: 2560x1440, 2560x1440
DE: Aqua
WM: Quartz Compositor
WM Theme: Blue (Light)
Terminal: iTerm2
Terminal Font: CaskaydiaCoveNerdFontComplete-Regular 16
CPU: Apple M1
GPU: Apple M1
Memory: 2238MiB / 16384MiB

@wchoi09
Copy link

wchoi09 commented Nov 18, 2022

So, Homebrew did upgrade it but I did get an error that may be of interest

Error:

==> Upgrading 1 outdated package:
microsoft/git/git-credential-manager-core 2.0.785 -> 2.0.877
==> Upgrading git-credential-manager-core
==> Downloading https://github.com/GitCredentialManager/git-credential-manager/releases/down
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2
######################################################################## 100.0%
==> Running uninstall script /opt/homebrew/share/gcm-core/uninstall.sh
==> Purging files for version 2.0.877 of Cask git-credential-manager-core
Error: microsoft/git/git-credential-manager-core: uninstall script /opt/homebrew/share/gcm-core/uninstall.sh does not exist.
==> Casks with 'auto_updates true' or 'version :latest' will not be upgraded; pass `--greedy

Version:

git-credential-manager-core --version
2.0.785+6074e4e3d3

System:

neofetch --off
solrevdev@macmini-2020.local
----------------------------
OS: macOS 13.0.1 22A400 arm64
Host: Macmini9,1
Kernel: 22.1.0
Uptime: 23 mins
Packages: 339 (brew)
Shell: zsh 5.8.1
Resolution: 2560x1440, 2560x1440
DE: Aqua
WM: Quartz Compositor
WM Theme: Blue (Light)
Terminal: iTerm2
Terminal Font: CaskaydiaCoveNerdFontComplete-Regular 16
CPU: Apple M1
GPU: Apple M1
Memory: 2238MiB / 16384MiB

Same issue for me on my M1 MacBook. Upgrading via the brew upgrade git-credential-manager-core command requires the package to be uninstalled first, but results in the uninstall.sh does not exist error.

To temporarily satisfy the error, I manually created the gcm-core folder under /opt/homebrew/share and placed uninstall.sh file in it. (I assume the paths to symlinks to be different for arm packages) ...and success!

However, even after the upgrade, the issue persists while uninstalling (I assume so as well for future upgrading).

Version:

$ git-credential-manager-core --version
warning: git-credential-manager-core was renamed to git-credential-manager
warning: see https://aka.ms/gcm/rename for more information
2.0.877+c7c35983b8

Error:

$ brew uninstall --cask git-credential-manager-core
==> Uninstalling Cask git-credential-manager-core
==> Running uninstall script /opt/homebrew/share/gcm-core/uninstall.sh
Error: uninstall script /opt/homebrew/share/gcm-core/uninstall.sh does not exist.

Thanks.

@ldennington
Copy link
Contributor Author

#966 should resolve. Sorry for the pain here!

@codyzu
Copy link

codyzu commented Nov 24, 2022

I got around this by:

ln -s /usr/local/share/gcm-core /opt/homebrew/share/gcm-core
brew uninstall --cask git-credential-manager-core
brew install git-credential-manager-core

@toddjonker
Copy link

Thanks @codyzu ! I'm guessing one should also rm /opt/homebrew/share/gcm-core to cleanup the hack.

@bektur
Copy link

bektur commented Jan 23, 2023

What helped me was running those commands.

xcode-select --install
brew install gcc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request installation Specific to installation and uninstallation platform:osx Specific to the macOS platform
Projects
None yet
Development

No branches or pull requests

9 participants