Skip to content

Enable Dynamic Library and Header Package Creation ( experimental PR - Do not Submit)#15

Closed
saksham-chawla wants to merge 1 commit intocodex/replay-pr-147-basefrom
codex/replay-pr-147-head
Closed

Enable Dynamic Library and Header Package Creation ( experimental PR - Do not Submit)#15
saksham-chawla wants to merge 1 commit intocodex/replay-pr-147-basefrom
codex/replay-pr-147-head

Conversation

@saksham-chawla
Copy link
Copy Markdown
Collaborator

@saksham-chawla saksham-chawla commented Mar 18, 2026

Creating a Pull Request to demonstrate the Issues faced for creating a Dynamic Library.
This is temp Pull Request for Score team to review and comment. Provide suggestion on how to proceed.


Enable Dynamic Library and Header Package Creation

This experimental pull request addresses critical challenges in building dynamic libraries and packaging public headers using Bazel for the SCORE Communication middleware. It demonstrates that Bazel's cc_shared_library rule does not automatically include symbols from transitive dependencies, leading to runtime undefined symbol errors. The solution involves explicitly listing all required dependencies in an aggregation cc_library target and using custom Bazel rules to extract and filter public headers for deployment packages.

The PR introduces a comprehensive Markdown document (SYMBOL_INCLUSION_ANALYSIS.md) detailing the problem, comparing failing and working configurations, and outlining best practices for Bazel shared library builds and header management. It also includes new Starlark rules for header extraction and filtering, along with modifications to existing BUILD files to implement these solutions and broaden visibility for necessary components.

Architecture Diagram:

flowchart TD
    subgraph Build_System_Rules
        A[/"'extract_headers.bzl (+79 lines)'"/] -->|defines rule| B[/"'copy_headers.bzl (+123 lines)'"/]
        C[/"'generate_version_script'"/]
    end

    subgraph Core_Build_Configuration
        D["score/mw/com/deploy/BUILD (+444 lines)"]
        E["score/mw/com/impl/BUILD (+6 lines)"]
        F["score/mw/com/impl/tracing/BUILD (+6 lines)"]
        G["score/mw/com/impl/bindings/lola/BUILD (+6 lines)"]
        H["score/mw/com/impl/plumbing/BUILD (+3 lines)"]
    end

    subgraph Library_Targets
        I["com_all_deps (cc_library)"]
        J["libscore_communication.so (cc_shared_library)"]
        K["libscore_com_import (cc_import)"]
        L["score_com_dynamic (cc_library)"]
    end

    subgraph Application_and_Documentation
        M["ipc_bridge_dynamic (cc_binary)"]
        N[/"'SYMBOL_INCLUSION_ANALYSIS.md (+1047 lines)'"/]
    end

    D -->|loads| A
    D -->|loads| B
    D -->|defines| C
    D -->|defines| I
    D -->|defines| J
    D -->|defines| K
    D -->|defines| L
    D -->|defines| M

    I -->|deps| E
    I -->|deps| F
    I -->|deps| G
    I -->|deps| H

    J -->|deps| I
    J -->|uses| C

    K -->|imports| J
    L -->|deps| K
    L -->|hdrs from| B
    B -->|uses| A

    M -->|deps| L

    N -->|explains| D
    N -->|explains| J
Loading

This summary was automatically generated by @propel-code-bot

Make communication shared library with all necessary deps
and header package for SDK deployment use-cases
@saksham-chawla saksham-chawla marked this pull request as ready for review March 18, 2026 18:41
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