Skip to content

Package manager: Build needs to include dynamic libraries as dependencies as Step Β #16172

@edyu

Description

@edyu

Zig Version

0.11.0-dev.3777+64f0059cd

Steps to Reproduce and Observed Behavior

Currently where is no way to install the dependencies (let's say A) of a package B as part of package C if C depends on B.
Say package A is a library written in another language and that exposes a dynamic library A.so.
Let's say B is a Zig wrapper for A so B needs A.so to work. B build ok with build.zig. B even installs A.so as part of the install step.

Now, say C is using the B wrapper but C cannot build because it will need A.so but by using the package manager, it can only use things such as Artifact or Module which are Compile.Step not Install.Step so there is no way for C to compile or install A.so (since C cannot touch anything other than the artifact of B) as part of C output.

right now we can do C.installLibraryHeaders(dep.artifact("B")) but not C.installLibrary(dep.install("B")) if A.so is part of B's install step.

Expected Behavior

I think there are two things:

  1. There should be a way to expose other Steps in addition to Compile.Step.
  2. There should be a way to include Install.Step as part of dependency just like how artifact is used so Install.Step should be part of Artifact as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions