Skip to content
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

feat: Add initial support to System Library #1428

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

0xLucasMarcal
Copy link
Contributor

@0xLucasMarcal 0xLucasMarcal commented Jan 4, 2025

Initial Support for System Libraries

This PR adds initial support for system libraries in the build system. This implementation focuses on basic system library integration without external package manager support (e.g., Homebrew).

Changes

  • Added basic system library detection and linking
  • System libraries are linked directly from standard system paths
  • Added validation for system library paths

Limitations

  • Does not support external package managers (e.g., Homebrew, apt)
  • Limited to default system library paths
  • No version management for system dependencies

Future Work

  • Add support for external package managers
  • Implement version management for system libraries
  • Add support for external providers library search paths

Testing

  • Added tests for basic system library linking
  • Verified functionality with standard system libraries

@0xLucasMarcal 0xLucasMarcal changed the title [WIP] Add initial support to System Library feat: Add initial support to System Library Jan 4, 2025
for bs in target.linker_settings.linked_libraries
]))
if linkopts:
attrs["linkopts"] = _starlarkify_clang_attrs(repository_ctx, {"linkopts": linkopts})["linkopts"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix: Add linked libraries to linkopts
The current implementation wasn't properly adding libraries to the linker options (linkopts), which caused linking failures for certain system dependencies. For example, targets that import sqlite3 were failing to build because the -lsqlite3 flag wasn't being passed to the linker.

@0xLucasMarcal 0xLucasMarcal marked this pull request as ready for review January 4, 2025 13:38
@cgrindel cgrindel marked this pull request as draft January 4, 2025 14:17
@cgrindel
Copy link
Owner

cgrindel commented Jan 4, 2025

@lucasmarcal-faire I converted this to a draft. Let us know when the PR is ready for review.

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