Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SysImg install incompatible with submodules #239

Open
MilesCranmer opened this issue Apr 23, 2023 · 1 comment
Open

[BUG] SysImg install incompatible with submodules #239

MilesCranmer opened this issue Apr 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@MilesCranmer
Copy link

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
@MilesCranmer MilesCranmer added the bug Something isn't working label Apr 23, 2023
@Roger-luo
Copy link
Collaborator

Roger-luo commented Apr 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants