Stream: helpdesk (published)

Topic: Get package versions loaded by PackageCompiler app


view this post on Zulip Simon Christ (Mar 10 2022 at 13:01):

I tried to get the versions of Packages loaded by an app created with PackageCompiler.jl, but

using Pkg
function julia_main()::Cint
  Pkg.status()
  return 0
end

gives

Project OCTOPOS_DASH v0.0.0
      Status `~/.julia/dev/OCTOPOS/dashapp/share/julia/Project.toml`
IOError: readdir("~/.julia/dev/OCTOPOS/dashapp/share/julia/stdlib/v1.7"): no such file or directory (ENOENT)

view this post on Zulip Nils (Mar 10 2022 at 13:03):

Maybe I'm misunderstanding the question, but isn't this expected? PackageCompiler essentially creates a new sysimage where the packages in the sysimage are like standard libraries, so similar to how you can't get a version for Statistics in base Julia you can't get a version for packages in a sysimage if I understand correctly?

view this post on Zulip Fredrik Ekre (Mar 10 2022 at 13:41):

On master this information is stored: https://github.com/JuliaLang/julia/pull/44318

view this post on Zulip Fredrik Ekre (Mar 10 2022 at 13:43):

Probably you can embed the output when precompiling though, something like

status_str = begin
    io = IOBuffer();
    Pkg.status(; io=io)
    String(take!(io))
end

Last updated: Nov 22 2024 at 04:41 UTC