(Linux) Extending resource_bundle_accessor.swift

I'm working on various command line tools for macOS and Linux, written in Swift. The auto-generated resource_bundle_accessor.swift does only look in two places, the directory where the binary is located and the actual build directory.

At least for Linux, this is a bit of a problem for packaging, since we don't want to pollute the $bindir. The usual way is to look for resources in $datadir, e.g., /usr/share/<projectName>/.

How can we achieve that?

I believe that the behavior is based on extensive review of SE-0271: Package Manager Resources. The decision notes state the following:

1 Like

Excellent, many thanks for the pointer. Now I wonder is that the description of the plan or the status quo?

And does it play well with cross-compilation where resource_bundle_accessor.swift is generated and compiled on macOS, but will actually run on a Linux machine?