@@ -7,6 +7,7 @@ using Printf
77using UUIDs
88using Tar
99using Glob
10+ import SHA
1011
1112include (" utils.jl" )
1213
4445end
4546
4647"""
47- bundle(dir; output = "", force=false, allownoenv=false, verbose = true)
48+ bundle(dir; output = "", force=false, allownoenv=false, verbose = true) -> String
4849
4950Creates a `.tar` file with the contents of `dir` as well as
5051any packages that are either tracked by path (developed) outside
@@ -55,8 +56,12 @@ be made available by adding it to `DEPOT_PATH`.
5556
5657`.git` and [globs](https://en.wikipedia.org/wiki/Glob_(programming)) listed in
5758`.juliabundleignore` are excluded form the bundle.
59+
60+ Returns the hex-encoded SHA256 of the `Manifest.toml` file that is packed into the appbundle.
61+ The return value is used when requesting a sysimage build, in which case we have to pass the
62+ manifest's hash with the submit request.
5863"""
59- function bundle (dir; output= " " , force= false , allownoenv= false , verbose= true )
64+ function bundle (dir; output= " " , force= false , allownoenv= false , verbose= true ):: String
6065 if ! isdir (dir)
6166 error (" '$(dir) ' is not a directory" )
6267 end
@@ -112,6 +117,7 @@ function bundle(dir; output="", force=false, allownoenv=false, verbose=true)
112117 end
113118 end
114119 Pkg. Types. write_manifest (manifest, bundle_manifest)
120+ manifest_sha = bytes2hex (open (SHA. sha2_256, bundle_manifest))
115121 verbose && prettyprint (" Archiving" , " into $(repr (abspath (output_tar))) " )
116122
117123 Tar. create (path_filterer (tmp_dir), tmp_dir, output_tar)
@@ -123,7 +129,7 @@ To run code on another machine:
123129- Upload `$(output_tar) ` to the machine and unpack it
124130- Run `julia --project=$(name) -e 'push!(DEPOT_PATH, "$name /.bundle/depot"); import Pkg; Pkg.instantiate(); include("$name /main.jl"); main()'`""" ,
125131 )
126- return nothing
132+ return manifest_sha
127133end
128134
129135function bundle_packages (ctx, dir, packages_tracked_pkg_server; verbose= true )
0 commit comments