Skip to content

Add function Pkg.create_sysimage(package_name="", test_script="", update=true) #3094

@ufechner7

Description

@ufechner7

Feature request

There should be a standard method to create a system image. Of course there are many options and it is not so clear how to implement this feature in a general way. My suggestion:

  1. this function should check of a local environment is activated and abort if not
  2. if a package name is provided, it should:
    2.1 update all packages of the local environment if the parameter update is true
    2.1 precompile all packages
    2.2 install the package PackageCompiler
    2.3 create a folder bin if it doesn't exist
    2.4 copy the files "create_sysimage.sh", "create_sysimage.bat", "run_julia.sh" and "run_julia.bat" from bin folder of the package package_name to a local bin folder
    2.5 create a folder test if it doesn't exist
    2.6 copy the files "test_for_precompile.jl" and "create_sysimage.jl" from the package "package_name" into the test folder
    2.7 execute the script "bin/create_sysimage.sh" or "bin/create_sysimage.bat" depending on the OS
    2.9 terminate with the message:
    "To run Julia with the new sysimage, please add the bin folder to your search path and execute run_julia!"

This would work only for packages that include a create_sysimage.jl and a test_for_precompile.jl script. For packages that are not prepared for this workflow, all packages from the local environment should be included in the sysimage and the test_script that is provided as parameter should be used.

Any comments welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions