gravitl / homebrew-netclient

Apache License 2.0
0 stars 6 forks source link

The installer doesn't currently work #1

Closed AlexKMDev closed 2 years ago

AlexKMDev commented 2 years ago

The install command returns 404 error, because of missing v before the version number. If I fix it:

url "https://github.com/gravitl/homebrew-netclient/releases/download/v#{version}/netclient.tgz"

It still fails to find the directory and I'm not sure why:

> brew install netclient
==> Downloading https://github.com/gravitl/homebrew-netclient/releases/download/v0.14.0/netclient.tgz
Already downloaded: /Users/xxx/Library/Caches/Homebrew/downloads/f53fd9f8f7bd6272cb3265cbc321a700245cfbcd1abca4c79459f009185d9ba8--netclient.tgz
All formula dependencies satisfied.
==> Installing Cask netclient
==> Running installer script '/opt/homebrew/Caskroom/netclient/0.14.0/install.sh'
Password:
env: /opt/homebrew/Caskroom/netclient/0.14.0/install.sh: No such file or directory
==> Purging files for version 0.14.0 of Cask netclient
Error: Failure while executing; `/usr/bin/sudo -E -- /usr/bin/env PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/Library/Homebrew/shims/shared:/usr/bin:/bin:/usr/sbin:/sbin /opt/homebrew/Caskroom/netclient/0.14.0/install.sh` exited with 127. Here's the output:
env: /opt/homebrew/Caskroom/netclient/0.14.0/install.sh: No such file or directory

It seems there is also only a x86 binary in the tgz archive now and install.sh doesn't handle M1 installations (/opt/homebrew instead of /usr/local).

mattkasun commented 2 years ago

thanks will update

mattkasun commented 2 years ago

PR #2 updates version in netclient.rb

tested on Darwin 21.4.0

working on a multi-arch version ---not quite there yet

AlexKMDev commented 2 years ago

Thanks, it seems installation fails only on M1 then (it still outputs No such file or directory now)? I don't have an Intel mac, so I couldn't check.

mattkasun commented 2 years ago

someone else got it to work on intel :)

I will do some more investigation on how to do M1 --- maybe it would be easier to have a netclient-M1 cask... would you be willing to test it?

AlexKMDev commented 2 years ago

I will do some more investigation on how to do M1 --- maybe it would be easier to have a netclient-M1 cask... would you be willing to test it?

Of course, no problem.

mattkasun commented 2 years ago

could the No such file or directory error be the result of #!/usr/local/bin/bash in the install script?

AlexKMDev commented 2 years ago

could the No such file or directory error be the result of #!/usr/local/bin/bash in the install script?

Probably. I don't have bash at this path at all. Maybe it will be better to use something like #!/usr/bin/env bash (or even #!/bin/sh, I don't think bash is really required there) and $(brew --prefix) to figure out where homebrew is installed?

mattkasun commented 2 years ago

still not sure how to put two binaries netclient-darwin and netclient-darwin-arm64 in a single cask

AlexKMDev commented 2 years ago

You can try to build 2 tgz archives with each architecture with github workflows and then point to the corresponding archive in the cask file. Here is an example of how to check which architecture is used: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/ivpn.rb

mattkasun commented 2 years ago

You can try to build 2 tgz archives with each architecture with github workflows and then point to the corresponding archive in the cask file. Here is an example of how to check which architecture is used: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/ivpn.rb

OK, I think I get it... On the todo list for tomorrow

mattkasun commented 2 years ago

update available that should work on arm64 and amd64

AlexKMDev commented 2 years ago

Still fails now because of brew-prefix in install.sh, it should be brew --prefix.

mattkasun commented 2 years ago

is this still an issue with latest release?

AlexKMDev commented 2 years ago

There is still an issue while installing netclient:

> brew install netclient
Error: Cask 'netclient' is unreadable: /opt/homebrew/Library/Taps/gravitl/homebrew-netclient/Casks/netclient.rb:6: syntax error, unexpected tIDENTIFIER, expecting end
...5e074d4a53e48b4c1586d8b2007f26f
...^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Library/Taps/gravitl/homebrew-netclient/Casks/netclient.rb:8: syntax error, unexpected tIDENTIFIER, expecting end
...f58e09813839685dc5c43542f3ec97c
...^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It happens because sha256 hashes aren't escaped in the formula. If I fix it manually on my installation, it works fine now. Thanks!