libraries: fail the build when any sensor fails to compile#91
Merged
Conversation
Both libraries/Makefile and libraries/sensor/hi3516cv500/Makefile iterated subdirs with `make ... || true`, which silently swallowed per-sensor compile failures. Three musl-only header bugs surfaced this way during the per-platform sensor source migration: cv300/imx323 missing <linux/ioctl.h> -> _IOC_SIZEBITS fixed in #84 av100/imx117 missing -I kernel/pwm/hi3516av100 fixed in #83 av100/imx123/imx185 av100 hi_spi.h <sys/ioctl.h> vs musl fixed in #90 In each case the `Build SDK (chiparch)` CI job stayed green because the libraries Makefile reported success even when individual sensors didn't link. The breakage was only caught when the firmware-side INSTALL_TARGET_CMDS step couldn't stat the missing .so. For cv300 that even slipped past CI entirely (the install foreach uses `;` so its exit code is the LAST install's exit code) — only sysupgrading a real camera surfaced the missing libsns_imx323.so. Replace `|| true` with a fail-late accumulator: keep iterating so all errors surface in one CI run, then exit 1 with a summary list of failing dirs at the end. Verified locally: - all 7 platforms still build clean under arm-openipc-linux-gnueabi-gcc - injecting `#error` into one sensor source causes: * the surrounding sensors continue to build * the loop reports "Build failed for: ./sensor/.../" * make exits 1 (CI red) The libraries/Makefile and libraries/sensor/hi3516cv500/Makefile are independent invocation paths (the latter is reached when CHIPARCH=hi3516cv500 since the outer SUBDIRS filter pulls in ./sensor/hi3516cv500/ alongside its subsensors), so both need the same fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Both `libraries/Makefile` and `libraries/sensor/hi3516cv500/Makefile` iterated subdirs with `make ... || true`, which silently swallowed per-sensor compile failures. Three musl-only header bugs surfaced through this gap during the per-platform sensor source migration (#82):
<linux/ioctl.h>→_IOC_SIZEBITSundeclared-I kernel/pwm/hi3516av100hi_spi.hused<sys/ioctl.h>(broken under musl)In each case the
Build SDK (chiparch)CI job stayed green because the libraries Makefile reported success even when individual sensors didn't link. The breakage was only caught when the firmware-sideINSTALL_TARGET_CMDSstep couldn't stat the missing.so. For cv300 it even slipped past CI entirely — the install foreach uses;separators, so its exit code is the last install's exit code, andsony_imx323(which failed) was followed bysony_imx385(which succeeded). Only sysupgrading a real camera surfaced the missinglibsns_imx323.so.Change
Replace
|| truewith a fail-late accumulator: keep iterating so all errors surface in one CI run, then exit 1 with a summary list of failing dirs at the end.Test plan
Build failed for: ./sensor/.../Build SDK (...)passes on all 11 platform/kernel matrix rows under muslWhy both Makefiles
libraries/Makefileis the top-level entry.libraries/sensor/hi3516cv500/Makefileis reached whenCHIPARCH=hi3516cv500because the outer SUBDIRS filter./sensor/hi3516cv500/% ./isp/matches both subsensor dirs and the cv500 dir itself (the%matches empty), so the loop runs make on the cv500 dir which delegates to its inner Makefile. Both paths had the same|| true.🤖 Generated with Claude Code