← Back to issue list

package repository advance grammar support

View original Github issue

Metadata

Project
snapcraft
Number
#5469
Type
issue
State
open
Author
kubiko
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed
—

Current evaluation

Triaged enhancement to support advanced grammar in package-repositories, avoiding duplicate APT sources during native builds; a maintainer identified a core24 craft-application implementation path.

Suggested action: keep open

Reason: The issue is triaged and has a maintainer-identified fix path: @mr-cal proposed adding package-repositories to craft-application's GrammarAwareModel for core24. The current project model applies grammar-aware fields to parts but has no project-level package-repositories field, while the report provides a concrete native-build reproducer and APT warning output.

Evaluated by: mr-cal-bot

Impact: 40 Quick Win: 21 Complexity: 38 Confidence: 93 Actionability: 86

Issue body

### Bug Description Support for package repositories unlocked possibilities with cross-building, however side effect of this is that native build suffers from unnecessary inclusion of the source packages as those are already unlocked by the host arch. https://pastebin.ubuntu.com/p/kHDpx9d77Y/ A proposed solution would be to support of the advance grammar for `package-repositories`. ### To Reproduce Add the following stanza to the `snapcraft.yaml` and run a native build on the arm64 host. ``` package-repositories: - type: apt architectures: [$CRAFT_ARCH_BUILD_FOR] formats: [deb, deb-src] components: [main] suites: [noble, noble-updates, noble-backports] key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C url: http://ports.ubuntu.com/ubuntu-ports ``` Once snap build completes, run in the container `$ sudo apt-get update` The following warnings should be observed: https://pastebin.ubuntu.com/p/kHDpx9d77Y/ ### Environment Host Ubuntu 24.04 Using LXD backend ### snapcraft.yaml ```yaml Example project: https://github.com/kubiko/imx-gadget ``` ### Relevant log output ```shell sudo apt-get update Hit:1 https://ppa.launchpadcontent.net/snappy-dev/image/ubuntu noble InRelease Hit:2 http://ports.ubuntu.com/ubuntu-ports noble InRelease Hit:3 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease Hit:4 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease Hit:5 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease Reading package lists... Done W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-arm64.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-arm64) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-arm64.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-arm64) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-arm64.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-arm64) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-arm64.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-arm64) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-arm64.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-arm64) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-arm64.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-arm64) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/craft-http_ports_ubuntu_com_ubuntu_ports.sources:1 and /etc/apt/sources.list.d/ubuntu.sources:1 ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 40
Quick Win: 21
Complexity: 38
Confidence: 93
Actionability: 86
keep open Triaged enhancement to support advanced grammar in package-repositories, avoiding duplicate APT sources during native builds; a maintainer identified a core24 craft-application implementation path.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 26
Complexity: 20
Confidence: 85
Actionability: 80
keep open Enhancement to support grammar expansion in package-repositories, preventing duplicate apt source warnings during native builds. Triaged and awaiting implementation.
qwen/qwen3.8-27b
Impact: 45
Quick Win: 27
Staleness: 55
Complexity: 40
Confidence: 70
Support Request: 10
keep open Request to add advanced grammar support for package-repositories to avoid duplicate apt sources in native builds. Triaged by maintainer with a concrete fix path (add to GrammarAwareModel in craft-application), but no PR or further activity since May 2025.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 40
Confidence: 85
Support Request: 10
keep open Request to add advanced grammar support to package-repositories in snapcraft.yaml to prevent duplicate apt source warnings during native builds. Triaged with a proposed fix in craft-application.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 30
Confidence: 90
Support Request: 0
keep open Enhancement to add grammar support to package-repositories to prevent duplicate apt source warnings during native builds. Triaged with a proposed fix path identified by a maintainer.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.