Skip to content

Commit

Permalink
Revert PRs #457 and 459 related to overmind & bin/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
krschacht committed Jul 14, 2024
1 parent 86a31b9 commit 120cd4e
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions bin/dev
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,6 @@ if ! gem list overmind -i --silent; then
gem install overmind
fi

# Check and fixup for overmind bug on aarch64-linux
# Remove once #185 is fixed for overmind
# https://github.com/DarthSim/overmind/issues/185
RUBY_PLATFORM=$(ruby -e "puts Gem::Platform.local")
if [[ "$RENDER" != "true" && $RUBY_PLATFORM == aarch64-linux* ]]; then

OVERMIND_DIR=$(ruby -e 'puts Gem::Specification.find_by_name("overmind").gem_dir')
OVERMIND_BIN=$(ruby -e 'puts Gem::bin_path("overmind", "overmind")')

# Probe the binary to see if it fails to execute
if ! "$OVERMIND_BIN" -v >/dev/null 2>&1 || ! "$OVERMIND_DIR/libexec/prebuilt-tmux/bin/tmux" -V >/dev/null 2>&1 ; then
echo "Overmind or tmux failed to excute correctly, perhaps wrong arch."
echo "WORKAROUND: Forcefully overwriting wrong overmind binaries for arm64 linux..."
wget -qO- https://github.com/DarthSim/overmind/releases/download/v2.5.1/overmind-v2.5.1-linux-arm64.gz | zcat > "$OVERMIND_DIR/libexec/overmind"
wget -qO- https://github.com/DarthSim/overmind/releases/download/v2.4.0/tmux-v3.4-linux-arm64.tar.gz | tar xvz -C "$OVERMIND_DIR/libexec/prebuilt-tmux"

# Confirm that our workaround works
if ! "$OVERMIND_BIN" -v >/dev/null 2>&1 || ! "$OVERMIND_DIR/libexec/prebuilt-tmux/bin/tmux" -V >/dev/null 2>&1; then
echo "Somehow the workaround for Overmind didn't work, either. Unable to proceed."
echo "Please visit https://github.com/AllYourBot/hostedgpt/discussions/406 to see if there is anything you can do."
exit 1
fi
fi
fi


bundle install
bin/rails db:prepare

Expand All @@ -42,4 +16,4 @@ exec overmind start -f Procfile.dev "$@" &
PID=$!
wait $PID
trap - TERM INT
wait $PID
wait $PID

0 comments on commit 120cd4e

Please sign in to comment.