← Back to issue list

Implement `_get_build_for()` in `LifecycleService`

View original Github issue

Metadata

Project
craft-application
Number
#394
Type
issue
State
closed
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Closed as implemented: craft-application PR #414 (commit 947e1b4b, "feat(lifecycle): break out _get_build_for method") extracted LifecycleService._get_build_for() from _init_lifecycle_manager so apps can override it. Shipped in craft-application 4.1.0 (2024-08-14).

Resolution: closed resolved

Reason: Maintainer-created task was implemented in merged PR #414, commit 947e1b4b "feat(lifecycle): break out _get_build_for method". The 4.1.0 changelog entry states the LifecycleService now breaks out a _get_build_for method for apps to override, and _init_lifecycle_manager now calls self._get_build_for().

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done The application should be able to provide its own `build_for` value to craft-parts by moving [this part of](https://github.com/canonical/craft-application/blob/e8651e46e81bdff00ffa011af981562e97e724c6/craft_application/services/lifecycle.py#L163-L176) `_init_lifecycle_manager` to its own method. ### Why it needs to get done Charmcraft needs to allow multi-arch builds to fix https://github.com/canonical/charmcraft/issues/1697. The logic in chramcraft would be to select an architecture to guarantee something that looks like cross-compiles.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Closed as implemented: craft-application PR #414 (commit 947e1b4b, "feat(lifecycle): break out _get_build_for method") extracted LifecycleService._get_build_for() from _init_lifecycle_manager so apps can override it. Shipped in craft-application 4.1.0 (2024-08-14).
stealth/space-bunny-alpha — closed resolved Implemented by merged craft-application PR #414 (commit 947e1b4b), which extracted LifecycleService._get_build_for() from _init_lifecycle_manager.
qwen/qwen3.6-35b-a3b — — Closed as abandoned. The request to extract _get_build_for() from _init_lifecycle_manager to enable multi-arch builds received no implementation or pull request after being synced to Jira.
qwen/qwen3.6-35b-a3b — — Closed without implementation. The request to extract _get_build_for() into LifecycleService for multi-arch support was abandoned and tracked via internal Jira ticket CRAFT-3145. No code changes were merged.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-application#414 (confidence 97%)

    Merged PR titled 'feat(lifecycle): break out _get_build_for method', commit 947e1b4b.

  • Related To: charmcraft#1697 (confidence 78%)

    Multi-arch build_for selection was the motivating use case per the issue body; craft-application side landed in 4.1.0.

Related issues

Issue Project State Summary Similarity
#414 feat(lifecycle): break out _get_build_for method craft-application merged Merged PR #414 (commit 947e1b4b) extracted LifecycleService._get_build_for() out of _init_lifecycle_manager in craft-application, closing issue #394; added unit test test_get_build_for and a changelog entry.
85%