Skip to content

[codex] support package runtime shared dependencies#94

Merged
Sunrisepeak merged 5 commits into
mainfrom
codex/package-owned-ldflags
May 31, 2026
Merged

[codex] support package runtime shared dependencies#94
Sunrisepeak merged 5 commits into
mainfrom
codex/package-owned-ldflags

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Summary

Adds the mcpp build/runtime support needed for upstream-compatible compat packages that provide real shared-library artifacts, such as the X11 stack used by GLFW.

  • Build dependency package shared targets as package-owned artifacts instead of flattening them into consumers.
  • Link direct shared dependencies with per-link flags, implicit ninja inputs, and runtime rpath on ELF/macOS.
  • Preserve static package flattening while propagating the static package's direct shared dependencies into the final link.
  • Support xpkg mcpp.<platform> overlays so package descriptors can add platform-specific sources/deps/flags.
  • Treat Objective-C .m files as C-like implementation sources for macOS package overlays.
  • Fix local path index installs to use index:full.package.name@version, avoid unrelated builtin-index refreshes, expose the official xim index to project-scoped installs, and clear stale local xlings index caches.

Why

The compat package work needs existing C/C++ code to keep using upstream headers and runtime libraries directly, e.g. #include <X11/Xlib.h> and binaries linking libX11.so. That requires dependency packages to produce and propagate shared artifacts instead of only contributing headers or object files.

Validation

  • target/x86_64-linux-gnu/76723324835d8177/bin/mcpp build
  • target/x86_64-linux-gnu/76723324835d8177/bin/mcpp test -- tests/unit/test_config.cpp
  • MCPP=$PWD/target/x86_64-linux-gnu/76723324835d8177/bin/mcpp bash tests/e2e/52_local_path_namespaced_index.sh
  • MCPP=$PWD/target/x86_64-linux-gnu/76723324835d8177/bin/mcpp bash tests/e2e/55_dependency_shared_artifact.sh
  • MCPP=$PWD/target/x86_64-linux-gnu/76723324835d8177/bin/mcpp bash tests/e2e/56_transitive_shared_artifact.sh
  • MCPP=$PWD/target/x86_64-linux-gnu/76723324835d8177/bin/mcpp bash tests/e2e/57_static_dep_shared_artifact.sh
  • git diff --check

@Sunrisepeak Sunrisepeak marked this pull request as ready for review May 31, 2026 19:51
@Sunrisepeak Sunrisepeak merged commit 1cb54ff into main May 31, 2026
3 checks passed
@Sunrisepeak Sunrisepeak deleted the codex/package-owned-ldflags branch May 31, 2026 19:51
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