# Controlling Artifacts download, hash, and environment in 1.3

**URL:** https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868
**Category:** General Usage
**Tags:** question
**Created:** [December 4, 2019, 7:38pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868 "2019-12-04T19:38:31Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![crinders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crinders/32/8434_2.png) [@crinders](https://discourse.julialang.org/u/crinders)
#### Post date: [December 4, 2019, 7:38pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/1 "2019-12-04T19:38:32Z")

</div>

I compiled release-1.3.1.-pre and ran

```julia
julia> ]up

```

with the unsatisfying result:

```julia-auto
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed Arpack_jll ─ v3.5.0+2
┌ Error: Tree Hash Mismatch!
│ Expected git-tree-sha1: fb4dd08b8749e56059d80d8c1787a70f5765dddd
│ Calculated git-tree-sha1: acc34f180dca39625eabb5878e76aa1a4de8d94a
└ @ Pkg.Artifacts ~/tmp/julia/usr/share/julia/stdlib/v1.3/Pkg/src/Artifacts.jl:724
ERROR: Unable to automatically install 'Arpack' from '[...]/.julia/packages/Arpack_jll/HCY9Y/Artifacts.toml'
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] #ensure_artifact_installed#42(::Pkg.BinaryPlatforms.Linux, ::Bool, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/Artifacts.jl:810
 [3] (::Pkg.Artifacts.var"#kw##ensure_artifact_installed")(::NamedTuple{(:platform, :verbose),Tuple{Pkg.BinaryPlatforms.Linux,Bool}}, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at ./none:0 [4] #ensure_all_artifacts_installed#43(::Pkg.BinaryPlatforms.Linux, ::Nothing, ::Bool, ::Bool, ::typeof(Pkg.Artifacts.ensure_all_artifacts_installed), ::String) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/Artifacts.jl:852
 [5] #ensure_all_artifacts_installed at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:0 [inlined]
 [6] #download_artifacts#78(::Pkg.BinaryPlatforms.Linux, ::Bool, ::typeof(Pkg.Operations.download_artifacts), ::Array{String,1}) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:580
 [7] #download_artifacts at ./none:0 [inlined]
 [8] #download_artifacts#73(::Pkg.BinaryPlatforms.Linux, ::Bool, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:570
 [9] download_artifacts(::Array{Pkg.Types.PackageSpec,1}) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:569
 [10] up(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Pkg.Types.UpgradeLevel) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:1103
 [11] #up#43(::Pkg.Types.UpgradeLevel, ::Pkg.Types.PackageMode, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.up), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:170
 [12] up at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:146 [inlined]
 [13] do_up!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:492
 [14] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Base.invokelatest), ::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:709
 [15] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:708
 [16] do_cmd!(::Pkg.REPLMode.Command, ::REPL.LineEditREPL) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:412
 [17] #do_cmd#23(::Bool, ::typeof(Pkg.REPLMode.do_cmd), ::REPL.LineEditREPL, ::String) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:391
 [18] do_cmd at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:387 [inlined]
 [19] (::Pkg.REPLMode.var"#28#31"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at [...]/julia/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:619
 [20] #invokelatest#1 at ./essentials.jl:709 [inlined]
 [21] invokelatest at ./essentials.jl:708 [inlined]
 [22] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at [...]/julia/usr/share/julia/stdlib/v1.3/REPL/src/LineEdit.jl:2306
 [23] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at [...]/julia/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:1045
 [24] run_repl(::REPL.AbstractREPL, ::Any) at [...]/julia/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:201
 [25] (::Base.var"#770#772"{Bool,Bool,Bool,Bool})(::Module) at ./client.jl:382
 [26] #invokelatest#1 at ./essentials.jl:709 [inlined]
 [27] invokelatest at ./essentials.jl:708 [inlined]
 [28] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:366
 [29] exec_options(::Base.JLOptions) at ./client.jl:304
 [30] _start() at ./client.jl:460

```

I tried removing `Arpack_jll`, `Arpack` from the packages directory to get a clean rebuild, but that didn’t help.

How do I remedy this issue?

### Update 1:

More checking reveals that renaming the artifacts directory overrides the error, but the same thing happens with the next package (in this case OpenBLAS). So I suspect an error in producing the tree hash. Which variable can I set to check the download and hashing procedure?

---

<div class="post-metadata">

### Author: ![crinders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crinders/32/8434_2.png) [@crinders](https://discourse.julialang.org/u/crinders)
#### Post date: [December 4, 2019, 8:38pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/2 "2019-12-04T20:38:41Z")

</div>

I’ve downloaded the package that Artifacts.jl is supposed to download and my own hash coincides with the correct one.

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [December 4, 2019, 10:14pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/3 "2019-12-04T22:14:03Z")

</div>

What’s your `umask`?

---

<div class="post-metadata">

### Author: ![henry2004y](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henry2004y/32/9284_2.png) [@henry2004y](https://discourse.julialang.org/u/henry2004y)
#### Post date: [December 4, 2019, 10:28pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/4 "2019-12-04T22:28:39Z")

</div>

Maybe similar to this [issue](https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/527)?

I solved it on my machine by reset the umask.

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [December 4, 2019, 11:06pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/5 "2019-12-04T23:06:24Z")

</div>

Just to make it clear: the fact that restrictive umasks cause problems is unfortunate and it’ll hopefully be fixed in Julia 1.3.1, but we need to know whether the problems @crinders is facing is due to the umask or something else.

---

<div class="post-metadata">

### Author: ![crinders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crinders/32/8434_2.png) [@crinders](https://discourse.julialang.org/u/crinders)
#### Post date: [December 4, 2019, 11:19pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/6 "2019-12-04T23:19:38Z")

</div>

I’m not actually sure and I can’t check right now. Previously though, it wasn’t a problem, i.e. with 1.3.0-rc5 or with 1.2. Is it only an issue with the new Artifacts facility?

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [December 4, 2019, 11:31pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/7 "2019-12-04T23:31:20Z")

</div>

Arpack.jl started using Artifacts 14 hours ago: [https://github.com/JuliaLinearAlgebra/Arpack.jl/pull/81](https://github.com/JuliaLinearAlgebra/Arpack.jl/pull/81)

---

<div class="post-metadata">

### Author: ![crinders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crinders/32/8434_2.png) [@crinders](https://discourse.julialang.org/u/crinders)
#### Post date: [December 5, 2019, 3:36pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/8 "2019-12-05T15:36:37Z")

</div>

umask is 0037. I don’t see how that should screw up anything since manual extraction with wget using the same umask generates the correct hash.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [December 5, 2019, 5:02pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/9 "2019-12-05T17:02:50Z")

</div>

Because there was a bug in 1.3.0 that used the group executable bit when computing the git hash instead of the user executable bit. Git itself doesn’t have this bug. It will be fixed in 1.3.1 which should be released soon. Did you get the correct hash when extracting with wget and calling `Pkg.GitTools.tree_hash` to compute the hash? That’s the function that had the bug.

---

<div class="post-metadata">

### Author: ![crinders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crinders/32/8434_2.png) [@crinders](https://discourse.julialang.org/u/crinders)
#### Post date: [December 5, 2019, 5:37pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868/10 "2019-12-05T17:37:59Z")

</div>

`Pkg.GitTools.tree_hash` gives the wrong hash.
