extism / cli

The extism CLI is used to generate plugin scaffolding and manage Extism installations
BSD 3-Clause "New" or "Revised" License
19 stars 5 forks source link

Failed Install on MacOS #89

Open bradyjoslin opened 1 month ago

bradyjoslin commented 1 month ago
❯ 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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 https://github.com/extism/cli/pull/90/commits/bd06bf2ec74d7bb16b8586b6f459c2010c022309