Summary
src/kyron/BUILD and src/kyron-foundation/BUILD unconditionally set the
bazel_build_iceoryx2_qnx8 crate feature on libkyron / libkyron_foundation,
with no select() gating on target platform:
# src/kyron/BUILD
rust_library(
name = "libkyron",
crate_features = selects.with_or({...}) + [
"bazel_build_iceoryx2_qnx8",
"tracing",
],
...
)
# src/kyron-foundation/BUILD
rust_library(
name = "libkyron_foundation",
crate_features = [
"bazel_build_iceoryx2_qnx8",
"tracing",
],
...
)
Via rules_rust's crate_universe feature unification, this activates the qnx8
Cargo feature on the transitive iceoryx2-pal-posix crate, which conditionally
compiles a small C shim (socket_macros.c) — for every build of kyron,
regardless of whether the actual target platform is Linux or QNX.
Impact: breaks consumption as a Bazel dependency from another repo
This is invisible when building kyron standalone (via cargo build, or via
bazel build //... inside kyron's own devcontainer/CI), but it breaks when
score_kyron is added as a Bazel dependency to a sibling repo that registers
its own (minimal/hermetic) C/C++ toolchain — because Bazel toolchain
resolution is invocation-global, not scoped per bzlmod module. The consuming
repo's toolchain ends up being used to compile kyron's iceoryx2-pal-posix
C shim too.
Reproduction
Tested against eclipse-score/communication (which registers its own
gcc_toolchain with a deliberately minimal sysroot for its C++ mw::com
code):
- Add to
communication/MODULE.bazel:
bazel_dep(name = "score_kyron", version = "0.1.3", dev_dependency = True)
local_path_override(module_name = "score_kyron", path = "../kyron")
bazel mod deps --lockfile_mode=update
bazel build @score_kyron//src/kyron-foundation:libkyron_foundation
Result — fails before any kyron Rust source is even compiled:
cargo:warning=src/c/socket_macros.c:23:24: error: no include path in which to search for sys/select.h
cargo:warning=src/c/socket_macros.c:26:1: error: unknown type name 'size_t'
cargo:warning=src/c/socket_macros.c:27:12: error: implicit declaration of function 'CMSG_SPACE'
...
error occurred in cc-rs: command did not execute successfully (status code exit status: 1):
.../gcc_toolchain_x86_64/xbin/gcc" ... "-nostdinc" ...
".../crate_index__iceoryx2-pal-posix-qnx8-0.7.0/_bs.out_dir/01f2103c15c31950-socket_macros.o"
The consuming repo's hermetic toolchain simply doesn't have general POSIX
headers (sys/select.h, sys/socket.h, fd_set, ...) — reasonably so, since
it was curated only for that repo's own C++ code, not for building kyron's
transitive dependencies.
Suggested fix
Gate bazel_build_iceoryx2_qnx8 (and the corresponding iceoryx2_qnx8 /
iceoryx2_cal_qnx8 / iceoryx2_bb_derive_macros_qnx8 deps) behind an actual
target-platform select() instead of applying it unconditionally — similar in
spirit to the QNX platform-triple label fix already applied on the
score-crates / rules_rust fork side. On a non-QNX target platform this
feature (and its iceoryx2 QNX variant deps) shouldn't be requested at all.
Environment
- kyron: verified against
v0.1.3 (latest release) and current main
(cc72f599cc0c04a4e80c12a204f57e59a48d284a) — both identical on the
BUILD files in question, bug present in both. Consumed via
local_path_override from communication at registry version 0.1.3.
- rules_rust
0.68.1-score
- Reproduced inside
ghcr.io/eclipse-score/devcontainer:latest
Summary
src/kyron/BUILDandsrc/kyron-foundation/BUILDunconditionally set thebazel_build_iceoryx2_qnx8crate feature onlibkyron/libkyron_foundation,with no
select()gating on target platform:Via rules_rust's crate_universe feature unification, this activates the
qnx8Cargo feature on the transitive
iceoryx2-pal-posixcrate, which conditionallycompiles a small C shim (
socket_macros.c) — for every build of kyron,regardless of whether the actual target platform is Linux or QNX.
Impact: breaks consumption as a Bazel dependency from another repo
This is invisible when building kyron standalone (via
cargo build, or viabazel build //...inside kyron's own devcontainer/CI), but it breaks whenscore_kyronis added as a Bazel dependency to a sibling repo that registersits own (minimal/hermetic) C/C++ toolchain — because Bazel toolchain
resolution is invocation-global, not scoped per bzlmod module. The consuming
repo's toolchain ends up being used to compile kyron's
iceoryx2-pal-posixC shim too.
Reproduction
Tested against
eclipse-score/communication(which registers its owngcc_toolchainwith a deliberately minimal sysroot for its C++mw::comcode):
communication/MODULE.bazel:bazel mod deps --lockfile_mode=updatebazel build @score_kyron//src/kyron-foundation:libkyron_foundationResult — fails before any kyron Rust source is even compiled:
The consuming repo's hermetic toolchain simply doesn't have general POSIX
headers (
sys/select.h,sys/socket.h,fd_set, ...) — reasonably so, sinceit was curated only for that repo's own C++ code, not for building kyron's
transitive dependencies.
Suggested fix
Gate
bazel_build_iceoryx2_qnx8(and the correspondingiceoryx2_qnx8/iceoryx2_cal_qnx8/iceoryx2_bb_derive_macros_qnx8deps) behind an actualtarget-platform
select()instead of applying it unconditionally — similar inspirit to the QNX platform-triple label fix already applied on the
score-crates/ rules_rust fork side. On a non-QNX target platform thisfeature (and its iceoryx2 QNX variant deps) shouldn't be requested at all.
Environment
v0.1.3(latest release) and currentmain(
cc72f599cc0c04a4e80c12a204f57e59a48d284a) — both identical on theBUILD files in question, bug present in both. Consumed via
local_path_overridefromcommunicationat registry version0.1.3.0.68.1-scoreghcr.io/eclipse-score/devcontainer:latest