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

Failed Install on MacOS #89

Open
bradyjoslin opened this issue Jun 4, 2024 · 4 comments
Open

Failed Install on MacOS #89

bradyjoslin opened this issue Jun 4, 2024 · 4 comments

Comments

@bradyjoslin
Copy link

  • /user/local/bin directory doesn't exist by default on new MacOS installs
  • install fails when attempting to install in that non-existent directory when using defaults
  • final output line from installation script erroneously indicates install was successful
❯ curl https://get.extism.org/cli | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3695    0  3695    0     0  41266      0 --:--:-- --:--:-- --:--:-- 41055
Confirm installation:
  Version: v1.5.0
  OS: darwin
  Arch: arm64
  Sudo: /usr/bin/sudo
  Destination: /usr/local/bin/extism
  Build from source: n
Proceed? [y/N]:
y
Extracting release to /usr/local/bin/extism
Password:
sh: /usr/local/bin/extism: No such file or directory
chmod: /usr/local/bin/extism: No such file or directory
extism executable installed to /usr/local/bin/extism

~ took 15s
❯ ls /usr/local/bin/
ls: /usr/local/bin/: No such file or directory
@bhelx
Copy link
Contributor

bhelx commented Jun 4, 2024

Thanks for reporting! Do you know if this is a new development? Have you found any recommendations online about where we should put a binary?

@bradyjoslin
Copy link
Author

Package managers like brew began changing their install target location when Apple Silicon came out, details here. As far as I can tell, this simply makes the directory less likely to have been previously created on the user's machine.

Believe a quick fix is to create the /usr/local/bin directory if it doesn't already exist as part of the install process. Here's an example from elsewhere.

Other options would be to install in either ~/.local/opt/ or ~/.local/bin. Benefit would be not requiring root. Similarly, would also require checking if the directory exists and making it if it doesn't, with the addition of making sure it is in the user's PATH. See webi as an example.

Lastly, perhaps consider adding a brew tap as an install option. goreleaser automates that quite nicely.

@G4Vi
Copy link
Contributor

G4Vi commented Jun 4, 2024

If homebrew uses /usr/local/bin exclusively for x86_64 and it doesn't always exists now, it sounds like we should consider alternative install dirs. Local installs sound nice, but for consistency, at least for now I think it would be good to still do a system install.

I don't have a Mac handy, I'll ask the team if they have any ideas.

@G4Vi
Copy link
Contributor

G4Vi commented Jun 4, 2024

While /usr/local/bin does not exist, it appears to be in $PATH so it should still be a valid place to install. Added creating it if it doesn't exist bd06bf2

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

No branches or pull requests

3 participants