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

Method duplication exception after running **v up** (pref.c.v and pref.v) #21636

Closed
cristovao opened this issue Jun 3, 2024 · 3 comments
Closed
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@cristovao
Copy link

cristovao commented Jun 3, 2024

Describe the bug

Being aware of version 0.4.6 I ran the v up command, but it returned an exception

Reproduction Steps

cristovao@cristovao-Predator-G3-572:~$ v -version
V 0.4.4 c9933da
cristovao@cristovao-Predator-G3-572:~$ v upgrade
Modules are up to date.
cristovao@cristovao-Predator-G3-572:~$ v up

Updating V...
Found `make` as `/usr/bin/make`.
Found `cc` as `/usr/bin/x86_64-linux-gnu-gcc-9`.
> make failed:
> make output:
make fresh_vc
make[1]: Entering directory '/opt/v'
rm -rf ./vc
git clone --filter=blob:none --quiet https://github.com/vlang/vc ./vc
make[1]: Leaving directory '/opt/v'
cd ./vc && git clean -xf && git pull --quiet
make fresh_tcc
make[1]: Entering directory '/opt/v'
rm -rf ./thirdparty/tcc
git clone --filter=blob:none --quiet --branch thirdparty-linux-amd64 https://github.com/vlang/tccbin ./thirdparty/tcc
make[2]: Entering directory '/opt/v'
make[2]: Leaving directory '/opt/v'
make[1]: Leaving directory '/opt/v'
cd ./thirdparty/tcc && git clean -xf && git pull --quiet
cc  -std=gnu99 -w -o v1.exe ./vc/v.c -lm -lpthread 
./v1.exe -no-parallel -o v2.exe  cmd/v
vlib/v/pref/pref.v:59:20: error: duplicate method `is_js`
   57 | }
   58 | 
   59 | pub fn (b Backend) is_js() bool {
      |                    ~~~~~
   60 |     return b in [
   61 |         .js_node,
make: *** [GNUmakefile:114: all] Error 1

Current V version: V 0.4.4 c9933da, timestamp: 2024-02-12 15:37:06 +0200
Recompiling V *failed*.
Found `make` as `/usr/bin/make`.
Found `cc` as `/usr/bin/x86_64-linux-gnu-gcc-9`.
Try running `make` .

Expected Behavior

Upgrade to 0.4.6 version

Current Behavior

vlib/v/pref/pref.v:59:20: error: duplicate method `is_js`
   57 | }
   58 | 
   59 | pub fn (b Backend) is_js() bool {
      |                    ~~~~~
   60 |     return b in [
   61 |         .js_node,
make: *** [GNUmakefile:114: all] Error 1

Possible Solution

Apparently, just removing the duplicate method is_js

Additional Information/Context

No response

V version

0.4.4

Environment details (OS name and version, etc.)

Ubuntu 20.04.6 LTS 64-bit

Intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8

NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] / Mesa Intel® HD Graphics 630 (KBL GT2)

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@cristovao cristovao added the Bug This tag is applied to issues which reports bugs. label Jun 3, 2024
@cristovao
Copy link
Author

The problem is that in two files one called pref.c.v and pref.v, in the documentation it said that this file was renamed, but in v up it is not considering this action, generating this conflict.

@cristovao cristovao changed the title Exception in the v up Method duplication exception after running **v up** (pref.c.v and pref.v) Jun 3, 2024
@JalonSolov
Copy link
Contributor

You somehow kept pref.c.v, which was renamed to just pref.v. You should only have pref.v in that directory.

Either just delete that file and try again (hoping you don't have any other files that should've been deleted), or do a full re-install of V.

There is an option to git to remove files that don't belong, but too many people complained because they were writing their own files in the V install dir, and didn't like when they got deleted. :-\

@cristovao
Copy link
Author

For this it would be important to have the user's space separated from the language itself and its resources, thus facilitating this update. Something like /lib and /usr/lib for example.

I did a clean install, because I didn't feel confident in simply deleting the file and restarting the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

2 participants