Binary and Service Names with Underscores

Sergio Schvezov sergio.schvezov at canonical.com
Tue Nov 24 19:32:16 UTC 2015


On Tue, Nov 24, 2015 at 2:44 PM, <robert_joslyn at selinc.com> wrote:

> Continuing my desire to package Postgres in a snap, I came across another
> issue. Postgres has several binaries that contain underscores that I need
> to use in my snap. Presently, underscores are not allowed in binary or
> service names. Sergio mentioned on GitHub that this is due to how the
> APP_ID is generated.
>
> Are there any plans to remove this restriction? I can work around this,
> but it's an unfortunate limitation.
>

Declaring a binary exposes said binary outside of the package, so say that
in my snap I have

$ find .
bin/binary_1
bin/binary_2
bin/service
lib/...
...


Say I want to expose binary_2 to the outside world, then in snapcraft.yaml,
I'd write

name: mysnap
binaries:
  binary-2:
    exec: bin/binary_2

Once this snap is installed on the system, it would be accessed as:

$ mysnap.binary-2

Now, if bin/service wants to call binary_2, it doens't need to invoke its
external representation, it can just execve binary_2 and it should all work
fine.

Hope this helps
Sergio

PS: sorry for insisting, but askubuntu :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snappy-app-devel/attachments/20151124/003362ee/attachment.html>


More information about the snappy-app-devel mailing list