In theory (since --trim restricts top-level code from ever executing after (pre-)compilation), JuliaC should be able to:
- Query the list of loaded packages
- Generate a
LoadedManifest.toml for PackageCompiler
- Enable some feature in PackageCompiler to trim the set of included artifacts / code based on the
LoadedManifest.toml
(which is a strict subset of your full Manifest.toml, if there were packages that were never using'd)
This should mostly be a matter of generating the smaller manifest and then having PackageCompiler use that manifest instead of the normal one for discovering code / artifacts to download / include.