NREL-Sienna / InfrastructureSystems.jl

Utility package for Sienna's simulation infrastructure
https://nrel-sienna.github.io/InfrastructureSystems.jl/
BSD 3-Clause "New" or "Revised" License
39 stars 20 forks source link

IS 1.7 failing to precompile with `MethodError: no method matching dirname(::Nothing)` #232

Closed raphaelsaavedra closed 3 years ago

raphaelsaavedra commented 3 years ago

Stacktrace:

ERROR: LoadError: LoadError: MethodError: no method matching dirname(::Nothing)
Closest candidates are:
  dirname(::AbstractString) at path.jl:161
Stacktrace:
  [1] top-level scope
    @ ~/.julia/packages/InfrastructureSystems/fbqgd/src/utils/logging.jl:20
  [2] include(mod::Module, _path::String)
    @ Base ./Base.jl:386
  [3] include(x::String)
    @ InfrastructureSystems ~/.julia/packages/InfrastructureSystems/fbqgd/src/InfrastructureSystems.jl:3
  [4] top-level scope
    @ ~/.julia/packages/InfrastructureSystems/fbqgd/src/InfrastructureSystems.jl:73
  [5] include
    @ ./Base.jl:386 [inlined]
  [6] 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:1213
  [7] top-level scope
    @ none:1
  [8] eval
    @ ./boot.jl:360 [inlined]
  [9] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [10] top-level scope
    @ none:1
in expression starting at /Users/raphaelsaavedra/.julia/packages/InfrastructureSystems/fbqgd/src/utils/logging.jl:20
in expression starting at /Users/raphaelsaavedra/.julia/packages/InfrastructureSystems/fbqgd/src/InfrastructureSystems.jl:3
ERROR: LoadError: Failed to precompile InfrastructureSystems [2cd47ed4-ca9b-11e9-27f2-ab636a7671f1] to /Users/raphaelsaavedra/.julia/compiled/v1.6/InfrastructureSystems/jl_lTGqWJ.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] 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:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/raphaelsaavedra/.julia/packages/PowerSystems/DdZ5W/src/PowerSystems.jl:3
ERROR: LoadError: Failed to precompile PowerSystems [bcd98974-b02a-5e2f-9ee0-a103f5c450dd] to /Users/raphaelsaavedra/.julia/compiled/v1.6/PowerSystems/jl_Oes5V7.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] 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:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at ...
nickrobinson251 commented 3 years ago

Implicated line is https://github.com/NREL-SIIP/InfrastructureSystems.jl/blob/ce8f4eefadb9417fc4ed44a6808e27b7297b4409/src/utils/logging.jl#L20

Base.find_package("InfrastructureSystems") can return nothing

nickrobinson251 commented 3 years ago

maybe we want pathof(InfrastructureSystems) here?

daniel-thom commented 3 years ago

@nickrobinson251 Yes, sorry for the trouble.

daniel-thom commented 3 years ago

@jd-lara We need to adjust the CI/cross-package testing to import packages the way users do it.

nickrobinson251 commented 3 years ago

We need to adjust the CI/cross-package testing to import packages the way users do it.

Shall we open an issue for this?

I wonder what is different... maybe we need to add rather than develop? (but that's a wild guess) https://github.com/NREL-SIIP/InfrastructureSystems.jl/blob/d15c322cd662e12cb13923d640b5cf9b40629de1/.github/workflows/cross-package-test.yml#L37

jd-lara commented 3 years ago

We need to adjust the CI/cross-package testing to import packages the way users do it.

Shall we open an issue for this?

I wonder what is different... maybe we need to add rather than develop? (but that's a wild guess)

https://github.com/NREL-SIIP/InfrastructureSystems.jl/blob/d15c322cd662e12cb13923d640b5cf9b40629de1/.github/workflows/cross-package-test.yml#L37

I wonder why the current set up didn't pick it up. This issue also didn't came out in the PSY stand alone tests

raphaelsaavedra commented 3 years ago

I'm not super familiar with this workflow, but isn't it because you're only running checks for packages that directly depend on IS? I think this error would only occur in a package that has an indirect dependency e.g. having PSY as dep but not IS

jd-lara commented 3 years ago

To do that I think we need to make a dummy module with an IS dependency and some test workflow. We tried that at some point to test the @forward macro but it was a huge hassle that never really worked well.