Plugin `swift-format` doesn't work without host install
Hi all, I'm new to Builder development and not quite sure where to get this problem raised/resolved - so I've started to look into fixing it myself already but am stuck now.
I'm debugging the swift-format
plugin which doesn't work correctly right now: I can verify that it actually works as long as it finds the command on my local host system. However, it should pick up this command from the sdk extension. This is available in org.freedesktop.Sdk.Extension.swift5
and works from a Build Terminal. So the hunch is that the plugin uses only a runtime context and not a build context when invoking the formatter.
For reference the relevant function is here:
src/plugins/swift-format/gbp-swiftformat-formatter.c:55
The current sources check ide_runtime_contains_program_in_path
before ide_runtime_prepare_to_build
(which - from the developer notebook "book" and docs on builder - I understood to prepare the run context with a build environment via sdk extension defined for the project). But even turning the calls around locally doesn't make the command from the sdk available, it doesn't enter the if
-body and falls through to the run_on_host:
label, which explains why it works correctly with swift-format
available on the host.
I was wondering if it has to do with the pipeline parameter, passed as NULL
which supposedly sets up the default pipeline for the context, but maybe something needs to be set up explicitly... or default pipeline doesn't mean the project default, or something else I'm not aware of yet...
...so I'm the first to admit that I'm just poking around in the dark now.
PS: I've also tried my luck getting the pipeline from the build manager and preparing the build system tooling for the run context,