Open maslyankov opened 5 months ago
@onedr0p seems to be the recent change. any ideas?
I am taking a look now, most of the other CLI apps I see doing this are doing it the same way as I added it here. Maybe there's a strange edge-case I am not seeing.
After the failed install, I checked if there is a file installed and:
~ % /opt/homebrew/Cellar/talosctl/1.6.4/bin/talosctl
zsh: no such file or directory: /opt/homebrew/Cellar/talosctl/1.6.4/bin/talosctl
My idea is that maybe there might be some file copy issue.
Yeah there's a strange issue where the that command runs from /opt/homebrew/Cellar/talosctl/1.6.4/bin/talosctl
but /opt/homebrew/bin/talosctl
is symlinked to it.
I suggest we revert this change until I can sort it out on my end and hopefully get it working
When I change:
def install
if OS.mac? && Hardware::CPU.intel?
bin.install "talosctl-darwin-amd64" => "talosctl"
elsif OS.mac? && Hardware::CPU.arm?
bin.install "talosctl-darwin-arm64" => "talosctl"
elsif OS.linux? && Hardware::CPU.intel?
bin.install "talosctl-linux-amd64" => "talosctl"
elsif OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
bin.install "talosctl-linux-armv7" => "talosctl"
elsif OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
bin.install "talosctl-linux-arm64" => "talosctl"
end
generate_completions_from_executable(bin/"talosctl", "completion")
end
to :
def install
if OS.mac? && Hardware::CPU.intel?
bin.install "talosctl-darwin-amd64" => "talosctl"
elsif OS.mac? && Hardware::CPU.arm?
bin.install "talosctl-darwin-arm64" => "talosctl"
elsif OS.linux? && Hardware::CPU.intel?
bin.install "talosctl-linux-amd64" => "talosctl"
elsif OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit?
bin.install "talosctl-linux-armv7" => "talosctl"
elsif OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
bin.install "talosctl-linux-arm64" => "talosctl"
end
end
def post_install
generate_completions_from_executable(bin/"talosctl", "completion")
end
It installs as expected. Not sure if the completitions work though.
@maslyankov nice find! It works here:
❯ brew install siderolabs/tap/talosctl
==> Fetching siderolabs/tap/talosctl
==> Downloading https://github.com/siderolabs/talos/releases/download/v1.6.4/talosctl-darwin-arm64
...
fish completions have been installed to:
/opt/homebrew/share/fish/vendor_completions.d
...
Do you want to PR that change, or want me to?
@maslyankov nice find! It works here:
❯ brew install siderolabs/tap/talosctl ==> Fetching siderolabs/tap/talosctl ==> Downloading https://github.com/siderolabs/talos/releases/download/v1.6.4/talosctl-darwin-arm64 ... fish completions have been installed to: /opt/homebrew/share/fish/vendor_completions.d ...
Do you want to PR that change, or want me to?
I will do a PR, I have it locally.
Well interesting, even though it says the completions were installed I do not see them in /opt/homebrew/share/fish/vendor_completions.d
so this isn't fixed unfortunately.
I am completely lost to why it's not working the way it was before...
I don't see how what we are doing here is really any different than ... https://github.com/fluxcd/homebrew-tap/blob/master/Formula/flux.rb
Here's the full debug log
✖ brew install -vd siderolabs/tap/talosctl
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /opt/homebrew/Library/Taps/siderolabs/homebrew-tap/Formula/talosctl.rb
/opt/homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::FromTapLoader): loading siderolabs/tap/talosctl
==> Fetching siderolabs/tap/talosctl
==> Downloading https://github.com/siderolabs/talos/releases/download/v1.6.4/talosctl-darwin-arm64
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.2.7\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.3.1\)\ curl/8.4.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://github.com/siderolabs/talos/releases/download/v1.6.4/talosctl-darwin-arm64
Already downloaded: /Users/devin/Library/Caches/Homebrew/downloads/485b9ad5cac364a22d306b8aec2e873157cfde360ccac1576ee4e4dfae896eb1--talosctl-darwin-arm64
==> Verifying checksum for '485b9ad5cac364a22d306b8aec2e873157cfde360ccac1576ee4e4dfae896eb1--talosctl-darwin-arm64'
==> Installing talosctl from siderolabs/tap
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/git --version
/usr/bin/env hdiutil imageinfo -format /Users/devin/Library/Caches/Homebrew/downloads/485b9ad5cac364a22d306b8aec2e873157cfde360ccac1576ee4e4dfae896eb1--talosctl-darwin-arm64
cp -p /Users/devin/Library/Caches/Homebrew/downloads/485b9ad5cac364a22d306b8aec2e873157cfde360ccac1576ee4e4dfae896eb1--talosctl-darwin-arm64 /private/tmp/talosctl-20240212-37030-ufp5en/talosctl-darwin-arm64
brew: exec failed: {"SHELL"=>"bash"}
/opt/homebrew/Library/Homebrew/ignorable.rb:29:in `block in raise'
ErrorDuringExecution: Failure while executing; `\{\"SHELL\"=\>\"bash\"\} /opt/homebrew/Cellar/talosctl/1.6.4/bin/talosctl completion bash` exited with 1.
We should rename this issue to "Support autocompletions" or something similar, I am at my wits end trying to get it to work though 😄
Hello! I am facing the following issue. Any idea what might be the cause of it?