Skip to content

Conversation

@Jan200101
Copy link
Contributor

I can't build langref on 0.14.0 or master because a relative path is passed to doctest and doctest is ran in a temporary directory.

alex pointed me to #23122, but that is a more radical solution to the problem, this PR is more modest by checking if graph.zig_lib_directory.path is set and then passing it via addDirectoryArg.

tested by running zig build docs

https://zsf.zulipchat.com/#narrow/channel/454360-compiler/topic/unable.20to.20open.20zig.20lib.20directory.20when.20building.20docs/with/513624116

@Jan200101
Copy link
Contributor Author

I needed to add a check for absolute paths because zig_lib_directory makes no guarantee of being absolute or relative (its absolute in the CI and relative on my system, haven't checked why this is) and std.Build.path panics on absolute paths

@Jan200101 Jan200101 force-pushed the PR/zig_lib_dir_doctest branch from 5903043 to 89839c3 Compare April 24, 2025 15:35
@mlugg
Copy link
Member

mlugg commented May 18, 2025

Incorrect fix; the path is either absolute or cwd-relative, both of which are correct to pass directly to the child, and neither of which is correct to pass through b.path (which is for build-root-relative paths). The correct fix was #23894.

@mlugg mlugg closed this May 18, 2025
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.

2 participants