MCPcopy Create free account
hub / github.com/FastLED/FastLED / resolve_nm

Function resolve_nm

ci/bloat.py:97–119  ·  view source on GitHub ↗

Locate the cross-toolchain `nm` binary for the given board.

(board: str)

Source from the content-addressed store, hash-verified

95
96
97def resolve_nm(board: str) -> Path:
98 """Locate the cross-toolchain `nm` binary for the given board."""
99 if board not in BOARD_CHIP_MAP:
100 raise SystemExit(
101 f"Bloat: board '{board}' has no nm mapping. Add it to "
102 "BOARD_CHIP_MAP in ci/bloat.py — entries are mechanical "
103 "(arch + chip prefix). Supported boards today: "
104 f"{', '.join(sorted(BOARD_CHIP_MAP))}."
105 )
106 arch, chip = BOARD_CHIP_MAP[board]
107 pkg_dir, prefix_tpl = PIO_NM_BY_ARCH[arch]
108 prefix = prefix_tpl.format(board_chip=chip)
109 bin_dir = pio_packages_dir() / pkg_dir / "bin"
110 # Windows has .exe; Unix doesn't. Prefer the os-specific one.
111 nm = bin_dir / f"{prefix}-nm.exe"
112 if not nm.exists():
113 nm = bin_dir / f"{prefix}-nm"
114 if not nm.exists():
115 raise SystemExit(
116 f"Bloat: nm binary not found under {bin_dir}. Expected "
117 f"`{prefix}-nm[.exe]`. Has the toolchain been installed via PIO?"
118 )
119 return nm
120
121
122def find_elf(board: str, build_root: Path) -> Path:

Callers 1

mainFunction · 0.85

Calls 2

pio_packages_dirFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected