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

bob doesn't write files #181

Open
Steuv1871 opened this issue Jan 20, 2024 · 20 comments
Open

bob doesn't write files #181

Steuv1871 opened this issue Jan 20, 2024 · 20 comments

Comments

@Steuv1871
Copy link

Hi !

I'm trying to use bob on Raspberry Pi OS (Debian, arm64) and it seems bob can't write files.

Here's the output when I try to reproduce the command from the README gif :

$ bob install 0.8.1
Downloaded version v0.8.1 to /home/steuv/.local/share/bob/v0.8.1.appimage
  [00:00:08] [¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦] 14.65MiB/14.65MiB (1.80MiB/s, 0s)
Jan 20 11:14:07.395  INFO v0.8.1 has been successfully installed in /home/steuv/.local/share/bob
$ bob use 0.8.1
Downloaded version v0.8.1 to /home/steuv/.local/share/bob/v0.8.1.appimage
  [00:00:08] [¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦] 14.65MiB/14.65MiB (1.74MiB/s, 0s)
Jan 20 11:14:47.559  INFO You can now use v0.8.1!
$ bob ls
+-------------------------+
¦  Version  ¦  Status     ¦
+-----------+-------------¦
+-------------------------+
$ tree /home/steuv/.local/share/bob/
/home/steuv/.local/share/bob/
+-- nvim-bin
¦   +-- nvim
+-- used

1 directory, 2 files

I've checked the permission on bob directory for current user but it's ok:

$ ls /home/steuv/.local/share/ -al
   rwx------   5   steuv   steuv      4 KiB   Thu Jan 18 13:49:15 2024  ?  ./
   rwxr-xr-x   5   steuv   steuv      4 KiB   Tue Jan  9 21:06:55 2024  ?  ../
   rwxr-xr-x   3   steuv   steuv      4 KiB   Sat Jan 20 11:14:47 2024  ?  bob/
   ...

I've installed bob from cartes.io (cargo install bob-nvim) with no error.

I don't know where to start my troubleshout.
Any help will be appreciated !

@MordechaiHadad
Copy link
Owner

Something here is indeed weird lol, seems like it manages to write but not download and write files.
Try building neovim from source by passing bob install <commit-hash>

@Steuv1871
Copy link
Author

Steuv1871 commented Jan 20, 2024

Hey thanks for taking time to look upon my issue !

I've tried to build from source with version 0.9.0 (bob install 040f1459849ab05b04f6bb1e77b3def16b4c2f2b).
The build was a sucess after correcting a missing CMake dependency (gettext).

I got an installed version that works after bob use 040f145.

$bob ls
┌───────────┬─────────────┐
│  Version  │  Status     │
├───────────┼─────────────┤
│  040f145  │  Installed  │
└───────────┴─────────────┘

I tried again to bob install latest but the same appen again, nothing installed.

@MordechaiHadad
Copy link
Owner

That is very weird, can you try this command see what happens?
curl -LJO https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz

@Steuv1871
Copy link
Author

The curl works fine

$ curl -LJO https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 10.5M  100 10.5M    0     0   667k      0  0:00:16  0:00:16 --:--:--  618k

$ ls -l
(...)
   rw-r--r--    1   steuv   steuv     10 MiB   Tue Jan 23 18:07:55 2024  ?  nvim-linux64.tar.gz

I've tried in bob's directory and it works too.

$ cd .local/share/bob

$ curl -LJO https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 10.5M  100 10.5M    0     0  1017k      0  0:00:10  0:00:10 --:--:-- 1112k

$ ls -l
(...)
   rw-r--r--    1   steuv   steuv     10 MiB   Tue Jan 23 18:08:49 2024  ?  nvim-linux64.tar.gz

@MordechaiHadad
Copy link
Owner

The curl works fine

$ curl -LJO https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 10.5M  100 10.5M    0     0   667k      0  0:00:16  0:00:16 --:--:--  618k

$ ls -l
(...)
   rw-r--r--    1   steuv   steuv     10 MiB   Tue Jan 23 18:07:55 2024  ?  nvim-linux64.tar.gz

I've tried in bob's directory and it works too.

$ cd .local/share/bob

$ curl -LJO https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 10.5M  100 10.5M    0     0  1017k      0  0:00:10  0:00:10 --:--:-- 1112k

$ ls -l
(...)
   rw-r--r--    1   steuv   steuv     10 MiB   Tue Jan 23 18:08:49 2024  ?  nvim-linux64.tar.gz

I am honestly clueless, what happens if you run bob with sudo?

@Steuv1871
Copy link
Author

I've launched sudo ~/.cargo/bin/bob install latest, and it's exactly the same (download and then nothing).

If you don't want to investigat further, that's okay, I'm fine using commit hash for this project 😄
It might be a limitation specific to Rapsberry Pi OS, or a problem in my cargo compiler (works fine with other package like Alacritty).

But if you prefere to continue, I would be pleased to keep on trying, or came back later (I make regular snap shot of my rapsberry pi SD cards).

I'll close this issue on your cue.

@MordechaiHadad
Copy link
Owner

Ye all good, I wish I had a way to recreate this issue though.

@MordechaiHadad
Copy link
Owner

It's all good no need to close the issue

@MordechaiHadad
Copy link
Owner

@Steuv1871 what if u try downloading the binary provided in the github release for linux arm and try it?

@MordechaiHadad
Copy link
Owner

Another idea, what if u run it inside a docker container? Bob provided a dockerfile

@Steuv1871
Copy link
Author

I've been trying to build the image but it's too much for my pi zero, the build crash when the CPU is too hot.

I'll try tomorrow to build the image on my Pi 4, it should works as it's the same architecture.

I'll also try to do the install from the binary.

@MordechaiHadad
Copy link
Owner

I've been trying to build the image but it's too much for my pi zero, the build crash when the CPU is too hot.

I'll try tomorrow to build the image on my Pi 4, it should works as it's the same architecture.

I'll also try to do the install from the binary.

All good!

@Steuv1871
Copy link
Author

Forgot to post the test with the binary, but it still the same result:

$ curl -LJO https://github.com/MordechaiHadad/bob/releases/download/v2.8.0/bob-linux-aarch64.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 2314k  100 2314k    0     0   968k      0  0:00:02  0:00:02 --:--:-- 2240k

$ unzip bob-linux-aarch64.zip
Archive:  bob-linux-aarch64.zip
   creating: bob-linux-aarch64/
  inflating: bob-linux-aarch64/bob

$ cd bob-linux-aarch64

$ chmod +x bob

$ ./bob install latest
Feb 03 13:42:43.676  INFO Fetching latest version
Downloaded version v0.9.5 to /home/steuv/.local/share/bob/v0.9.5.appimage
  [00:00:04] [¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦] 10.66MiB/10.66MiB (2.13MiB/s, 0s)
Feb 03 13:42:49.646  INFO v0.9.5 has been successfully installed in /home/steuv/.local/share/bob

$ ./bob list
+-------------------------+
¦  Version  ¦  Status     ¦
+-----------+-------------¦
¦  040f145  ¦  Installed  ¦
¦  8744ee8  ¦  Used       ¦
+-------------------------+

Still having some issue to create the docker image (but I learn a lot on docker so it's cool 😄 ), will update when I'm finished.

@Steuv1871
Copy link
Author

Steuv1871 commented Feb 3, 2024

Ok, I managed to create the Docker image and run bob, but still the same result, no install append.
And the odd thing is that I did my test on a fresh new Raspberry Pi Os install on an other hardware (Raspberry Pi Zero 2 > Raspberry Pi 4). It's even a different Debian version (11 Bulleye > 12 Bookworm).

I tried to run an install from binary and an install from cargo crates, and still the same issue.
I'll try on a VM with Raspberry Pi Os and standard Debian to continue the test.

Log from Docker test:

$ git clone https://github.com/MordechaiHadad/bob.git
Cloning into 'bob'...
remote: Enumerating objects: 2680, done.
remote: Counting objects: 100% (2680/2680), done.
remote: Compressing objects: 100% (879/879), done.
remote: Total 2680 (delta 1762), reused 2577 (delta 1742), pack-reused 0
Receiving objects: 100% (2680/2680), 1.65 MiB | 13.27 MiB/s, done.
Resolving deltas: 100% (1762/1762), done.

$ cd bob/

$ sudo docker image build . -t bob:latest
[+] Building 1.7s (13/13) FINISHED                                                                                                                                                             docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                     0.1s
 => => transferring dockerfile: 447B                                                                                                                                                                     0.0s
 => [internal] load metadata for docker.io/library/rust:latest                                                                                                                                           1.1s
 => [internal] load .dockerignore                                                                                                                                                                        0.0s
 => => transferring context: 61B                                                                                                                                                                         0.0s
 => [1/8] FROM docker.io/library/rust:latest@sha256:87f3b2f93b82995443a1a558c234212dafe79cfdc3af956539610560369ddcd0                                                                                     0.0s
 => [internal] load build context                                                                                                                                                                        0.1s
 => => transferring context: 3.37kB                                                                                                                                                                      0.0s
 => CACHED [2/8] RUN useradd -m -s /bin/bash bobuser                                                                                                                                                     0.0s
 => CACHED [3/8] WORKDIR /app                                                                                                                                                                            0.0s
 => CACHED [4/8] COPY . .                                                                                                                                                                                0.0s
 => CACHED [5/8] RUN cargo build                                                                                                                                                                         0.0s
 => CACHED [6/8] RUN mkdir -p ~/.config/bob && echo '{"version_sync_file_location": "/home/bobuser/.config/nvim/nvim.version"}' > ~/.config/bob/config.json                                              0.0s
 => CACHED [7/8] RUN mkdir -p ~/.config/nvim                                                                                                                                                             0.0s
 => CACHED [8/8] RUN cp target/debug/bob /usr/local/bin/                                                                                                                                                 0.0s
 => exporting to image                                                                                                                                                                                   0.0s
 => => exporting layers                                                                                                                                                                                  0.0s
 => => writing image sha256:20948b6fca72c92684d4a2585208340d3751b6f82685ad1e003dadca57e13e1d                                                                                                             0.0s
 => => naming to docker.io/library/bob:latest                                                                                                                                                            0.0s

$ sudo docker image ls
REPOSITORY    TAG       IMAGE ID       CREATED          SIZE
bob           latest    20948b6fca72   26 minutes ago   2.97GB
hello-world   latest    ee301c921b8a   9 months ago     9.14kB

$ sudo docker container run -it bob:latest bob install latest
Feb 03 17:31:59.972  INFO Fetching latest version
Downloaded version v0.9.5 to /home/bobuser/.local/share/bob/v0.9.5.appimage
  [00:00:00] [¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦] 10.66MiB/10.66MiB (15.63MiB/s, 0s)
Feb 03 17:32:01.899  INFO v0.9.5 has been successfully installed in /home/bobuser/.local/share/bob

$ sudo docker container run -it bob:latest bob list
Feb 03 17:32:28.110 ERROR Error: There are no versions installed

@Steuv1871
Copy link
Author

Steuv1871 commented Feb 4, 2024

I think I've located the issue, and found a way for you to reproduce it 😄

I've tried on two local VM, one with Debian and one with "Raspberry Pi Os Desktop" (Debian Bulleseye), and it works with both of them. But it's an x86_64 architecture as it run on my PC, so I used the x86_64 linux package.

So I've tried on AWS, using an ARM architecture, and I reproduce the problem !
I think the issue might be with the aarch64 package.

Here's the config I used on AWS (it fits in the free tier):
image

@MordechaiHadad
Copy link
Owner

hmmm i see, I will try soon create a branch with debug log, download it and then show me what it outputs.

@MordechaiHadad
Copy link
Owner

Could you curl download this: https://github.com/neovim/neovim/releases/download/v0.9.5/nvim.appimage
and run those commands on it:

./nvim.appimage --appimage-extract
./squashfs-root/usr/bin/nvim

@Steuv1871
Copy link
Author

It's not working, I got an error message from the app image :

$./nvim.appimage --appimage-extract
./nvim.appimage: 1: Not: not found

But it's logical, the app image must be built on Intel architecture and not arm (they only tell 'x64' on the release page, but as there is no specific appimage for arm architecture, it must be an Intel arch).

So if you use an appimage extraction, that explain why there is nothing after download, the extract return an error.

@MordechaiHadad
Copy link
Owner

Ah fair enough, I'll keep this one open with the macos arm issue as well. So you will be notified when full arm support exists (GitHub just needs to add arm machines to GitHub actions)

@Steuv1871
Copy link
Author

Thanks for the time you've taken on this issue.

Yeah, I hope they'll add arm support too sometimes soon !

@MordechaiHadad MordechaiHadad pinned this issue Feb 22, 2024
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

No branches or pull requests

2 participants