vlang / v-analyzer

The @vlang language server, for all your editing needs like go-to-definition, code completion, type hints, and more.
MIT License
109 stars 15 forks source link

v-analyzer up doesn't write the new binary #11

Closed katekyy closed 6 months ago

katekyy commented 9 months ago

Describe the bug

When v-analyzer up is ran, it looks like it's updating itself correctly. But when you check the version after the update it is still the same.

$ v-analyzer up
Checking for updates...
Fetching latest release info from GitHub...
Found new version of v-analyzer: 0.0.3-beta.1
> Download from url: https://github.com/v-analyzer/v-analyzer/releases/download/0.0.3-beta.1/v-analyzer-linux-x86_64.zip ...
Downloading v-analyzer archive...
✓ Successfully downloaded v-analyzer archive
Extracting v-analyzer archive...
✓ Successfully extracted v-analyzer archive
✓ v-analyzer successfully updated to 0.0.3-beta.1
Path to the binary: /home/katekyy/.config/v-analyzer/bin/v-analyzer

$ v-analyzer version
v-analyzer version 0.0.1-beta.1

Expected Behavior

I expected the update command to update the v-analyzer binary.

Current Behavior

Currently it does not update the v-analyzer. It seems like it cannot write to it, because it doesn't get edited, but there's no error.

Reproduction Steps

I unfortunately can't provide a self-contained snippet of code for that but you'll get the idea from this:

$ v-analyzer up
Checking for updates...
Fetching latest release info from GitHub...
Found new version of v-analyzer: 0.0.3-beta.1
> Download from url: https://github.com/v-analyzer/v-analyzer/releases/download/0.0.3-beta.1/v-analyzer-linux-x86_64.zip ...
Downloading v-analyzer archive...
✓ Successfully downloaded v-analyzer archive
Extracting v-analyzer archive...
✓ Successfully extracted v-analyzer archive
✓ v-analyzer successfully updated to 0.0.3-beta.1
Path to the binary: /home/katekyy/.config/v-analyzer/bin/v-analyzer

$ cd /home/katekyy/.config/v-analyzer

$ ls -l bin 
.rwxr-xr-x 5.6M katekyy 11 Aug 2023 v-analyzer
                        ^^^^^^^^^^^

Possible Solution

A workaround is to remove the binary from the bin directory. And then run ./install

Additional Information/Context

No response

Environment details (v doctor output)

V full version: V 0.4.4 8f76a06.0c4611f
OS: linux, Linux version 6.1.71-1-lts (linux-lts@archlinux) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU Binutils) 2.41.0) #1 SMP PREEMPT_DYNAMIC Fri, 05 Jan 2024 15:35:19 +0000
Processor: 8 cpus, 64bit, little endian, 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz

getwd: /home/katekyy/.config/v-analyzer
vexe: /home/katekyy/.local/share/v/v
vexe mtime: 2024-01-12 14:23:09

vroot: OK, value: /home/katekyy/.local/share/v
VMODULES: OK, value: /home/katekyy/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.43.0
Git vroot status: 0.4.4-23-g0c4611fa-dirty (16 commit(s) behind V master)
.git/config present: true

CC version: cc (GCC) 13.2.1 20230801
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3

Editor name

unimportant

v-analyzer Version

v-analyzer version 0.0.3-beta.1.a796f25

mamoss-oss commented 9 months ago

I think you should reinstall from https://github.com/vlang/v-analyzer/ as your v-analyzer points to the former repository https://github.com/v-analyzer/v-analyzer/. Then try the update option again.

katekyy commented 9 months ago

I think you should reinstall from https://github.com/vlang/v-analyzer/ as your v-analyzer points to the former repository https://github.com/v-analyzer/v-analyzer/. Then try the update option again.

Either I'm doing something wrong or it doesn't work. Because I guess it works for you, right?

mamoss-oss commented 9 months ago

Yes, works for me. When running an update it also points to the correct repository. Have you tried a clean install ?

❯ v-analyzer up
Checking for updates...
Fetching latest release info from GitHub...
Found new version of v-analyzer: 0.0.4-beta.1
> Download from url: https://github.com/vlang/v-analyzer/releases/download/0.0.4-beta.1/v-analyzer-linux-x86_64.zip ...
Downloading v-analyzer archive..
✓ Successfully downloaded v-analyzer archive
Extracting v-analyzer archive...
✓ Successfully extracted v-analyzer archive
✓ v-analyzer successfully updated to 0.0.4-beta.1
Path to the binary: /home/user/.config/v-analyzer/bin/v-analyzer
katekyy commented 9 months ago

Yes it points to the new repo now but still doesn't work. It works only when doing v -e "$(cat ./install.vsh)" up or ./install up

prantlf commented 7 months ago

If you want to avoid confusion with the original repo path (https://github.com/v-analyzer/v-analyzer/), release a new version of the VS extension, which would stop pointing to the original repo and start pointing to this one.

JalonSolov commented 7 months ago

Yes it points to the new repo now but still doesn't work. It works only when doing v -e "$(cat ./install.vsh)" up or ./install up

You should only need to do v run install.vsh up - no need for the extra cat, etc.

bramvbilsen commented 7 months ago

Yes it points to the new repo now but still doesn't work. It works only when doing v -e "$(cat ./install.vsh)" up or ./install up

I am experiencing the same. I am certain that I am using the correct repo, but v-analyzer up breaks the analyzer for me. It might output everything is fine, but when trying to use after the update, it just crashes. I have been uninstalling and re-installing whenever I want to update.

ttytm commented 7 months ago

@bramvbilsen you have the chance to try compiling and using a v-analyzer binary from the linked PR to check if the up command is still breaking things for you?