Skip to content

_selected_board raises AttributeError on a non-mapping eos.yaml (or non-mapping system:) after a successful build #192

Open

Description

@Aswin-V

What

ebuild/cli/commands.py _selected_board() (lines 504-519) hardcodes Path("eos.yaml"), does yaml.safe_load(...) or {}, then (data.get("system") or {}).get("board"). If the top level of eos.yaml is a list, .get raises AttributeError; if system: is a string, .get("board") raises AttributeError.

Where

The crash happens in _build_summary, i.e. after the image has already linked — a malformed project file turns a successful build into a traceback at the summary step.

Why it matters

Only the eos.yaml copy was missing the guard: _board_config (lines 619-633) already rejects non-mappings (return data if isinstance(data, dict) else None).

Proposed approach

Share one YAML-mapping reader: missing/unreadable/malformed/non-mapping -> None; _selected_board goes through it (plus a system-is-dict guard) and falls back to "generic"; _board_config delegates to the same reader. Behaviour for valid files is unchanged.

Note

PR #191 already implements this fix (shared _read_yaml_mapping, tests for top-level list / system: as string / unclosed YAML). This issue exists so the PR body can link a real closing issue — it previously cited the Fixes #<issue-number> placeholder, which is why the Linked Issue policy check fails.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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