← Back to issue list

Pack succeeds for an invalid yaml (which fails to upload anyway)

View original Github issue

Metadata

Project
snapcraft
Number
#5172
Type
issue
State
closed
Author
sed-i
Labels
—
Created
Updated
Closed

Current evaluation

Pack succeeded with an app referencing an undeclared plug; maintainer mr-cal closed it 2025-01-15 as a duplicate of #5168, expanding that ticket to cover plugs (and slots) validation. No code fix yet; #5168 stays open.

Resolution: closed superseded

Reason: Closed by maintainer comment from mr-cal on 2025-01-15 explicitly stating it is a duplicate of canonical/snapcraft#5168, whose scope was updated to also validate plugs alongside slots. No PR or commit landed; #5168 remains open with internal ticket CRAFT-3896.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description I renamed a plug following [this recommendation](https://forum.snapcraft.io/t/personal-files-for-gitui/44223/4), but forgot to update the `plugs` section under `apps`. With this, `snapcraft pack` succeeds, but uploading rightfully fails, with: - interface 'dot-config' not found in base declaration - unknown plugs interface name reference 'dot-config Snapcraft pack should probably fail on a linting issue such a this? ### To Reproduce Run `snapcraft pack` on [this revision](https://github.com/sed-i/gitui-snap/blob/bf17ecfdfa5d4ff17ce69a95dbf2e7d65cb6b4e4/snap/snapcraft.yaml). ### Environment NR ### snapcraft.yaml ```yaml name: gitui base: core24 license: MIT source-code: https://github.com/sed-i/gitui-snap issues: https://github.com/sed-i/gitui-snap/issues adopt-info: gitui # Note: snap version is set from tag title: GitUI icon: logo.png website: https://github.com/extrawurst/gitui summary: Terminal UI for git description: | GitUI provides you with the comfort of a git GUI but right in your terminal. confinement: strict grade: stable platforms: amd64: arm64: build-on: [amd64, arm64] build-for: [arm64] armhf: build-on: [amd64, armhf] build-for: [armhf] riscv64: build-on: [amd64, riscv64] build-for: [riscv64] s390x: build-on: [amd64, s390x] build-for: [s390x] plugs: dot-config-gitui: interface: personal-files read: - $HOME/.config/gitui dot-gitconfig: interface: personal-files read: - $HOME/.gitconfig apps: gitui: command: gitui plugs: - network - home - dot-config parts: gitui: plugin: rust source: https://github.com/extrawurst/gitui.git override-pull: | craftctl default craftctl set version="$(git describe --tags --always)" build-packages: - cmake - libssl-dev - build-essential - linux-libc-dev - on amd64 to arm64: - gcc-aarch64-linux-gnu - linux-libc-dev-arm64-cross - libc6-dev-arm64-cross - on amd64 to armhf: - gcc-arm-linux-gnueabihf - linux-libc-dev-armhf-cross - libc6-dev-armhf-cross - on amd64 to riscv64: - gcc-riscv64-linux-gnu - linux-libc-dev-riscv64-cross - libc6-dev-riscv64-cross - on amd64 to s390x: - gcc-s390x-linux-gnu - linux-libc-dev-s390x-cross - libc6-dev-s390x-cross build-environment: # Must statically link, otherwise cross-compiled binaries end up being # dynamically linked to /snap/core24/current/lib64/ld-linux-x86-64.so.2 - RUSTFLAGS: "-C target-feature=+crt-static" # https://doc.rust-lang.org/nightly/rustc/platform-support.html # https://forum.snapcraft.io/t/platforms-and-architectures/36758 - to amd64: - target: x86_64-unknown-linux-gnu - on amd64 to arm64: - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc - target: aarch64-unknown-linux-gnu - on amd64 to armhf: - CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc - target: armv7-unknown-linux-gnueabihf - on amd64 to riscv64: - CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER: riscv64-linux-gnu-gcc - target: riscv64gc-unknown-linux-gnu - on amd64 to s390x: - CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER: s390x-linux-gnu-gcc - target: s390x-unknown-linux-gnu build-snaps: [rustup] override-build: | rustup install stable rustup target add $target echo "targets = ['$target']" >> rust-toolchain.toml cargo build --release --locked --target=$target # Ref: https://github.com/canonical/snapcraft/blob/8faa6d54eef1f4437c7e10337ed8fdcc8dc51cbc/snapcraft_legacy/plugins/v2/rust.py#L194 find ./target/$target/release -maxdepth 1 -executable -type f -name "gitui*" -exec install -Dvm755 {} "${SNAPCRAFT_PART_INSTALL}" ';' ``` ### Relevant log output ```shell - interface 'dot-config' not found in base declaration - unknown plugs interface name reference 'dot-config ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded Pack succeeded with an app referencing an undeclared plug; maintainer mr-cal closed it 2025-01-15 as a duplicate of #5168, expanding that ticket to cover plugs (and slots) validation. No code fix yet; #5168 stays open.
stealth/space-bunny-alpha — closed superseded Closed as a duplicate of canonical/snapcraft#5168, whose scope was expanded to validate plugs and slots; no fix has landed, and #5168 remains open.
qwen/qwen3.6-35b-a3b — — Closed as a duplicate of issue #5168, which tracks adding validation for both slots and plugs. The maintainers consolidated this request into a broader validation tracking issue.
qwen/qwen3.6-35b-a3b — — Superseded by #5168. Validation for invalid plug references in snapcraft pack will be implemented alongside slot validation in the referenced issue.
qwen3.6-35b-a3b-mtp-q6 — — Closed as a duplicate of #5168. The issue is superseded by a broader effort to add validation for undefined plug and slot references, preventing silent pack success and subsequent upload failures.

Update history

No update history recorded yet.

Related work

  • Duplicate Of: canonical/snapcraft#5168 (confidence 98%)

    Maintainer closed this as a duplicate and folded plug validation into the open enhancement 'Add plugs and slots keys to the project model'.

  • Related To: canonical/snapcraft#5168 (confidence 85%)

    Same weak spot — Snapcraft does almost no validation of top-level plugs/slots, per the closing comment.

Related issues

No related issues found above the similarity threshold.