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

make fails #190

Open
gshields opened this issue Jan 28, 2024 · 9 comments
Open

make fails #190

gshields opened this issue Jan 28, 2024 · 9 comments

Comments

@gshields
Copy link

v install elliotchance.vsql
ran make
/.vmodules/elliotchance/vsql$ make bin/vsql
grep "//" -r vsql | cut -d -f2 > grammar.bnf
python3 generate-grammar.py
v fmt -w vsql/grammar.v
Reformatted file: /home/ghs/.vmodules/elliotchance/vsql/vsql/grammar.v
mkdir -p bin
v -prod cmd/vsql -o bin/vsql
cmd/vsql/bench.v:4:1: builder error: cannot import module "vsql" (no .v files in "/home/ghs/.vmodules/vsql")
2 |
3 | import cli
4 | import vsql
| ~~~~~~~~~~~
5 |
6 | fn register_bench_command(mut cmd cli.Command) {
make: *** [Makefile:28: bin/vsql] Error 1

@elliotchance
Copy link
Owner

v install is when you want to use the package in your V code. If you want to build it from scratch you need to clone the repo: https://vsql.readthedocs.io/en/latest/install.html#compiling-from-source

@gshields
Copy link
Author

gshields commented Jan 28, 2024 via email

@elliotchance
Copy link
Owner

What OS are you using? I have tried to run the same commands on macOS:

Elliots-MacBook-Pro:~ elliot$ git clone https://github.com/elliotchance/vsql.git
Cloning into 'vsql'...
remote: Enumerating objects: 3027, done.
remote: Counting objects: 100% (813/813), done.
remote: Compressing objects: 100% (345/345), done.
remote: Total 3027 (delta 580), reused 506 (delta 468), pack-reused 2214
Receiving objects: 100% (3027/3027), 2.49 MiB | 20.86 MiB/s, done.
Resolving deltas: 100% (2255/2255), done.
Elliots-MacBook-Pro:~ elliot$ cd vsql/
Elliots-MacBook-Pro:vsql elliot$ make bin/vsql
grep "//~" -r vsql | cut -d~ -f2 > grammar.bnf
python3 generate-grammar.py
v fmt -w vsql/grammar.v
Reformatted file: /Users/elliot/vsql/vsql/grammar.v
mkdir -p bin
v  -prod cmd/vsql -o bin/vsql

I wonder is V is confused by the path that it's being run in?

@gshields
Copy link
Author

gshields commented Jan 29, 2024 via email

@elliotchance
Copy link
Owner

I suspect V doesn't resolve the symlink correctly. However, it also seems very suspect to me the way it's being cloned into what is basically a cache directory (that's why it's hidden).

If you really want to do it this way, I guess try running make from ~/.vmodules - if that doesn't work you'll have to raise a bug with V.

Perhaps this is helpful: vlang/v#16946

@elliotchance
Copy link
Owner

@spytheman
Copy link
Contributor

Latest V 804a7bd has the vfmt patch.

Using it (just v up), make followed by make bin/vsql will work inside ~/.vmodules too.

@gshields
Copy link
Author

gshields commented Jan 29, 2024 via email

@spytheman
Copy link
Contributor

#0 20:10:40 ᛋ master /v/oo❱rm -rf ~/.vmodules/elliotchance/
#0 20:10:51 ᛋ master /v/oo❱v install elliotchance.vsql
Scanning `elliotchance.vsql`...
warning: `elliotchance.vsql` is missing a manifest file.
details: Help to ensure future-compatibility by adding a `v.mod` file or opening an issue at:
         `https://github.com/elliotchance/vsql/issues/new?title=Missing%20Manifest&body=elliotchance.vsql%20is%20missing%20a%20manifest,%20please%20consider%20adding%20a%20v.mod%20file%20with%20the%20modules%20metadata.`
Installing `elliotchance.vsql`...
Installed `elliotchance.vsql`.
#0 20:11:01 ᛋ master /v/oo❱cd ~/.vmodules/elliotchance/vsql/
#0 20:11:15 ᛋ main ~/.vmodules/elliotchance/vsql❱make
rm -f grammar.bnf vsql/grammar.v
grep "//~" -r vsql | cut -d~ -f2 > grammar.bnf
python3 generate-grammar.py
v fmt -w vsql/grammar.v
Reformatted file: /home/delian/.vmodules/elliotchance/vsql/vsql/grammar.v
v fmt -w .
Already formatted file: /home/delian/.vmodules/elliotchance/vsql/cmd/vsql/out.v
Already formatted file: /home/delian/.vmodules/elliotchance/vsql/cmd/vsql/server.v
...
Already formatted file: /home/delian/.vmodules/elliotchance/vsql/vsql/std_joined_table.v
Already formatted file: /home/delian/.vmodules/elliotchance/vsql/scripts/generate-v-client-library-docs.vsh
./scripts/generate-v-client-library-docs.vsh > docs/v-client-library-docs.rst
#0 20:11:19 ᛋ main ~/.vmodules/elliotchance/vsql❱make bin/vsql
mkdir -p bin
v  -prod cmd/vsql -o bin/vsql
#0 20:13:06 ᛋ main ~/.vmodules/elliotchance/vsql❱ls -la bin/vsql
-rwxrwxr-x 1 delian delian 2284632 Jan 29 20:13 bin/vsql
#0 20:13:22 ᛋ main ~/.vmodules/elliotchance/vsql❱
#0 20:13:26 ᛋ main ~/.vmodules/elliotchance/vsql❱v version
V 0.4.4 804a7bd
#0 20:13:29 ᛋ main ~/.vmodules/elliotchance/vsql❱

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

3 participants