MordechaiHadad / bob

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

Add latest commit alias #195

Closed MordechaiHadad closed 5 months ago

MordechaiHadad commented 5 months ago

This PR will add head and git as alias for fetching the latest commit for neovim.

fixes #163

mikesmithgh commented 5 months ago

Hi @MordechaiHadad, I saw this on reddit and tested it out.

Using head, HEAD, or git all install the latest version of nvim with the commit 57adf8c.

When I attempt to use nvim in the nvim-bin directory, I receive an error.

~/.local/share/bob/nvim-bin 
mike@local $ ./nvim --version
thread 'main' panicked at 'Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/mike/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bob-nvim-2.5.0/src/main.rs:84:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It works fine if I use nvim in the nvim-macos-arm64/bin directory.

 ~/.local/share/bob/57adf8c/nvim-macos-arm64/bin 
mike@local $ ./nvim --version
NVIM v0.10.0-dev-57adf8c
Build type: RelWithDebInfo
LuaJIT 2.1.1710088188
Run "nvim -V1 -v" for more info

One thing to note is that I build nvim nightly myself and I also have multiple versions of nvim installed with bob. Before running the cargo install --git https://github.com/MordechaiHadad/bob --branch feat/git-alias command, I ran cargo uninstall bob-nvim. I was pointing to nvim v0.7.0 before testing this.

bob list
┌───────────┬─────────────┐
│  Version  │  Status     │
├───────────┼─────────────┤
│  v0.7.0   │  Installed  │
│  v0.9.1   │  Installed  │
│  v0.9.0   │  Installed  │
│  nightly  │  Installed  │
│  v0.8.3   │  Installed  │
│  v0.9.5   │  Installed  │
│  v0.9.2   │  Installed  │
│  v0.9.4   │  Installed  │
│  v0.8.0   │  Installed  │
│  57adf8c  │  Used       │
└───────────┴─────────────┘ 

Hope this helps. Let me know if you need any other info!

MordechaiHadad commented 5 months ago

Hi! Thank you for commenting. Could you show me the content of the 57adf8c folder?

Oh nvm you mentioned the content is nvim-arm-64, which is interesting it works for some but not for you.

I am planning on pushing another PR with approximate binary locator instead of hard coded (slightly slower but faster than a ms)

Could you copy your bob binary and copy it to bob/nvim-bin and rename it to nvim

Just for testing really.

mikesmithgh commented 5 months ago

I copied it over to bob/nvim-bin and it worked fine. 👍

After that, I switched back to v.0.7.0 and rm -rf 57adf8c the latest directory.

After running, bob use git, I get the same error. So, I can reproduce on my side if you need me to test anything out.

MordechaiHadad commented 5 months ago

I copied it over to bob/nvim-bin and it worked fine. 👍

After that, I switched back to v.0.7.0 and rm -rf 57adf8c the latest directory.

After running, bob use git, I get the same error. So, I can reproduce on my side if you need me to test anything out.

Hmmm confusing...

At first it worked after u recreated the nvim proxy, and then when you rebuild 57adf8c it failed basically?

mikesmithgh commented 5 months ago

I copied it over to bob/nvim-bin and it worked fine. 👍 After that, I switched back to v.0.7.0 and rm -rf 57adf8c the latest directory. After running, bob use git, I get the same error. So, I can reproduce on my side if you need me to test anything out.

Hmmm confusing...

At first it worked after u recreated the nvim proxy, and then when you rebuild 57adf8c it failed basically?

Sorry, I forgot to mention that I copied back the original nvim binary. I named it nvim.bak and copied it back to reproduce the issue. I retested without copying back the original and it worked. I added a video to hopefully help clarify. I just trimmed some of the time spent install latest.

https://github.com/MordechaiHadad/bob/assets/10135646/9eefec76-0252-4c30-ab09-98a388d42caa

MordechaiHadad commented 5 months ago

Ah so u returned back to the original binary, makes sense. So it does work for you since the old binary code doesn't support arm.

MordechaiHadad commented 5 months ago

Newest PR gonna fix all of the nvim proxy related issues now.

MordechaiHadad commented 5 months ago

@mikesmithgh can you do one last test (dont copy the old outdated neovim proxy) and see if works?

mikesmithgh commented 5 months ago

@mikesmithgh can you do one last test (dont copy the old outdated neovim proxy) and see if works?

Hey @MordechaiHadad, I completely removed bob and removed nvim in nvim-bin, reinstalled with cargo install bob-nvim and changed the version with bob use v0.7.0 to get back in the initial state to reproduce the issue.

Then ran:

cargo install --git https://github.com/MordechaiHadad/bob --branch feat/git-alias
bob use git
./nvim --version
NVIM v0.10.0-dev-2fc2343
Build type: RelWithDebInfo
LuaJIT 2.1.1710088188
Run "nvim -V1 -v" for more info

It looks like it is working now 👍.

I'm curious how it picked up changes since this branch doesn't appear to have any additional changes?

MordechaiHadad commented 5 months ago

I'm curious how it picked up changes since this branch doesn't appear to have any additional changes?

The proxy was outdated so it recreated it for you now, which is why it works now.

I guess its time to merge this.

mikesmithgh commented 5 months ago

🎉 awesome!