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

Extra field 'adapter' not permitted when using core22 as base for Snapcraft configs #7372

Closed
filfreire opened this issue Jan 13, 2023 · 0 comments · Fixed by #7378
Closed
Labels

Comments

@filfreire
Copy link
Contributor

  • Electron-Builder Version: 24.0.0-alpha.10
  • Node Version: 16.17
  • Electron Version: 22.0.0
  • Electron Type (current, beta, nightly): current
  • Target: Snapcraft (snap)

If users define core22 as base and define some stage packages, like:

stagePackages: ['default', 'libdbus-1-dev', 'libnss3-dev']

when packaging their apps they might get an error like:

Bad snapcraft.yaml content:
- extra field 'adapter' not permitted in 'apps.insomnia' configuration
Full execution log: '/home/parallels/.cache/snapcraft/log/snapcraft-20230113-002320.808750.log'
  ⨯ exit status 1
github.com/develar/app-builder/pkg/util.ExecuteAndPipeStdOutAndStdErr
        /Volumes/data/Documents/app-builder/pkg/util/exec.go:23
github.com/develar/app-builder/pkg/package-format/snap.buildWithoutTemplate
        /Volumes/data/Documents/app-builder/pkg/package-format/snap/snap.go:352
github.com/develar/app-builder/pkg/package-format/snap.Snap
(...)

this is due to adapter being legacy. See this doc for more info in the Snapcraft provided environment section.

It ends up being this way due to isUseTemplateAppending up as false when folks define stagePackages, hitting this codepath in snap.ts:

this.isUseTemplateApp =
      this.options.useTemplateApp !== false &&
      (arch === Arch.x64 || arch === Arch.armv7l) &&
      buildPackages.length === 0 &&
      isArrayEqualRegardlessOfSort(stagePackages, defaultStagePackages)

one possible workaround might be adding a check for core22

if (snap.base === "core22") {
  delete appDescriptor.adapter
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant