Module resolution depends on working directory #22038
Labels
Bug
This tag is applied to issues which reports bugs.
Module Lookup Problem
Bugs/feature requests, that are related to looking up modules/mismatches in module names/paths.
Describe the bug
One of those "not sure if bug or feature" issues, but figured I'll file to clarify either way.
I was trying to figure out what project structure might work for developing libraries while trying to use them in my own application without a round-trip through git for each change.
Encountered that
V <target_directory>
resolves modules differently for the same target directory depending on where you call it.Reproduction Steps
Create a project structure like this:
basically
app/src/main.v uses lib:
Run or build the app directory.
Expected Behavior
Either both calls should behave the same or the different behavior should be documented.
Current Behavior
Running from the root directory works:
Running from the app directory does not:
Possible Solution
Development and usage of non-builtin packages should be documented beyond the most basic example.
Additional Information/Context
No response
V version
V 0.4.6 d186c39
Environment details (OS name and version, etc.)
V full version: V 0.4.6 b5ba466.d186c39
OS: linux, Ubuntu 22.04.4 LTS
Processor: 12 cpus, 64bit, little endian, AMD Ryzen 5 5600X 6-Core Processor
getwd: /home/joel/Development/test/app
vexe: /opt/v/v
vexe mtime: 2024-07-24 14:48:07
vroot: OK, value: /opt/v
VMODULES: OK, value: /home/joel/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.34.1
Git vroot status: weekly.2024.30-11-gd186c394 (94 commit(s) behind V master)
.git/config present: true
CC version: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
thirdparty/tcc status: thirdparty-linux-amd64 a0799a5b
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.
The text was updated successfully, but these errors were encountered: