4

I am creating a snap package of the Dart language sdk. Here is the snapcraft.yaml

name: dart-sdk
version: 2.0.0
summary: Dart Language SDK
description:  This includes the Dart SDK

confinement: classic
parts:
  dart-sdk:
    plugin: dump
    source: https://storage.googleapis.com/dart-archive/channels/stable/release/2.0.0/sdk/dartsdk-linux-x64-release.zip

    build-packages:
      - wget
      - unzip 

After I install it, it goes into /snap/dart-sdk/current/dart-sdk, but the directory requires root permissions to access. How can I make the snap package so that when I install it, the sdk directory has user permissions instead of root?

1 Answers1

0
  • No, that breaks the purpose of snap. So snap does not allow changing app on the fly.

  • Also, I see no benefit of converting binary archive to snap, as you intended to do.

    Anyway, you can override prepare: and extract that binary archive. So it get snap'ed.

  • The correct way is to build snap from source package. So you can be sure it will work with any platform. By the way snapcraft is not well documented, better to learn from snapd source code and resent snapcraft.yaml in open source repositories.

user.dz
  • 49,176