Skip to content

nrf52: variant include path uses literal name, ignores PIO->Adafruit alias resolution #325

Description

@zackees

Symptom

Boards whose JSON + "variant" + field uses a PIO/sandeepmistry name that needs to be aliased to a different Adafruit directory (e.g. nRF52DK -> pca10056) fail to build with:

+ "```" +
.../cores/nRF5/Uart.h:27:10: fatal error: variant.h: No such file or directory
.../cores/nRF5/delay.h:28:10: fatal error: variant.h: No such file or directory
+ "```" +

The nrf52840_dk integration test in + "tests/platform/nrf52840_dk/" + is currently red on main for this reason.

Root cause

+ "BoardConfig::get_include_paths" + ( + "crates/fbuild-config/src/board/methods.rs:224-229" + ) joins + "framework_root/variants/<self.variant>" + LITERALLY. The companion + "Nrf52Cores::get_variant_dir" + (added in #322 for #321) does alias-aware resolution via + "resolve_nrf52_variant_dir" + .

The nrf52 orchestrator ( + "crates/fbuild-build/src/nrf52/orchestrator.rs" + ) inconsistently calls BOTH: the alias-aware variant_dir for source scanning (line 153), but the literal + "get_include_paths" + for the compiler include flags (line 213).

Result: source scan finds + "variants/pca10056/variant.cpp" + (good), but the compiler is told + "-I.../variants/nRF52DK" + (nonexistent).

Fix

Build + "include_dirs" + in the orchestrator from the already-computed + "core_dir" + and + "variant_dir" + (both alias-aware) instead of calling + "get_include_paths" + .

Impact

Unblocks fbuild builds for nRF52 boards whose PIO board JSON tracks the sandeepmistry naming. Closes FastLED/FastLED#2631 and FastLED/FastLED#2633 once a new fbuild release is cut and ingested into FastLED.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions