-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
A solution to the ~/code problem. What do you think? #457
Comments
I wouldn't really regard keeping track of the modules a configuration, more so metadata than anything. Personally I think |
How about instead installing libraries in |
As much as it sounds nice, libraries shouldn't be system wide imo. But confined within the users home directory which also helps with versioning and libs potentially conflicting. Seems to be a much more simplistic route than placing libs globally. |
I remember most time we don't need explicit set GOROOT var, but go depend on it's install directory structure. So once you know go's path, it can automatically populate lib path. Another, not think save a config file is good. just dynamically calculate. |
I would like to have |
I suggest using |
A GOPATH or PYTHONPATH like solution is the cleanest in my opinion. It doesn't clutter the system path with libraries of different versions. |
We should consider multi-versions of vlang coexists on a system. |
I like the GOPATH way better.
The default path could also be specified at build time and embedded in the binary, which would help for distributions and local development builds. |
A great approach could be involving a solution like rustup/nvm, by using it we can updating/choosing the compiler version (for example: "v use v0.0.*, v use stable or v use devel). |
And what should Linux package maintainers do? For example in ArchLinux For Go:
|
Please do not clutter home with hidden folders, use ~/.config/.v or ~/.config/v |
I like rustup too. but:
|
@aguspiza should be |
I used to be less than fond of the GOPATH way myself. It's really not that bad. I think you should consider it. |
Personally I would also put my voice behind following the freedesktop specification. |
A temprorary work around is something like this: cd v
wget https://vlang.io/v.c
curren_lib="$(pwd)"
sed \
"s|os__home_dir(), tos2(\"/code/v/\")|tos2(\"${curren_lib}\"), tos2(\"/\")|g" \
v.c \
> compiler/v.c
cd compiler
clang -w -o vc v.c
sed -i \
"s|mut lang_dir = os.home_dir() + '/code/v/'|mut lang_dir = '/usr/lib/v/'|g" \
main.v
./vc -o v . Maybe the makefile can be modified to make those changes on the fly and compile and even support a PREFIX flag to be able to change the /usr/lib value... |
+1 for considering Linux package managers. |
A bit off, but I made a
This still requires |
Taking this opportunity I want to insert a pretty penny. Personally, I like how it (subject) is organized in Go. I would not mind if it will be done like in |
IIRC clang has a similar issue with its so called "ressources" directory. As far as I remeber, one solution is to look for this ressources directory relatively to the clang binary path itself, with different checks (to support a build tree and a final installation tree). In the end, my recommandation is: check how clang is doing.it :) |
We talked to the author about it and it seems the preliminary decision on this issue will be as follows:
|
We should use a
We should also determine how we can separate a project into multiple modules and find them at the project level. We can get inspiration from Go: // project/api/main.v
module api
.... // project/config/main.v
module config
.... // project/cmd/test/main.v
module main
import github.com/someone/project/api
import github.com/someone/project/config
.... |
I like the idea of having the test file next to the module it tests (unit test), while having a tests folder for other integration or functional tests
|
Now, when you compile v - it does not use external directory For Linux packages, you should copy v, vlib, thirdparty to This is the same as in Go https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/go Look in Archlinux PKGBUILD for example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vlang-git Please create a new issue if you have any other suggestions. |
Hey,
Right now V must be installed in ~/code/v, because it needs to know the location of the vlib modules.
One way to fix this is introduce an environment variable, like Go's GOROOT. But I really don't like this.
I came up with the following idea. You git clone v.git in any directory,
cd compiler/
, build V. When building for the first time, V will look for the modules in the parent directory, and write down that directory in~/.config/v
.Now it can be used anywhere, and the V installation can also be anywhere.
What do you think?
The text was updated successfully, but these errors were encountered: