Skip to content

Installation of DSGE.jl broken on Julia v1.5 for Windows #1943

@JuergenWiemers

Description

@JuergenWiemers

As mentioned here installation on Windows starting from Julia v1.1 seems to be broken right now. I can confirm that this is still an issue on Julia v1.5 for Windows. When trying to install DSGE.jl in a clean environment I get:

ERROR: Error when installing package DSGE:
AssertionError: length(dirs) == 1
Stacktrace:
 [1] install_archive(::Array{Pair{String,Bool},1}, ::Base.SHA1, ::String) at D:\buildbot\worker\ppackage_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:562
 [2] macro expansion at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\srackage_win64\build\usr\share\julia\stdlib\v1.rc\Operations.jl:727 [inlined]
 [3] (::Pkg.Operations.var"#58#61"{Bool,Pkg.Types.Context,Dict{Base.UUID,Array{String,1}},Channelc\Operations.jl:727 [inlined]l{Any},Channel{Any}})() at .\task.jl:356  

The function install_archive() in Operations.jl checks whether the temporary folder, which includes the extracted package, contains exactly one path - excluding a possible spurious file called pax_global_header, which seemingly 7z might create on Windows. Starting on line 559 of Operations.jl:

dirs = readdir(dir)
# 7z on Win might create this spurious file
filter!(x -> x != "pax_global_header", dirs)
@assert length(dirs) == 1
unpacked = joinpath(dir, dirs[1])

However, for DSGE.jl the contents of the temporary folder that is created during the installation of DSGE.jl look like this:

julia> tp = "C:/Users/Juergen/AppData/Local/Temp/84mXPHT7jq6E/" # that's the random temp path
julia> readdir(tp)
13-element Array{String,1}:
 "4e6ee4544e19ad2bafb35de9c647ce2e1d3f74c7.data"
 "4e6ee4544e19ad2bafb35de9c647ce2e1d3f74c7.paxheader"
 "5b8fa286e6a8358c29532fad1b593b644169585e.data"
 "5b8fa286e6a8358c29532fad1b593b644169585e.paxheader"
 "634244007a6e3cbe50fba432cce3285b48c42ee2.data"
 "634244007a6e3cbe50fba432cce3285b48c42ee2.paxheader"
 "FRBNY-DSGE-DSGE.jl-a824dcd"
 "bc56c6b6969d5a0662d910e703089c2786d69168.data"
 "bc56c6b6969d5a0662d910e703089c2786d69168.paxheader"
 "e17f8432420fc31d1ddcca8003fba9b91968c096.data"
 "e17f8432420fc31d1ddcca8003fba9b91968c096.paxheader"
 "eef350acd564c108036f8adf58f321418d003fa1.data"
 "eef350acd564c108036f8adf58f321418d003fa1.paxheader"

Thus, filtering pax_global_header doesn't help because it isn't even there. Instead there is a bunch of other .data and .paxheader files, which are not filtered out such that @assert length(dirs) == 1 errors.

A quick fix would simply replace

filter!(x -> x != "pax_global_header", dirs)

with

filter!(x -> (x != "pax_global_header") &
            !endswith(x, ".data") &
            !endswith(x, ".paxheader") , dirs)

(However, the fix is not really future proof, because installation of a package will break whenever 7z writes other spurious files which don't match the filter patterns above...). I should also mention that I never had this issue with any other package in Julia (and I installed quite a lot...).

Version info:

Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA = "C:\Users\Juergen\AppData\Local\Programs\Julia 1.5.0\bin\"
  JULIA_EDITOR = "C:\Users\Juergen\AppData\Local\Programs\Microsoft VS Code\Code.exe"
  JULIA_NUM_THREADS = 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions