Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@quickactivate breaks ChainRules precompilation #348

Closed
masenka31 opened this issue Jun 9, 2022 · 3 comments
Closed

@quickactivate breaks ChainRules precompilation #348

masenka31 opened this issue Jun 9, 2022 · 3 comments
Labels
from-elsewhere This issue seems to stem from a different source (that is used by DrWatson) more info Needs more info to be resolved.

Comments

@masenka31
Copy link

Hi, I'm getting an error similar to JuliaDiff/ChainRules.jl#598

When I activate environment with

using DrWatson
@quickactivate

Precompilation of ChainRules.jl breaks with error:

[ Info: Precompiling ChainRules [082447d4-558c-5d27-93f4-14fc19e9eca2]
ERROR: LoadError: UndefVarError: allequal not defined
Stacktrace:
  [1] top-level scope
    @ ~/.julia/packages/ChainRulesCore/GUvJT/src/rule_definition_tools.jl:383
  [2] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [3] include(x::String)
    @ ChainRules ~/.julia/packages/ChainRules/uh22h/src/ChainRules.jl:1
  [4] top-level scope
    @ ~/.julia/packages/ChainRules/uh22h/src/ChainRules.jl:27
  [5] include
    @ ./Base.jl:418 [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::Nothing)
    @ Base ./loading.jl:1318
  [7] top-level scope
    @ none:1
  [8] eval
    @ ./boot.jl:373 [inlined]
  [9] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [10] top-level scope
    @ none:1
in expression starting at /home/maskomic/.julia/packages/ChainRules/uh22h/src/rulesets/Base/nondiff.jl:99
in expression starting at /home/maskomic/.julia/packages/ChainRules/uh22h/src/ChainRules.jl:1
ERROR: Failed to precompile ChainRules [082447d4-558c-5d27-93f4-14fc19e9eca2] to /home/maskomic/.julia/compiled/v1.7/ChainRules/jl_y9fhTb.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:997

However, when activating environment with ] activate ., everything works fine, even when importing DrWatson later on.

I am running current DrWatson.jl v2.9.1 on Julia 1.7.2 with this environment:

(GroupAD) pkg> st
      Status `~/projects/fork/GroupAD.jl/Project.toml`
  [c7e460c6] ArgParse v1.1.4
  [fbb218c0] BSON v0.3.5
  [052768ef] CUDA v3.10.1
  [082447d4] ChainRules v1.35.2
  [c648c4dd] ConditionalDists v0.4.10
  [124859b0] DataDeps v0.7.8
  [a93c6f00] DataFrames v1.3.4
  [b4f34e82] Distances v0.10.7
  [31c24e10] Distributions v0.25.62
  [ced4e74d] DistributionsAD v0.6.40
  [634d3b9d] DrWatson v2.9.1
  [251d5f9e] EvalMetrics v0.2.1
  [5789e2e9] FileIO v1.14.0
  [587475ba] Flux v0.12.10
  [432009dd] Flux3D v0.1.6
  [f67ccb44] HDF5 v0.16.9
  [9920b226] MLDataPattern v0.5.5
  [1d0525e4] Mill v2.7.1
  [b8a86587] NearestNeighbors v0.4.10
  [189a3867] Reexport v1.2.2
  [2913bbd2] StatsBase v0.33.16
  [f3b207a7] StatsPlots v0.14.34
  [98cad3c8] ValueHistories v0.5.4
  [8bb1440f] DelimitedFiles
  [37e2e46d] LinearAlgebra
  [a63ad114] Mmap
  [9a3f8284] Random
  [10745b16] Statistics

The minimal example would be simply

using DrWatson
@quickactivate
using ChainRules

People reporting the bug in different packages (ChainRules, ChainRulesCore, Flux) usually fixed it with updating packages, but my behavior is different, since everything works when not using @quickactivate. Any idea why that might be? Any help appreciated, thanks :)

@Datseris Datseris added from-elsewhere This issue seems to stem from a different source (that is used by DrWatson) more info Needs more info to be resolved. labels Jun 9, 2022
@Datseris
Copy link
Member

Datseris commented Jun 9, 2022

Sorry, I know nothing about ChainRules.jl and how it works, so I can't help here. However what I'm finding difficult to understand is whether this is a DrWatson issue or a ChainRules issue. What I mean is, @quickactivate is agnostic to the rest of the project's packages, and in fact simply uses well-established Pkg commands. So, it is difficult for me to understand why this is a DrWatson issue, and I would be inclined to believe it is a ChainRules issue.

Or perhaps it matters that you use a macro? If you do the same by explictly calling quiactivate(@__DIR__) or quickactiavte(explicit_path), do you get same error?

@masenka31
Copy link
Author

I played with it a little bit more and it seems that simply using DrWatson breaks the ChainRules package. When I do

using DrWatson
] activate .
using ChainRules

it breaks as well. It seems that loading any package before activating the environment (does not matter if with DrWatson or with Pkg), it breaks. Did not think about this possibility, but I tested it with another package, and it happens as well. Not a DrWatson.jl issue then, will move it to ChainRules. Thanks anyways, and sorry for the wrong bug. I guess it can be deleted.

@Datseris
Copy link
Member

Datseris commented Jun 9, 2022

no worries, glad you found a solution in the end!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from-elsewhere This issue seems to stem from a different source (that is used by DrWatson) more info Needs more info to be resolved.
Projects
None yet
Development

No branches or pull requests

2 participants