Open daveneeley opened 10 months ago
I'm facing the same issue on my RHEL v8.9 machine.
uname -a
Linux xxx 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Thu Nov 16 10:29:04 EST 2023 x86_64 x86_64 x86_64 GNU/Linux
The glibc version provided with RHEL v8.9 seems to be 2.28:
ldd --version ldd
ldd (GNU libc) 2.28
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
Any chance to get switcher
running on RHEL v8.9?
Hi, thanks for reporting. I'll try to get it running on my Fedora box and report back (so far I have only tested on my OSX machine)
Same issue for Ubuntu 20.04.6 LTS in Windows WSL
Do you have a link to the kubernetes-cli homebrew formula where I could see how they do it? Thanks!
I was able to get this to work. I would have used your Makefile but it builds all the arch which isn't necessary when doing this way.
class Switcher < Formula
desc "Providing the binary executable for the 'switch' script."
homepage "https://github.com/danielfoehrKn/kubeswitch"
url "https://github.com/danielfoehrKn/kubeswitch.git",
tag: "0.9.1",
revision: "9f82b5f75bbc51615d97d006df86f1b9939123fd"
license "Apache-2.0"
head "https://github.com/danielfoehrKn/kubeswitch.git", branch: "master"
depends_on "bash" => :build
depends_on "coreutils" => :build
depends_on "go" => :build
def install
rm_rf ".brew_home"
ldflags = %W[
-w
-X github.com/danielfoehrkn/kubeswitch/cmd/switcher.version=#{version}
-X github.com/danielfoehrkn/kubeswitch/cmd/switcher.buildDate=#{time.iso8601}
]
ENV.prepend_path "PATH", Formula["coreutils"].opt_libexec/"gnubin" # needs GNU date
system "go", "build", *std_go_args(ldflags:), "./cmd/main.go"
generate_completions_from_executable(bin/"switcher", "completion", base_name: "switcher")
end
def caveats
<<~EOS
To setup shell integration, add this to your shell configuration:
# bash
source <(switcher init bash)
# zsh
source <(switcher init zsh)
# fish
switcher init fish | source
EOS
end
test do
system "#{bin}/switcher", "-h"
end
end
After that I didn't end up putting anything in bashrc since the completions were done.
switcher works... now if you want to use s or switch then you could do alias s=switcher
or alias switch=switcher
...
Hope this helps?
> more /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
SUPPORT_END="2025-06-30"
> switcher -v
switcher version 0.9.1
Do you have a link to the kubernetes-cli homebrew formula where I could see how they do it? Thanks!
https://github.com/Homebrew/homebrew-core/blob/master/Formula/k/kubernetes-cli.rb
After that I didn't end up putting anything in bashrc since the completions were done.
switcher works... now if you want to use s or switch then you could do
alias s=switcher
oralias switch=switcher
...Totally had forgotten you have 2 Homebrew formulas so I'm curious if the other
switch
one is necessary or not? Also the completions should work for zsh as well with the above formula... I had your normal one working on my Mac but in Linux I ended up having to lock to 0.7.2 until I did this so not sure if I really need the switch (switch.sh) one at all or not since it seems its working without anything in my bashrc since it goes into homebrews completions directory
Thanks! I will have to try this out before putting it in the formula.
The second homebrew formula is to configure switch.sh
if you don't want to manually source switcher init zsh
- though that's the recommended way.
I think at this point we can also just get rid of the second formula.
@danielfoehrKn I had to make one change for this to work when using a specific version of the formula like when extracting.
https://github.com/cdenneen/homebrew-taps/blob/main/Formula/switcher.rb
So that would work for latest and when you extract out a specific version like: https://github.com/cdenneen/homebrew-taps/blob/main/Formula/switcher%400.9.1.rb
It's still works.
same for me on Ubuntu 20.04 LTS
./switcher_linux_amd64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./switcher_linux_amd64)
./switcher_linux_amd64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./switcher_linux_amd64)
i had to rollback to version 0.7.2: https://github.com/danielfoehrKn/kubeswitch/releases/tag/0.7.2
Given GlibC is backward compatible, only Debian 12 and later will work with kubeswitch versions >= 0.7.2
I've tried to download the switcher binary directly instead of using a package manager. It returned an error about a missing glibc version. Are there any steps that I've missed? I (perhaps naively) thought that Go apps didn't ever have external dependencies.
produces this output
linux machine