Skip to content

Commit

Permalink
Merge pull request #64 from PumasAI/mh/pin
Browse files Browse the repository at this point in the history
Add `Pkg.pin` config
  • Loading branch information
MichaelHatherly authored Dec 10, 2024
2 parents 97669c4 + 001bea6 commit 384323f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/install.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ function main()
isfile(file) ? TOML.parsefile(file) : Dict{String,Any}()
end
juliaup_toml = get(Dict{String,Any}, package_bundler_toml, "juliaup")
pkg_toml = get(Dict{String,Any}, package_bundler_toml, "Pkg")
pin = get(pkg_toml, "pin", false)
custom_juliaup_channel = !isempty(juliaup_toml)
extra_args = get(juliaup_toml, "args", String[])
manifest_toml = TOML.parsefile(joinpath(path, "Manifest.toml"))
Expand All @@ -171,6 +173,7 @@ function main()
julia_version,
extra_args,
custom_juliaup_channel,
pin,
),
)
else
Expand All @@ -189,7 +192,8 @@ function main()
channel = "+$(julia_version)"
environment = "@$(each.environment)"
try
code = "push!(LOAD_PATH, \"@stdlib\"); import Pkg; Pkg.resolve(); Pkg.precompile();"
pinned = each.pin ? "Pkg.pin(; all_pkgs = true)" : "nothing"
code = "push!(LOAD_PATH, \"@stdlib\"); import Pkg; Pkg.resolve(); $pinned; Pkg.precompile();"
run(`julia $(channel) --startup-file=no --project=$(environment) -e $code`)
catch error
@error "Failed to resolve and precompile environment" julia_version environment error
Expand Down

0 comments on commit 384323f

Please sign in to comment.