Skip to content

apt: add hermetic sysroot support for rust sys crate#209

Open
alok-oai wants to merge 1 commit intobazel-contrib:new_apifrom
alok-oai:alok/new_api
Open

apt: add hermetic sysroot support for rust sys crate#209
alok-oai wants to merge 1 commit intobazel-contrib:new_apifrom
alok-oai:alok/new_api

Conversation

@alok-oai
Copy link

Motivation:
Rust -sys crates need hermetic apt-provided headers/libs. Some crates can disable build scripts and link directly to Bazel C/C++ targets (for example libudev-sys, alsa-sys, gstreamer-*-sys, wayland-sys). Others still require build scripts and explicit sysroot-backed include/library search paths (notably libspa-sys / pipewire-sys, and openssl-sys). GStreamer test/runtime also needs plugin discovery paths.

Changes:

  • add and export apt_sysroot to materialize apt tar inputs as a sysroot tree
  • generate :sysroot targets in translated dependency-set outputs
  • refactor deb_import to inspect .deb payloads and improve symlink/library resolution for cross-package linkage
  • improve link path handling for pkg-config and multiarch lib directories
  • switch apt shared-library linking to DT_RPATH behavior for hermetic transitive resolution
  • improve Contents index probing/parsing for Debian/Ubuntu layout differences
  • fix Provides-version constraint comparison direction

Motivation:
Rust `-sys` crates need hermetic apt-provided headers/libs.
Some crates can disable build scripts and link directly to Bazel C/C++
targets (for example `libudev-sys`, `alsa-sys`, `gstreamer-*-sys`,
`wayland-sys`). Others still require build scripts and explicit sysroot-backed
include/library search paths (notably `libspa-sys` / `pipewire-sys`,
and `openssl-sys`). GStreamer test/runtime also needs plugin discovery paths.

Changes:
- add and export `apt_sysroot` to materialize apt tar inputs as a sysroot tree
- generate `:sysroot` targets in translated dependency-set outputs
- refactor `deb_import` to inspect `.deb` payloads and improve symlink/library
  resolution for cross-package linkage
- improve link path handling for pkg-config and multiarch lib directories
- switch apt shared-library linking to DT_RPATH behavior for hermetic transitive
  resolution
- improve Contents index probing/parsing for Debian/Ubuntu layout differences
- fix Provides-version constraint comparison direction
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