Skip to content

ERROR: LoadError: Failed to precompile ChainRules, on Julia master #609

Closed
@truedichotomy

Description

@truedichotomy

I encounted the following precompiling issue that seems to be rooted with ChainRules. I originally filed the issue here JuliaLang/julia#45053 (comment) and was asked to open the issue here in ChainRules.jl instead.

julia> Pkg.precompile()
Precompiling project...
  ✗ CpuId
  ✗ ChainRules
  ✗ Zygote
  ✗ Flux
  ✗ Metalhead
  ✗ Flux3D
  0 dependencies successfully precompiled in 11 seconds. 488 already precompiled.

ERROR: The following 4 direct dependencies failed to precompile:

Zygote [e88e6eb3-aa80-5325-afca-941959d7151f]

Failed to precompile Zygote [e88e6eb3-aa80-5325-afca-941959d7151f] to /Users/gong/.julia/compiled/v1.9/Zygote/jl_Hn1KwN.
ERROR: LoadError: UndefVarError: cumulative_compile_time_ns_before not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:31
 [2] top-level scope
   @ ~/.julia/packages/ChainRulesCore/RbX5a/src/rule_definition_tools.jl:383
 [3] include(mod::Module, _path::String)
   @ Base ./Base.jl:427
 [4] include(x::String)
   @ ChainRules ~/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:1
 [5] top-level scope
   @ ~/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:24
 [6] include
   @ ./Base.jl:427 [inlined]
 [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1423
 [8] top-level scope
   @ stdin:1
in expression starting at /Users/gong/.julia/packages/ChainRules/3yDBX/src/rulesets/Base/nondiff.jl:456
in expression starting at /Users/gong/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile ChainRules [082447d4-558c-5d27-93f4-14fc19e9eca2] to /Users/gong/.julia/compiled/v1.9/ChainRules/jl_POAaCh.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1574
  [3] compilecache
    @ ./loading.jl:1518 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1219
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1089
  [6] macro expansion
    @ ./loading.jl:1069 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1033
  [9] include
    @ ./Base.jl:427 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1423
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/gong/.julia/packages/Zygote/ytjqm/src/Zygote.jl:1
in expression starting at stdin:1

Flux [587475ba-b771-5e3f-ad9e-33799f191a9c]

Failed to precompile Flux [587475ba-b771-5e3f-ad9e-33799f191a9c] to /Users/gong/.julia/compiled/v1.9/Flux/jl_wIcWkw.
ERROR: LoadError: UndefVarError: cumulative_compile_time_ns_before not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:31
 [2] top-level scope
   @ ~/.julia/packages/ChainRulesCore/RbX5a/src/rule_definition_tools.jl:383
 [3] include(mod::Module, _path::String)
   @ Base ./Base.jl:427
 [4] include(x::String)
   @ ChainRules ~/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:1
 [5] top-level scope
   @ ~/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:24
 [6] include
   @ ./Base.jl:427 [inlined]
 [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1423
 [8] top-level scope
   @ stdin:1
in expression starting at /Users/gong/.julia/packages/ChainRules/3yDBX/src/rulesets/Base/nondiff.jl:456
in expression starting at /Users/gong/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile ChainRules [082447d4-558c-5d27-93f4-14fc19e9eca2] to /Users/gong/.julia/compiled/v1.9/ChainRules/jl_9jHEht.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1574
  [3] compilecache
    @ ./loading.jl:1518 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1219
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1089
  [6] macro expansion
    @ ./loading.jl:1069 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1033
  [9] include
    @ ./Base.jl:427 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1423
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/gong/.julia/packages/Zygote/ytjqm/src/Zygote.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Zygote [e88e6eb3-aa80-5325-afca-941959d7151f] to /Users/gong/.julia/compiled/v1.9/Zygote/jl_0hvXb5.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1574
  [3] compilecache
    @ ./loading.jl:1518 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1219
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1089
  [6] macro expansion
    @ ./loading.jl:1069 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1033
  [9] include
    @ ./Base.jl:427 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1423
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/gong/.julia/packages/Flux/7nTyc/src/Flux.jl:1
in expression starting at stdin:1


Metalhead [dbeba491-748d-5e0e-a39e-b530a07fa0cc]

Failed to precompile Metalhead [dbeba491-748d-5e0e-a39e-b530a07fa0cc] to /Users/gong/.julia/compiled/v1.9/Metalhead/jl_0yfIhf.
ERROR: LoadError: UndefVarError: cumulative_compile_time_ns_before not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:31
 [2] top-level scope
   @ ~/.julia/packages/ChainRulesCore/RbX5a/src/rule_definition_tools.jl:383
 [3] include(mod::Module, _path::String)
   @ Base ./Base.jl:427
 [4] include(x::String)
   @ ChainRules ~/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:1
 [5] top-level scope
   @ ~/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:24
 [6] include
   @ ./Base.jl:427 [inlined]
 [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1423
 [8] top-level scope
   @ stdin:1
in expression starting at /Users/gong/.julia/packages/ChainRules/3yDBX/src/rulesets/Base/nondiff.jl:456
in expression starting at /Users/gong/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile ChainRules [082447d4-558c-5d27-93f4-14fc19e9eca2] to /Users/gong/.julia/compiled/v1.9/ChainRules/jl_NO5VgL.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1574
  [3] compilecache
    @ ./loading.jl:1518 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1219
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1089
  [6] macro expansion
    @ ./loading.jl:1069 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1033
  [9] include
    @ ./Base.jl:427 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1423
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/gong/.julia/packages/Zygote/ytjqm/src/Zygote.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Zygote [e88e6eb3-aa80-5325-afca-941959d7151f] to /Users/gong/.julia/compiled/v1.9/Zygote/jl_IRfdUp.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1574
  [3] compilecache
    @ ./loading.jl:1518 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1219
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1089
  [6] macro expansion
    @ ./loading.jl:1069 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1033
  [9] include
    @ ./Base.jl:427 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1423
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/gong/.julia/packages/Flux/7nTyc/src/Flux.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Flux [587475ba-b771-5e3f-ad9e-33799f191a9c] to /Users/gong/.julia/compiled/v1.9/Flux/jl_DKzu3U.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1574
  [3] compilecache
    @ ./loading.jl:1518 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1219
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1089
  [6] macro expansion
    @ ./loading.jl:1069 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1033
  [9] include
    @ ./Base.jl:427 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1423
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/gong/.julia/packages/Metalhead/7deYu/src/Metalhead.jl:1
in expression starting at stdin:1


Flux3D [432009dd-59a1-4b72-8c93-6462ce9b220f]

Failed to precompile Flux3D [432009dd-59a1-4b72-8c93-6462ce9b220f] to /Users/gong/.julia/compiled/v1.9/Flux3D/jl_eqijyZ.
ERROR: LoadError: UndefVarError: cumulative_compile_time_ns_before not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:31
 [2] top-level scope
   @ ~/.julia/packages/ChainRulesCore/RbX5a/src/rule_definition_tools.jl:383
 [3] include(mod::Module, _path::String)
   @ Base ./Base.jl:427
 [4] include(x::String)
   @ ChainRules ~/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:1
 [5] top-level scope
   @ ~/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:24
 [6] include
   @ ./Base.jl:427 [inlined]
 [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1423
 [8] top-level scope
   @ stdin:1
in expression starting at /Users/gong/.julia/packages/ChainRules/3yDBX/src/rulesets/Base/nondiff.jl:456
in expression starting at /Users/gong/.julia/packages/ChainRules/3yDBX/src/ChainRules.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile ChainRules [082447d4-558c-5d27-93f4-14fc19e9eca2] to /Users/gong/.julia/compiled/v1.9/ChainRules/jl_SoIfzN.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1574
  [3] compilecache
    @ ./loading.jl:1518 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1219
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1089
  [6] macro expansion
    @ ./loading.jl:1069 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1033
  [9] include
    @ ./Base.jl:427 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1423
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/gong/.julia/packages/Zygote/ytjqm/src/Zygote.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Zygote [e88e6eb3-aa80-5325-afca-941959d7151f] to /Users/gong/.julia/compiled/v1.9/Zygote/jl_nlVwMC.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1574
  [3] compilecache
    @ ./loading.jl:1518 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1219
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1089
  [6] macro expansion
    @ ./loading.jl:1069 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1033
  [9] include
    @ ./Base.jl:427 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1423
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/gong/.julia/packages/Flux/7nTyc/src/Flux.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Flux [587475ba-b771-5e3f-ad9e-33799f191a9c] to /Users/gong/.julia/compiled/v1.9/Flux/jl_VZhshd.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1574
  [3] compilecache
    @ ./loading.jl:1518 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1219
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1089
  [6] macro expansion
    @ ./loading.jl:1069 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1033
  [9] include
    @ ./Base.jl:427 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1423
 [11] top-level scope
    @ stdin:1
in expression starting at /Users/gong/.julia/packages/Flux3D/Ym3xP/src/Flux3D.jl:1
in expression starting at stdin:1

Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types ~/GitHub/julia/usr/share/julia/stdlib/v1.9/Pkg/src/Types.jl:68
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{String}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API ~/GitHub/julia/usr/share/julia/stdlib/v1.9/Pkg/src/API.jl:1427
 [3] precompile
   @ ~/GitHub/julia/usr/share/julia/stdlib/v1.9/Pkg/src/API.jl:1060 [inlined]
 [4] #precompile#225
   @ ~/GitHub/julia/usr/share/julia/stdlib/v1.9/Pkg/src/API.jl:1057 [inlined]
 [5] precompile (repeats 2 times)
   @ ~/GitHub/julia/usr/share/julia/stdlib/v1.9/Pkg/src/API.jl:1057 [inlined]
 [6] top-level scope
   @ REPL[4]:1

versioninfo():

Julia Version 1.9.0-DEV.425
Commit 4340d23d28 (2022-04-21 08:06 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.4.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
  Threads: 1 on 4 virtual cores

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