---
id: TASK-1
title: Add profile support to zync projects
status: Done
assignee: []
created_date: '2026-01-29 15:37'
updated_date: '2026-01-29 18:00'
labels: []
dependencies: []
references:
  - bin/zync
  - lua/zync
  - spec
  - zconf.lua
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Introduce profile-based configuration so a single project can define multiple target setups (board/runner) with isolated build output under the project build directory. Provide a command-wide profile selector that defaults per config when not explicitly set.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Profiles can be defined in zync config and used to select board/runner and build output location for all commands
- [x] #2 A command-wide profile selector exists and defaults to a configured profile when omitted
- [x] #3 Profile-based builds produce isolated output directories under the project build directory without breaking non-profile projects
- [x] #4 Docs updated to explain profiles and default selection behavior
- [x] #5 Relevant tests added/updated and `busted` passes
<!-- AC:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Added profile support across zync: config now supports `profiles`/`default_profile` with deterministic selection from zconf order, global `--profile/-p` option, profile-scoped build dirs, and clearer error handling. Manager/build logic now resolves project/build paths (including build/<profile>) and sysbuild CMake args are rooted at project dir. Added profile status logging (after command log; skipped for init) plus README updates describing profile config, build layout, and logging. Expanded Busted coverage for configurator/schema changes, CLI parsing, build dir resolution, and logging; stabilized test harness to use repo Lua modules. All tests pass (latest: `busted`).
<!-- SECTION:FINAL_SUMMARY:END -->
