Skip to content

build: pass zig lib dir as directory instead of as string #23644

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
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.

1 participant