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

build: fix module path resolution #15717

Merged
merged 1 commit into from
Oct 13, 2023
Merged

build: fix module path resolution #15717

merged 1 commit into from
Oct 13, 2023

Conversation

radarroark
Copy link
Contributor

@radarroark radarroark commented May 15, 2023

Fixes #15767.

FileSource.getPath already calls pathFromRoot, so appendModuleArgs does not need to. Running it twice breaks the path resolution when the module's source_file is a relative path such as ../../src/main.zig.

@radarroark radarroark changed the title Fix broken module path resolution build: fix module path resolution May 16, 2023
malcolmstill added a commit to malcolmstill/zware that referenced this pull request Jul 8, 2023
Not ready to merge. After these changes, the modules can individually
build with 0.11.0-dev.3132+465272921 but the testrunner build command
fails:

```
$ zig build --build-file test/testrunner/build.zig --prefix ./
zig build-exe testrunner Debug native: error: warning: FileNotFound: test/testrunner/src/main.zig
error: FileNotFound
```

Yours truly looked into it and found that it is a build system bug.
Here's the fix: ziglang/zig#15717 Hopefully that
can get into the release. Shake and bake!

---------

Co-authored-by: Malcolm Still <malcolm.still@gmail.com>
@andrewrk
Copy link
Member

Thanks! I should have merged this ages ago.

@andrewrk andrewrk enabled auto-merge (rebase) October 13, 2023 05:39
@andrewrk andrewrk merged commit 244233d into ziglang:master Oct 13, 2023
10 checks passed
@radarroark radarroark deleted the radar/module-path branch October 13, 2023 16:00
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.

module paths can resolve incorrectly
2 participants