[BUG] SysImg install incompatible with submodules
MilesCranmer opened this issue · comments
AirspeedVelocity.jl is split into submodules, with each submodule defining a different executable (with @main
). This is my deps/build.jl
:
using AirspeedVelocity
AirspeedVelocity.BenchPkg.comonicon_install()
AirspeedVelocity.BenchPkgPlot.comonicon_install()
AirspeedVelocity.BenchPkgTable.comonicon_install()
This works fine, and gives me three commands: benchpkg
, benchpkgplot
, and benchpkgtable
, which is what I want.
However, when I ask for system image versions, like this:
using AirspeedVelocity
using Comonicon: Configs
sysimg_settings = Configs.SysImg(; incremental=true, filter_stdlibs=false)
AirspeedVelocity.BenchPkg.comonicon_install(; sysimg=sysimg_settings)
AirspeedVelocity.BenchPkgPlot.comonicon_install(; sysimg=sysimg_settings)
AirspeedVelocity.BenchPkgTable.comonicon_install(; sysimg=sysimg_settings)
I get the following error:
ERROR: LoadError: package(s) BenchPkg not in project
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] check_packages_in_project(ctx::Pkg.Types.Context, packages::Vector{String})
@ PackageCompiler ~/.julia/packages/PackageCompiler/i90pX/src/PackageCompiler.jl:112
[3] create_sysimage(packages::Vector{Symbol}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
@ PackageCompiler ~/.julia/packages/PackageCompiler/i90pX/src/PackageCompiler.jl:516
[4] create_sysimage
@ ~/.julia/packages/PackageCompiler/i90pX/src/PackageCompiler.jl:476 [inlined]
[5] build_sysimg(m::Module, options::Comonicon.Configs.Comonicon; incremental::Bool, cpu_target::String, filter_stdlibs::Bool)
@ Comonicon.Builder ~/.julia/packages/Comonicon/rMXvw/src/builder/sysimg.jl:13
[6] build_sysimg
@ ~/.julia/packages/Comonicon/rMXvw/src/builder/sysimg.jl:1 [inlined]
[7] install_sysimg(m::Module, options::Comonicon.Configs.Comonicon)
@ Comonicon.Builder ~/.julia/packages/Comonicon/rMXvw/src/builder/install.jl:60
[8] install(m::Module, options::Comonicon.Configs.Comonicon)
@ Comonicon.Builder ~/.julia/packages/Comonicon/rMXvw/src/builder/install.jl:13
[9] (::Comonicon.Builder.var"#2#3"{Module, Comonicon.Configs.Comonicon})()
@ Comonicon.Builder ~/.julia/packages/Comonicon/rMXvw/src/builder/cli.jl:64
[10] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging ./logging.jl:514
[11] with_logger
@ ./logging.jl:626 [inlined]
[12] command_main(m::Module, options::Comonicon.Configs.Comonicon)
@ Comonicon.Builder ~/.julia/packages/Comonicon/rMXvw/src/builder/cli.jl:63
[13] #command_main#1
@ ~/.julia/packages/Comonicon/rMXvw/src/builder/cli.jl:49 [inlined]
[14] command_main
@ ~/.julia/packages/Comonicon/rMXvw/src/builder/cli.jl:47 [inlined]
[15] #comonicon_install#3
@ ~/.julia/packages/Comonicon/rMXvw/src/frontend/cast.jl:495 [inlined]
[16] top-level scope
@ ~/AirspeedVelocity.jl/deps/build.jl:6
[17] include(fname::String)
@ Base.MainInclude ./client.jl:478
[18] top-level scope
@ none:5
in expression starting at /Users/mcranmer/AirspeedVelocity.jl/deps/build.jl:6
This needs more changes since I wasn't expecting the cases with multiple entries - they make no difference with single-entry multiple sub-commands for Julia and perhaps worse latency then you would expect... because Julia will still load the whole package instead of one single sub-module.