Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.2k
std.Build.Module should include APIs from CompileStep #14719
Copy link
Copy link
Closed
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Milestone
Description
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Currently it is not possible for an upstream package
footo add C header include paths to a Module it has defined — it's only possible to do this on CompileSteps. The effect of this is that if the package defines a module using@cImport(), a depending projectbarthat uses this module will fail to build because the headers aren't in its search path.For now, the workaround in the dependee's build.zig is to call
exe.addIncludePath(X)whereXis the path to the globally cached package, e.g.~/.cache/zig/p/hash-of-package/include.It should be possible for
barto depend onfoowithout adding this include path. Ifbardoes not call@cImport()directly itself, it should also not have to callexe.addIncludePathat all.The suggested approach in today's meeting was to expand the API of Module to have (some of? *) the same APIs as CompileStep. This would allow the upstream
footo callmod.installHeadersDirectory()in build.zig, and thenbarcan use thefoomodule and find its headers.*Note: I'm not sure which APIs should be copied from CompileStep. All of them? Just ones related to installing headers?