Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation script hangs at 100% without showing interactive prompt #692

Closed
curlykay opened this issue Jan 7, 2025 · 10 comments · Fixed by moonrepo/moon#1786
Closed

Installation script hangs at 100% without showing interactive prompt #692

curlykay opened this issue Jan 7, 2025 · 10 comments · Fixed by moonrepo/moon#1786
Assignees
Labels
bug Something isn't working

Comments

@curlykay
Copy link

curlykay commented Jan 7, 2025

What version?

0.44.3

Which command?

curl -fsSL https://moonrepo.dev/install/proto.sh | bash

What happened?

I'm experiencing an issue with the proto installation script:

When running the script:

  curl -fsSL https://moonrepo.dev/install/proto.sh | bash

It hangs at 100% without any further output:

  ######################################################################## 100.0%

At this point, the terminal becomes unresponsive, and no further commands can be executed. The only way to regain control is to forcibly close the terminal session.

After restarting the terminal,the ~/.protobinary is correctly downloaded, but there's no "interactive prompt" as mentioned in the documentation. The script seems unable to complete the installation process or display the expected prompt.

However, I found a workaround: Using the command curl -fsSL https://moonrepo.dev/install/proto.sh | bash -s -- --yes skips the "interactive prompt". With this method, proto is correctly downloaded and the path is properly added to .zshrc. After restarting the terminal, I can use the proto command normally.

Despite the workaround, could you please investigate why the original command doesn't show the interactive prompt as expected? This might confuse users who are following the standard installation instructions.

my context:

                    'c.          
                 ,xNMM.          
               .OMMMMo           OS: macOS 15.2 24C101 arm64 
               OMMM0,            Host: Mac16,8 
     .;loddo:' loolloddol;.      Kernel: 24.2.0 
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 1 day, 14 hours, 40 mins 
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 9 (brew) 
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.9 
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1512x982 
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua 
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor 
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Dark) 
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: Apple_Terminal 
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   Terminal Font: SFMono-Regular 
    kMMMMMMMMMMMMMMMMMMMMMMd     CPU: Apple M4 Pro 
     ;KMMMMMMMWXXWMMMMMMMk.      GPU: Apple M4 Pro 
       .cooc,.    .,coo:.        Memory: 5956MiB / 49152MiB 

Trace logs?

No response

Operating system?

MacOS

Architecture?

arm64

@curlykay curlykay added the bug Something isn't working label Jan 7, 2025
@milesj
Copy link
Contributor

milesj commented Jan 7, 2025

@curlykay I ran this and it worked:

 curl -fsSL https://moonrepo.dev/install/proto.sh | bash
######################################################################## 100.0%

│ SUCCESS
│ Successfully installed proto to /Users/miles/.proto/bin/proto!
│ Need help? Join our Discord https://discord.gg/qCh9MEynv2

What shell are you using? I'm assuming zsh based on the snippet above.

Can you try running the install script again with PROTO_LOG=trace PROTO_DEBUG=true set and see what it spits out.

PROTO_DEBUG=true PROTO_LOG=trace bash -c 'curl -fsSL https://moonrepo.dev/install/proto.sh | bash'

@milesj
Copy link
Contributor

milesj commented Jan 7, 2025

I released 0.44.4 with some potential fixes for this. Let me know how it goes.

@curlykay
Copy link
Author

curlykay commented Jan 8, 2025

I performed a reinstallation and obtained the following log:

~ % PROTO_DEBUG=true PROTO_LOG=trace bash -c 'curl -fsSL https://moonrepo.dev/install/proto.sh | bash'
######################################################################## 100.0%
[TRACE 2025-01-08 09:23:53.259] starbase_console::console  Creating buffered console 
[DEBUG 09:23:53.260] proto  Running proto v0.44.4  bin="/Users/ck/.proto/bin/proto" args=["setup"] pid=44805
[TRACE 09:23:53.260] starbase::app  Running startup phase 
[DEBUG 09:23:53.260] proto_core::proto  Creating proto environment, detecting store  store="/Users/ck/.proto" home="/Users/ck"
[TRACE 09:23:53.260] starbase::app  Running analyze phase 
[DEBUG 09:23:53.260] proto::systems  Loading configuration in upwards-global mode  working_dir="/Users/ck"
[DEBUG 09:23:53.260] proto_core::proto_config  Merging loaded configs with global 
[DEBUG 09:23:53.261] proto_core::proto_config  Merged 0 configs 
[DEBUG 09:23:53.261] proto_core::proto_config  Merging loaded configs without global 
[DEBUG 09:23:53.261] proto_core::proto_config  Merged 0 configs 
[TRACE 09:23:53.261] starbase::app  Running execute phase 
[DEBUG 09:23:53.261] proto::commands::setup  Determining the shell to use 
[DEBUG 09:23:53.261] starbase_shell::shell  Attempting to detect the current shell 
[DEBUG 09:23:53.261] starbase_shell::shell  Detecting from SHELL environment variable  env="/bin/zsh"
[DEBUG 09:23:53.261] starbase_shell::shell  Detected zsh shell 
[DEBUG 09:23:53.261] proto::commands::setup  Updating PATH in zsh shell 
[DEBUG 09:23:53.261] proto::commands::setup  Prompting the user to select a shell profile 
[DEBUG 09:23:53.261] proto::shell  Finding profile files for zsh 

After that, the only way to regain control of the terminal was still to forcibly close the terminal session.
My shell is Mac Terminal.app + zsh.

@curlykay
Copy link
Author

curlykay commented Jan 8, 2025

Here is the complete view:
image
Apart from the printed logs, the subsequent progress aligns with my initial feedback.

@milesj
Copy link
Contributor

milesj commented Jan 8, 2025

Hrmm so odd, let me try and recreate it somehow.

@milesj
Copy link
Contributor

milesj commented Jan 8, 2025

Was able to reproduce it with this script!

#!/usr/bin/env bash
set -eo pipefail

echo "> Changing PATH"
echo "  Before=$PATH"

newPath="$PATH"

shimsDir="$HOME/.proto/shims:"
newPath=${newPath/"$shimsDir"/""}

binsDir="$HOME/.proto/bin:"
newPath=${newPath/"$binsDir"/""}

echo ""
echo "  After=$newPath"

export PATH="$newPath"

echo "> Running setup"

echo "" | cargo run -- setup --log trace

It seems like piping is what causes it. If I remove the echo "" | at the end, it works as expected. So I'm assuming the | bash in the original snippet is hanging. Digging further.

@milesj
Copy link
Contributor

milesj commented Jan 8, 2025

I temporarily updated the install.sh script to not prompt, so it should unblock people for now.

@curlykay
Copy link
Author

curlykay commented Jan 8, 2025

When do I need to try again?

@curlykay
Copy link
Author

curlykay commented Jan 8, 2025

I've just made the latest attempt and it's already installed without any problems, thanks for debugging!

@milesj
Copy link
Contributor

milesj commented Jan 9, 2025

Fixed in the next version and once this lands: moonrepo/moon#1786

Had to change the command to install though so that stdin works correctly.

@milesj milesj closed this as completed Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants