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

builder: fix compiling code, importing a module located in src/modules #19396

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

nemoola
Copy link
Contributor

@nemoola nemoola commented Sep 20, 2023

Fixed a problem where modules in src were not recognized.

@spytheman spytheman changed the title builder: Fixed a problem where modules in src were not recognized. builder: fix compiling code, importing a module located in src/modules Sep 20, 2023
@spytheman spytheman merged commit 7169df3 into vlang:master Sep 20, 2023
46 checks passed
v.module_search_paths << os.join_path(v.compiled_dir, 'modules')
if os.exists(os.join_path(v.compiled_dir, 'src/modules')) {
v.module_search_paths << os.join_path(v.compiled_dir, 'src/modules')
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you have both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the contents of src/module will take precedence.

Copy link
Contributor

@JalonSolov JalonSolov Sep 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I put modules in both places, they should work in both places. The way your code is now, the ones in modules will be completely ignored if there is a src/modules. This would be bad if there are completely different modules in both directories.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created a pull request to resolve this issue. #19437

@nemoola nemoola deleted the modules_in_src branch September 21, 2023 06:17
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

Successfully merging this pull request may close these issues.

3 participants