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

feat: shallow clone by hash #156

Merged
merged 9 commits into from
Sep 19, 2023
Merged

feat: shallow clone by hash #156

merged 9 commits into from
Sep 19, 2023

Conversation

lostl1ght
Copy link
Contributor

@lostl1ght lostl1ght commented Sep 18, 2023

Closes #155.

@lostl1ght lostl1ght marked this pull request as draft September 18, 2023 09:49
src/helpers/version/mod.rs Outdated Show resolved Hide resolved
@lostl1ght
Copy link
Contributor Author

lostl1ght commented Sep 18, 2023

Also, right after building I get an error:

thread 'main' panicked at 'Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:84:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

RUST_BACKTRACE=1 does not help.

But switching to another version (e.g. nightly) and back helps.

@MordechaiHadad
Copy link
Owner

Also, right after building I get an error:

thread 'main' panicked at 'Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:84:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

RUST_BACKTRACE=1 does not help.

But switching to another version (e.g. nightly) and back helps.

is that only happening when you are building(as in not executing any command/running neovim)

@lostl1ght
Copy link
Contributor Author

Also, right after building I get an error:

thread 'main' panicked at 'Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:84:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

RUST_BACKTRACE=1 does not help.
But switching to another version (e.g. nightly) and back helps.

is that only happening when you are building(as in not executing any command/running neovim)

I'm sorry I was not clear enough. This happens when I'm trying to execute neovim.

@MordechaiHadad
Copy link
Owner

Also, right after building I get an error:

thread 'main' panicked at 'Failed to spawn child process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:84:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

RUST_BACKTRACE=1 does not help.
But switching to another version (e.g. nightly) and back helps.

is that only happening when you are building(as in not executing any command/running neovim)

I'm sorry I was not clear enough. This happens when I'm trying to execute neovim.

Oh fair enough, ill have to check this issue.

@MordechaiHadad
Copy link
Owner

@lostl1ght any steps to take in order to recreate this issue?

@lostl1ght
Copy link
Contributor Author

lostl1ght commented Sep 18, 2023

Just these:

cargo r -- use 9cadbf1d36b63f53f0de48c8c5ff6c752ff05d70 # any hash really
$HOME/.local/share/bob/nvim-bin/nvim

Result: panic.

@lostl1ght
Copy link
Contributor Author

The problem is in the file used and the name of a directory to a version itself. The hash in the name of a directory is shortened and in the file used is not. I can't quite figure out when that happens.

@lostl1ght
Copy link
Contributor Author

I think I figured it out. Now everything works.

@lostl1ght lostl1ght marked this pull request as ready for review September 18, 2023 19:24
src/helpers/version/mod.rs Outdated Show resolved Hide resolved
@MordechaiHadad
Copy link
Owner

works nicely, two things that could be changed:

  • do a check in the build function that if it's not the full hash abort the operation and tell them to provide the full hash.
  • (optional, i can do later) disable the stdout for git init

@lostl1ght
Copy link
Contributor Author

disable the stdout for git init

Done. I've also disabled the stdout for remote get-url and checkout as they do not provide anything meaningful:

  • remote get-url prints the url of the remote if available and nothing otherwise
  • checkout just complains that HEAD is detached

@MordechaiHadad MordechaiHadad merged commit 5232182 into MordechaiHadad:master Sep 19, 2023
@MordechaiHadad
Copy link
Owner

@lostl1ght I will try creating a new release tomorrow. thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building from source takes longer than it should
2 participants