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

create_app doesn't include artifacts needed by Pkg #719

Open
AshlinHarris opened this issue Sep 13, 2022 · 1 comment
Open

create_app doesn't include artifacts needed by Pkg #719

AshlinHarris opened this issue Sep 13, 2022 · 1 comment

Comments

@AshlinHarris
Copy link
Contributor

AshlinHarris commented Sep 13, 2022

I'm unable to create a functioning app that uses Pkg.

Recreating the error

  1. Generate a package with Pkg as a dependency:
julia> using Pkg
julia> Pkg.generate("MyPackage")
pkg> activate MyPackage
pkg> add Pkg
  1. Edit MyPackage/src/MyPackage.jl:
module MyPackage
export julia_main
using Pkg

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

end # module MyPackage
  1. Make an app:
pkg> activate --temp
julia> using PackageCompiler
julia> create_app("MyPackage", "Compiled", incremental=true)

The app compiles successfully, but running it returns an error due to p7zip_jll being missing. This occurs even if I insert the standard libraries into the Project file with Pkg.add([x[1] for x in values(Pkg.Types.stdlibs())]). The issue exists on Linux, MacOS, and Windows.

Workaround

If I manually install 7Zip, the error message becomes clearer:

IOError: readdir("/home/aharri69/temp/Compiled/share/julia/stdlib/v1.8"): no such file or directory (ENOENT)

Then, if I copy share/julia/stdlib/v1.8/ from my local Julia install, the executable works as expected.

Question

Should the artifacts for standard libraries be copied by default, since they are required for the executable to run?

Note

My goal is to assemble a standalone Julia installation that can be copied onto a secure server with no internet access. @DilumAluthge recommended trying create_sysimage() or create_app() for this, even though this is a tangential use case. Essentially, I'd like to make an app but delete the executable, leaving behind a Julia installation without external dependencies.

Update

I ended up using create_sysimage to generate the sysimage, bundling this with the artifacts directory and Julia files, and setting the environment manually. An example workflow can be found here.

@schlichtanders
Copy link

I am also interested in adding Pkg to an packagecompiler app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants