Skip to content

Commit

Permalink
Add include_lazy_artifacts flag to create_app (issues/464).
Browse files Browse the repository at this point in the history
Co-Authored-By: Rob Vermaas <[email protected]>
  • Loading branch information
Sacha0 and rbvermaa committed Jan 7, 2021
1 parent e408e64 commit c4efb05
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/PackageCompiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ function create_app(package_dir::String,
audit=true,
force=false,
c_driver_program::String=joinpath(@__DIR__, "embedding_wrapper.c"),
cpu_target::String=default_app_cpu_target())
cpu_target::String=default_app_cpu_target(),
include_lazy_artifacts=true)
precompile_statements_file = abspath.(precompile_statements_file)
precompile_execution_file = abspath.(precompile_execution_file)
package_dir = abspath(package_dir)
Expand Down Expand Up @@ -653,7 +654,7 @@ function create_app(package_dir::String,
mkpath(app_dir)

bundle_julia_libraries(app_dir)
bundle_artifacts(ctx, app_dir)
bundle_artifacts(ctx, app_dir; include_lazy_artifacts=include_lazy_artifacts)

# TODO: Create in a temp dir and then move it into place?
binpath = joinpath(app_dir, "bin")
Expand Down Expand Up @@ -741,7 +742,7 @@ function bundle_julia_libraries(app_dir)
return
end

function bundle_artifacts(ctx, app_dir)
function bundle_artifacts(ctx, app_dir; include_lazy_artifacts=true)
@debug "bundling artifacts..."

pkgs = load_all_deps(ctx)
Expand All @@ -764,6 +765,12 @@ function bundle_artifacts(ctx, app_dir)
@debug "bundling artifacts for $(pkg.name)"
artifact_dict = Pkg.Artifacts.load_artifacts_toml(artifacts_toml_path)
for name in keys(artifact_dict)
if isa(artifact_dict[name], AbstractDict)
&& get(artifact_dict[name], "lazy", false)
&& !include_lazy_artifacts
@info "skipping lazy artifact \"$name\""
continue
end
meta = Pkg.Artifacts.artifact_meta(name, artifacts_toml_path)
meta == nothing && continue
@debug " \"$name\""
Expand Down

0 comments on commit c4efb05

Please sign in to comment.