MordechaiHadad / bob

A version manager for neovim
MIT License
1.41k stars 36 forks source link

Better version compatablity for older versions #190

Closed MordechaiHadad closed 5 months ago

MordechaiHadad commented 5 months ago

This change includes:

fixes #188

jellydn commented 5 months ago

FYI - I've just tested with this PR and got the below error.

cargo build --release

./target/release/bob --version
bob-nvim 2.8.2

./target/release/bob install nightly
Mar 26 21:07:25.700 ERROR Error: Please provide an existing neovim version
MordechaiHadad commented 5 months ago

FYI - I've just tested with this PR and got the below error.

cargo build --release

./target/release/bob --version
bob-nvim 2.8.2

./target/release/bob install nightly
Mar 26 21:07:25.700 ERROR Error: Please provide an existing neovim version

1 moment I will push some debug stuff

MordechaiHadad commented 5 months ago

@jellydn could you try this commit, (wont fix anything simply watching to see what is the URL bob is requesting). btw you dont need to build by yourself, simply use of the artifacts the CI creates.

markfeinstein commented 5 months ago

I'm seeing the same issue. Testing with the latest commit I get this.

Mar 26 07:45:52.202  INFO Request URL: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
Mar 26 07:45:52.539 ERROR Error: Please provide an existing neovim version, Not Found
jellydn commented 5 months ago

Here is the debugging.

./target/release/bob use nightly
Mar 26 22:49:14.944  INFO Request URL: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
Mar 26 22:49:15.465 ERROR Error: Please provide an existing neovim version, Not Found
MordechaiHadad commented 5 months ago

Here is the debugging.

./target/release/bob use nightly
Mar 26 22:49:14.944  INFO Request URL: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
Mar 26 22:49:15.465 ERROR Error: Please provide an existing neovim version, Not Found

Should work now I hope, i forgot to change one duplicate condition

jellydn commented 5 months ago
./target/release/bob use nightly
Mar 26 23:00:59.988  INFO Request URL: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
Mar 26 23:01:00.424 ERROR Error: Please provide an existing neovim version, Not Found
./target/release/bob use stable
Mar 26 23:01:12.166  INFO Fetching latest version
Mar 26 23:01:13.014  INFO Request URL: https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-macos.tar.gz
Downloaded version v0.9.5 to /Users/huynhdung/.local/share/bob/v0.9.5.tar.gz
  [00:00:00] [████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 10.68MiB/10.68MiB (13.25MiB/s, 0s)
Finished expanding to /Users/huynhdung/.local/share/bob/v0.9.5
  [00:00:00] [█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 1692/1692
Mar 26 23:01:16.153  INFO You can now use v0.9.5!

./target/release/bob ls
┌───────────┬─────────────┐
│  Version  │  Status     │
├───────────┼─────────────┤
│  v0.9.5   │  Used       │
│  02d00cf  │  Installed  │
└───────────┴─────────────┘
./target/release/bob use stable
Mar 26 23:01:57.043  INFO Fetching latest version
Mar 26 23:01:57.955  INFO v0.9.5 is already installed and used!
vi
thread 'main' panicked at /Users/huynhdung/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bob-nvim-2.8.2/src/main.rs:85:14:
Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Almost there :)

MordechaiHadad commented 5 months ago

@jellydn @markfeinstein should work now

jellydn commented 5 months ago

Not yet ;)

./target/release/bob use nightly

Mar 27 00:04:12.930  INFO Request URL: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz
Downloaded version nightly to /Users/huynhdung/.local/share/bob/nightly.tar.gz
  [00:00:00] [██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 8.77MiB/8.77MiB (12.72MiB/s, 0s)
thread 'main' panicked at src/handlers/install_handler.rs:244:61:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: bob::handlers::install_handler::download_version::{{closure}}
   5: bob::handlers::install_handler::start::{{closure}}
   6: bob::handlers::use_handler::start::{{closure}}
   7: bob::cli::start::{{closure}}
   8: tokio::runtime::park::CachedParkThread::block_on
   9: tokio::runtime::context::runtime::enter_runtime
  10: tokio::runtime::runtime::Runtime::block_on
  11: bob::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
./target/release/bob use stable
Mar 27 00:04:21.727  INFO Fetching latest version
Mar 27 00:04:23.405  INFO v0.9.5 is already installed and used!
nvim
thread 'main' panicked at /Users/huynhdung/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bob-nvim-2.8.2/src/main.rs:85:14:
Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: tokio::runtime::park::CachedParkThread::block_on
   4: tokio::runtime::context::runtime::enter_runtime
   5: tokio::runtime::runtime::Runtime::block_on
   6: bob::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
MordechaiHadad commented 5 months ago

Not yet ;)

./target/release/bob use nightly

Mar 27 00:04:12.930  INFO Request URL: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz
Downloaded version nightly to /Users/huynhdung/.local/share/bob/nightly.tar.gz
  [00:00:00] [██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 8.77MiB/8.77MiB (12.72MiB/s, 0s)
thread 'main' panicked at src/handlers/install_handler.rs:244:61:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: bob::handlers::install_handler::download_version::{{closure}}
   5: bob::handlers::install_handler::start::{{closure}}
   6: bob::handlers::use_handler::start::{{closure}}
   7: bob::cli::start::{{closure}}
   8: tokio::runtime::park::CachedParkThread::block_on
   9: tokio::runtime::context::runtime::enter_runtime
  10: tokio::runtime::runtime::Runtime::block_on
  11: bob::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
./target/release/bob use stable
Mar 27 00:04:21.727  INFO Fetching latest version
Mar 27 00:04:23.405  INFO v0.9.5 is already installed and used!
nvim
thread 'main' panicked at /Users/huynhdung/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bob-nvim-2.8.2/src/main.rs:85:14:
Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: tokio::runtime::park::CachedParkThread::block_on
   4: tokio::runtime::context::runtime::enter_runtime
   5: tokio::runtime::runtime::Runtime::block_on
   6: bob::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Different errors, means progress!

jellydn commented 5 months ago

Great. One more.

cargo build --release
   Compiling bob-nvim v2.8.2 (/Users/huynhdung/Projects/research/bob)
    Finished release [optimized] target(s) in 3.98s
./target/release/bob use stable
Mar 27 00:22:16.456  INFO Fetching latest version
Mar 27 00:22:17.393  INFO v0.9.5 is already installed and used!
vi
thread 'main' panicked at /Users/huynhdung/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bob-nvim-2.8.2/src/main.rs:85:14:
Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: tokio::runtime::park::CachedParkThread::block_on
   4: tokio::runtime::context::runtime::enter_runtime
   5: tokio::runtime::runtime::Runtime::block_on
   6: bob::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
./target/release/bob use nightly
Mar 27 00:22:26.800  INFO Request URL: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz
Downloaded version nightly to /Users/huynhdung/.local/share/bob/nightly.tar.gz
  [00:00:00] [██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 8.77MiB/8.77MiB (11.35MiB/s, 0s)
Finished expanding to /Users/huynhdung/.local/share/bob/nightly
  [00:00:00] [█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 1692/1692
Mar 27 00:22:28.945  INFO You can now use nightly!
vi --version
thread 'main' panicked at /Users/huynhdung/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bob-nvim-2.8.2/src/main.rs:85:14:
Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: tokio::runtime::park::CachedParkThread::block_on
   4: tokio::runtime::context::runtime::enter_runtime
   5: tokio::runtime::runtime::Runtime::block_on
   6: bob::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
nvim --version
thread 'main' panicked at /Users/huynhdung/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bob-nvim-2.8.2/src/main.rs:85:14:
Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: tokio::runtime::park::CachedParkThread::block_on
   4: tokio::runtime::context::runtime::enter_runtime
   5: tokio::runtime::runtime::Runtime::block_on
   6: bob::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
MordechaiHadad commented 5 months ago

@jellydn should work now I think

skoch13 commented 5 months ago

these commit messages just made my day :D

jellydn commented 5 months ago
./target/release/bob erase
Mar 27 00:32:39.405  INFO Successfully removed neovim's installation folder
Mar 27 00:32:40.332  INFO Successfully removed neovim downloads folder
./target/release/bob erase
Mar 27 00:32:41.993  INFO Successfully removed neovim downloads folder
./target/release/bob use nightly
Mar 27 00:32:45.708  INFO Request URL: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz
Downloaded version nightly to /Users/huynhdung/.local/share/bob/nightly.tar.gz
  [00:00:00] [██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 8.77MiB/8.77MiB (10.15MiB/s, 0s)
Finished expanding to /Users/huynhdung/.local/share/bob/nightly
  [00:00:00] [█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 1692/1692
Mar 27 00:32:47.837  INFO You can now use nightly!
nvim --version
Mar 27 00:32:50.610 ERROR Error: unexpected character 'n' while parsing major version number

New error ;)

MordechaiHadad commented 5 months ago
./target/release/bob erase
Mar 27 00:32:39.405  INFO Successfully removed neovim's installation folder
Mar 27 00:32:40.332  INFO Successfully removed neovim downloads folder
./target/release/bob erase
Mar 27 00:32:41.993  INFO Successfully removed neovim downloads folder
./target/release/bob use nightly
Mar 27 00:32:45.708  INFO Request URL: https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz
Downloaded version nightly to /Users/huynhdung/.local/share/bob/nightly.tar.gz
  [00:00:00] [██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 8.77MiB/8.77MiB (10.15MiB/s, 0s)
Finished expanding to /Users/huynhdung/.local/share/bob/nightly
  [00:00:00] [█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████] 1692/1692
Mar 27 00:32:47.837  INFO You can now use nightly!
nvim --version
Mar 27 00:32:50.610 ERROR Error: unexpected character 'n' while parsing major version number

New error ;)

should work now, i got the same error on winblows

MordechaiHadad commented 5 months ago

these commit messages just made my day :D

Thanks I cant name anything

skoch13 commented 5 months ago

Thanks I cant name anything

I can relate to your frustration, but hope it's going to be fixed very soon

MordechaiHadad commented 5 months ago

Thanks I cant name anything

I can relate to your frustration, but hope it's going to be fixed very soon

It should work now, so just test this commit

MordechaiHadad commented 5 months ago

@jellydn @skoch13 feel like testing this? would be last test for today if it doesnt work

skoch13 commented 5 months ago

@jellydn @skoch13 feel like testing this? would be last test for today if it doesnt work

I hope I did everything right, but unfortunately it didn't work:

./target/release/bob install nightly
Mar 26 18:51:39.916  INFO Looking for nightly updates
Mar 26 18:51:40.074 ERROR Error: No such file or directory (os error 2)
skoch13 commented 5 months ago

hm, wait. once I did erase and use bob managed to download the proper version.

+ stable version is being downloaded properly

skoch13 commented 5 months ago

I have redone my tests from scratch. Everything works like a charm! ✨

MordechaiHadad commented 5 months ago

I have redone my tests from scratch. Everything works like a charm! ✨

LETS GOOOOOOO