← 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

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.

Suggested action: keep open

Reason: Maintainer mr-cal explicitly triaged this with a concrete fix plan: 'add package-repositories to the GrammarAwareModel' in craft-application. The issue is labelled 'Status: Triaged' and 'Type: Enhancement'. The fix is scoped and actionable but has not been implemented yet (GrammarAwareProject in craft-application still only has a 'parts' field). No PR has been opened to address it, so it remains open and valid.

Impact: 45 Quick Win: 27.0 Staleness: 55 Complexity: 40 Confidence: 70 Support Request: 10

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
qwen/qwen3.8-27b
Impact: 45
Quick Win: 27.0
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 60
Complexity: 40
Confidence: 90
Support Request: 0
keep open Add advanced grammar support to package-repositories to prevent duplicate apt source warnings during native builds. Triaged as an enhancement; implementation requires adding the field to craft-application's GrammarAwareModel.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.