DarthSim / overmind

Process manager for Procfile-based applications and tmux
MIT License
2.84k stars 79 forks source link

Overmind installer installs wrong binary for `aarch64-linux` (and `aarch64-linux-musl`) #185

Open htruong opened 2 months ago

htruong commented 2 months ago

On Raspberry Pi OS (where ruby -e "puts Gem::Platform.local" prints aarch64-linux) and docker (same command prints aarch64-linux-musl), the installer installs the wrong binary for x86-64:

$ ruby -e "puts Gem::Platform.local"
aarch64-linux

$ sudo gem install overmind --verbose
HEAD https://index.rubygems.org/
200 OK
GET https://index.rubygems.org/info/overmind
200 OK
GET https://index.rubygems.org/quick/Marshal.4.8/overmind-2.5.1.gemspec.rz
200 OK
Downloading gem overmind-2.5.1.gem
GET https://index.rubygems.org/gems/overmind-2.5.1.gem
Fetching overmind-2.5.1.gem
200 OK
/var/lib/gems/2.7.0/gems/overmind-2.5.1/LICENSE.txt
/var/lib/gems/2.7.0/gems/overmind-2.5.1/bin/overmind
/var/lib/gems/2.7.0/gems/overmind-2.5.1/lib/overmind.rb
/var/lib/gems/2.7.0/gems/overmind-2.5.1/lib/overmind/cli.rb
/var/lib/gems/2.7.0/gems/overmind-2.5.1/lib/overmind/version.rb
/var/lib/gems/2.7.0/gems/overmind-2.5.1/libexec/overmind
/var/lib/gems/2.7.0/gems/overmind-2.5.1/libexec/prebuilt-tmux/bin/tmux
/var/lib/gems/2.7.0/gems/overmind-2.5.1/overmind.gemspec
/usr/local/bin/overmind
Successfully installed overmind-2.5.1
Parsing documentation for overmind-2.5.1
Parsing sources...
100% [ 5/ 5]  libexec/prebuilt-tmux/bin/tmux
Installing ri documentation for overmind-2.5.1
Done installing documentation for overmind after 0 seconds
1 gem installed

$ file /var/lib/gems/2.7.0/gems/overmind-2.5.1/libexec/overmind
/var/lib/gems/2.7.0/gems/overmind-2.5.1/libexec/overmind: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=[sniped], stripped

When overriding platform argument, the installer still has some small troubles getting the correct version (it downloaded the 32-bit arm version instead of the arm64 version):

# gem install overmind --platform arm64-linux --verbose
HEAD https://index.rubygems.org/
200 OK
GET https://index.rubygems.org/info/overmind
200 OK
/usr/local/bundle/gems/overmind-2.5.1-arm-linux/LICENSE.txt
/usr/local/bundle/gems/overmind-2.5.1-arm-linux/bin/overmind
/usr/local/bundle/gems/overmind-2.5.1-arm-linux/lib/overmind.rb
/usr/local/bundle/gems/overmind-2.5.1-arm-linux/lib/overmind/cli.rb
/usr/local/bundle/gems/overmind-2.5.1-arm-linux/lib/overmind/version.rb
/usr/local/bundle/gems/overmind-2.5.1-arm-linux/libexec/overmind
/usr/local/bundle/gems/overmind-2.5.1-arm-linux/libexec/prebuilt-tmux/bin/tmux
/usr/local/bundle/gems/overmind-2.5.1-arm-linux/overmind.gemspec
/usr/local/bundle/bin/overmind
Successfully installed overmind-2.5.1-arm-linux
1 gem installed

# file /usr/local/bundle/gems/overmind-2.5.1-arm-linux/libexec/overmind
/usr/local/bundle/gems/overmind-2.5.1-arm-linux/libexec/overmind: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, Go BuildID=[...], stripped

This issue, in turns, caused HostedGPT to loop and not able to start on Raspberry Pi.

krschacht commented 2 months ago

@DarthSim could you confirm this is indeed an issue and not some expected behavior? If you could point to the root cause, I could attempt a fix. I spent awhile digging through the overmind repo and could not find the source of the issue.

henrikbjorn commented 1 month ago

I think this might be related. But on a Mac running overmind I saw that tmux was running as rosetta also.