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

Mac OS 12.3: configuration-osx.sh script fails with /usr/bin/python: bad interpreter: No such file or directory #316

Closed
0x2615 opened this issue May 18, 2022 · 4 comments · Fixed by #317
Labels

Comments

@0x2615
Copy link
Contributor

0x2615 commented May 18, 2022

Issue

  • Mac OS Monterey 12.3.1
  • MacBook Pro with M1 Pro CPU

I ran setup with the following options:

./setup.sh concourse cred-alert docker golang java java-tools kubernetes python terraform

When setup reached the 'Customizing OS X configuration' stage; i.e. when it ran ./scripts/common/configuration-osx.sh. The output was as follows:

Customizing OS X configuration
==> Downloading https://ghcr.io/v2/homebrew/core/dockutil/manifests/2.0.5
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/dockutil/blobs/sha256:f5f87d9e286c2b294bb157ac9f87baa2720fff044c7a92c0b80b9cb82db8a87e
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:f5f87d9e286c2b294bb157ac9f87baa2720fff044c7a92c0b80b9cb82db8a87e?se=2022-05-18T14%3A10%3A00Z&sig=4ycdeVcBC7Qymk981FwZ%2BpuL7npmu5tqChx2nzP8U
######################################################################## 100.0%
==> Pouring dockutil--2.0.5.all.bottle.tar.gz
🍺  /opt/homebrew/Cellar/dockutil/2.0.5: 4 files, 37.9KB
==> Running `brew cleanup dockutil`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
./scripts/common/configuration-osx.sh: /opt/homebrew/bin/dockutil: /usr/bin/python: bad interpreter: No such file or directory
./scripts/common/configuration-osx.sh: /opt/homebrew/bin/dockutil: /usr/bin/python: bad interpreter: No such file or directory
mirzasa@Sams-MacBook-Pro workstation-setup-main %

It seems that dockutil version 2.0.5 requires Python 2.7, which has been removed from Mac OS. See: kcrawford/dockutil#127

I worked around this issue by running the following commands:

brew uninstall dockutil
brew install jq
DLURL=$(curl --silent "https://api.github.com/repos/kcrawford/dockutil/releases/latest" | jq -r '.assets[].browser_download_url' | grep pkg)
curl -sL ${DLURL} -o /tmp/dockutil.pkg
sudo installer -pkg "/tmp/dockutil.pkg" -target /
rm /tmp/dockutil.pkg

I stole most of this from the issue I have linked to above. I then re-ran setup and got past the 'Customizing OS X configuration' stage.

Possible Solutions

  1. Wait for dockutil to be updated in Homebrew, it seems a PR is in progress: dockutil 3.0.2 Homebrew/homebrew-core#97394
  2. Implement the workaround I used in ./scripts/common/configuration-osx.sh

I'd be happy to open a PR for this if you're keen on option 2

@joemoore
Copy link
Collaborator

Thank you for the report; I'll take a look as soon as I can. Feel free to keep updating this issue or submit a PR.

@joemoore joemoore added the bug label May 19, 2022
@joemoore
Copy link
Collaborator

I realize we had to fix a version of this before. #308

@joemoore
Copy link
Collaborator

I'm tempted to remove that dockutil section entirely. This troublesome section attempts to make a minimalist OS X Dock. Do we get much value from:

  • removing standard dock icons
  • adding Chome
  • adding iTerm.

Thoughts?

@0x2615
Copy link
Contributor Author

0x2615 commented May 24, 2022

Thanks @joemoore. I think dockutil is quite useful. A fresh install of mac OS seems to put a load of guff in the dock that is not needed. I would prefer to keep dockutil and have a minimalist Dock.

There has been activity on the PR I linked to, but there doesn't seem to have been any actual progress.

Someone has created a Homebrew cask for the updated version of dockutil, perhaps we could just use that for now? See: https://github.com/hpedrorodrigues/homebrew-tools/blob/master/Casks/dockutil.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants