Harbour policy: allowing a bundled helper executable (re Piirit)

About this thread: it is meant as a public discussion with Jolla about one specific Harbour rule. It is not the place for general discussion of the app. For that, please use this thread. Thank you for helping keep this one focused.

Hi @Jolla team,

I maintain Piirit, a native Delta Chat client for Sailfish OS. The package passes every Harbour validator check except one, and that one can’t be fixed within the app in a way I’d consider legitimate.

So I submitted the app via Harbour today, full knowing that it will likely be rejected. That being said, I would like to make the case for amending the rule. Not for this specific case, for everyone.

The issue

Piirit is a Silica/QML front end. All messaging, networking and cryptography is done by upstream’s deltachat-rpc-server, which Piirit bundles and starts as a subprocess, communicating with it over JSON-RPC on stdio. It is installed at:

/usr/libexec/harbour-piirit/deltachat-rpc-server

Harbour allows ELF files only in two places: /usr/bin/<NAME> and *.so under /usr/share/<NAME>/lib/. A second executable fits neither, so rpmvalidation.sh reports three errors for it (check IDs 1.2.1 and 1.6.7): installation not allowed, ELF binary in wrong location, and file must not be executable. Everything else in the package validates, built with SDK 5.2.0.15.

Why this can’t be fixed on the app side

There are three ways to embed the Delta Chat core:

Option Current upstream API? Buildable with the Sailfish SDK?
libdeltachat.so (C interface) No, being deprecated Yes
deltachat-jsonrpc crate, in-process Yes No: needs Rust 1.89, the SDK ships 1.75
deltachat-rpc-server subprocess (current) Yes, what upstream recommends Yes

About the bundled binary

To help assess the risk:

  • It is upstream’s official release build, unmodified, fetched by a script that pins both the version and SHA-256 checksums (scripts/fetch-rpc-server.sh). Its source is MPL-2.0.
  • It is only ever started by the app, as a child process, so it runs under the same Sailjail sandbox and permissions as the app itself. It has no .desktop file, is not on PATH, and has no setuid/setgid bits or unusual file modes.
  • It is statically linked against musl and depends only on the kernel.

Proposal

The one-executable rule seems to predate upstream projects shipping a self-contained helper binary as their recommended integration. I’d suggest allowing, for example:

  • ELF executables in a single app-private directory, such as /usr/libexec/<NAME>/ or /usr/share/<NAME>/libexec/,
  • subject to the same conditions as the main binary where they apply (no setuid/setgid, no group/world-writable modes, dynamically linked libraries against the allow-list),
  • and possibly flagged for manual review in QA, rather than rejected automatically.

I’m not attached to the specifics. :slight_smile: My understanding is that @vige was at least open to entertaining the idea.

Would love to hear your thoughts!

:full_moon:

7 Likes

For a while i was running my library code as a separate executable/process/program/… in SeaPrint. My workaround was to rename the library/subprocess/… main() function, compile them to the same binary and have the regular app one call that when started with some magic argument. Probably harder with a third-party application, but that was quick and cheap for me.

1 Like

There are workarounds, like zipping it and unzipping on app start.

1 Like

Understood. That does not change the fact that the current rule set forbids a common use case. I would rather see the rules updated than work around them.

5 Likes

Just in case they will not be: I saw in community talks that Rust version should be bumped sooner or later.

2 Likes

I don’t see any real reasons why this could not work. I suggest you take your proposal to the next community meeting. If it gets green light there, I could even prepare a PR for the validator.

15 Likes

Thank you for the quick response - and for the offer! That would be excellent. I will see whether I can make it work on Oct 1st, then I’ll submit something. :vulcan_salute:

3 Likes