Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sed-i opened this issue Dec 10, 2024 · 0 comments
Open

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

sed-i opened this issue Dec 10, 2024 · 0 comments

Comments

@sed-i
Copy link

sed-i commented Dec 10, 2024

Bug Description

I renamed a plug following this recommendation, 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.

Environment

NR

snapcraft.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

- interface 'dot-config' not found in base declaration
- unknown plugs interface name reference 'dot-config

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant