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

mysterious deprecation warnings #37

Closed
ExpandingMan opened this issue Sep 15, 2021 · 2 comments · Fixed by #41
Closed

mysterious deprecation warnings #37

ExpandingMan opened this issue Sep 15, 2021 · 2 comments · Fixed by #41

Comments

@ExpandingMan
Copy link
Contributor

ExpandingMan commented Sep 15, 2021

Every time I use ReTest, I get the following deprecation warnings

WARNING: Compat.AbstractDateTime is deprecated, use Dates.AbstractDateTime instead.
  likely near none:1
WARNING: Compat.Fix2 is deprecated, use Base.Fix2 instead.
  likely near none:1
WARNING: Compat.IteratorEltype is deprecated, use Base.IteratorEltype instead.
  likely near none:1
WARNING: Compat.IteratorSize is deprecated, use Base.IteratorSize instead.
  likely near none:1
WARNING: Compat.MathConstants is deprecated, use Base.MathConstants instead.
  likely near none:1
WARNING: Compat.Sys is deprecated, use Base.Sys instead.
  likely near none:1
WARNING: Compat.TypeUtils is deprecated, call the respective Base functions directly
  likely near none:1
WARNING: Compat.dot is deprecated, use LinearAlgebra.dot instead.
  likely near none:1
WARNING: Compat.invokelatest is deprecated, use Base.invokelatest instead.
  likely near none:1
WARNING: Compat.macros_have_sourceloc is deprecated, use true instead.
  likely near none:1
WARNING: Compat.norm is deprecated, use LinearAlgebra.norm instead.
  likely near none:1
WARNING: Compat.notnothing is deprecated, use Base.notnothing instead.
  likely near none:1
WARNING: Compat.opnorm is deprecated, use LinearAlgebra.opnorm instead.
  likely near none:1
WARNING: Compat.qr is deprecated, use LinearAlgebra.qr instead.
  likely near none:1
WARNING: Compat.rmul! is deprecated, use LinearAlgebra.rmul! instead.
  likely near none:1
WARNING: Compat.tr is deprecated, use LinearAlgebra.tr instead.
  likely near none:1
WARNING: Compat.⋅ is deprecated, use LinearAlgebra.dot instead.
  likely near none:1
WARNING: TypeUtils.isabstract is deprecated, use isabstracttype instead.
  likely near none:1
WARNING: TypeUtils.parameter_upper_bound is deprecated, rewrite your code to use static parameters in dispatch or use `Base.rewrap_unionall((Base.unwrap_unionall(t)::DataType).parameters[idx], t)`.
  likely near none:1
WARNING: TypeUtils.typename is deprecated, use Base.typename instead.
  likely near none:1

Turning on errors, get the following stack trace

Compat.AbstractDateTime is deprecated, use Dates.AbstractDateTime instead.
ERROR: deprecated binding: Compat.AbstractDateTime
Stacktrace:
  [1] top-level scope
    @ :0
  [2] eval
    @ ./boot.jl:360 [inlined]
  [3] _broadcast_getindex_evalf
    @ ./broadcast.jl:648 [inlined]
  [4] _broadcast_getindex
    @ ./broadcast.jl:621 [inlined]
  [5] getindex
    @ ./broadcast.jl:575 [inlined]
  [6] copyto_nonleaf!
    @ ./broadcast.jl:1078 [inlined]
  [7] restart_copyto_nonleaf!(newdest::Vector{Any}, dest::Vector{Type}, bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, typeof(Core.eval), Tuple{Base.RefValue{Module}, Base.Broadcast.Extruded{Vector{Symbol}, Tuple{Bool}, Tuple{Int64}}}}, val::Function, I::Int64, iter::Base.OneTo{Int64}, state::Int64, count::Int64)
    @ Base.Broadcast ./broadcast.jl:1069
  [8] copyto_nonleaf!(dest::Vector{Type}, bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, typeof(Core.eval), Tuple{Base.RefValue{Module}, Base.Broadcast.Extruded{Vector{Symbol}, Tuple{Bool}, Tuple{Int64}}}}, iter::Base.OneTo{Int64}, state::Int64, count::Int64)
    @ Base.Broadcast ./broadcast.jl:1085
  [9] restart_copyto_nonleaf!(newdest::Vector{Type}, dest::Vector{DataType}, bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, typeof(Core.eval), Tuple{Base.RefValue{Module}, Base.Broadcast.Extruded{Vector{Symbol}, Tuple{Bool}, Tuple{Int64}}}}, val::Type, I::Int64, iter::Base.OneTo{Int64}, state::Int64, count::Int64)
    @ Base.Broadcast ./broadcast.jl:1069
 [10] copyto_nonleaf!(dest::Vector{DataType}, bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, typeof(Core.eval), Tuple{Base.RefValue{Module}, Base.Broadcast.Extruded{Vector{Symbol}, Tuple{Bool}, Tuple{Int64}}}}, iter::Base.OneTo{Int64}, state::Int64, count::Int64)
    @ Base.Broadcast ./broadcast.jl:1085
 [11] copy
    @ ./broadcast.jl:930 [inlined]
 [12] materialize
    @ ./broadcast.jl:883 [inlined]
 [13] submodules(m::Module)
    @ ReTest ~/.julia/packages/ReTest/QpXE2/src/utils.jl:6
 [14] recsubmodules(m::Module)
    @ ReTest ~/.julia/packages/ReTest/QpXE2/src/utils.jl:12
 [15] update_TESTED_MODULES!(double_check::Bool)
    @ ReTest ~/.julia/packages/ReTest/QpXE2/src/ReTest.jl:1461
 [16] process_args(args::Any; verbose::Bool, shuffle::Bool, recursive::Bool, load::Bool)
    @ ReTest ~/.julia/packages/ReTest/QpXE2/src/ReTest.jl:1342
 [17] retest(args::Union{Regex, AbstractString, Integer, Module, Symbol, Tuple, ReTest.Pattern, Pair{Module, var"#s247"} where var"#s247"<:Union{Regex, AbstractString, Integer, Symbol, Tuple, ReTest.Pattern, AbstractArray}, AbstractArray}; dry::Bool, stats::Bool, shuffle::Bool, group::Bool, verbose::Bool, recursive::Bool, id::Nothing, strict::Bool, dup::Bool, static::Nothing, load::Bool, seed::Bool, marks::Bool, tag::Vector{Symbol}, spin::Bool, clear::Bool)
    @ ReTest ~/.julia/packages/ReTest/QpXE2/src/ReTest.jl:770
 [18] retest(args::Union{Regex, AbstractString, Integer, Module, Symbol, Tuple, ReTest.Pattern, Pair{Module, var"#s247"} where var"#s247"<:Union{Regex, AbstractString, Integer, Symbol, Tuple, ReTest.Pattern, AbstractArray}, AbstractArray})
    @ ReTest ~/.julia/packages/ReTest/QpXE2/src/ReTest.jl:767
 [19] top-level scope
    @ REPL[4]:1
 [20] top-level scope
    @ ~/.julia/packages/Infiltrator/doHg1/src/Infiltrator.jl:473

So it seems like something ReTest is evaluating is causing a bunch of deprecation warnings... but it's very unclear to me what's going on. Any ideas?

(And no, I never saw any deprecation warnings from the package I was testing, and yes, I have them on.)

@ExpandingMan
Copy link
Contributor Author

I went in and had it print every module and here's what I found:

┌ Info: wtf
└   m = Compat
WARNING: Compat.AbstractDateTime is deprecated, use Dates.AbstractDateTime instead.
  likely near none:1
WARNING: Compat.Fix2 is deprecated, use Base.Fix2 instead.
  likely near none:1
WARNING: Compat.IteratorEltype is deprecated, use Base.IteratorEltype instead.
  likely near none:1
WARNING: Compat.IteratorSize is deprecated, use Base.IteratorSize instead.
  likely near none:1
WARNING: Compat.MathConstants is deprecated, use Base.MathConstants instead.
  likely near none:1
WARNING: Compat.Sys is deprecated, use Base.Sys instead.
  likely near none:1
WARNING: Compat.TypeUtils is deprecated, call the respective Base functions directly
  likely near none:1
WARNING: Compat.dot is deprecated, use LinearAlgebra.dot instead.
  likely near none:1
WARNING: Compat.invokelatest is deprecated, use Base.invokelatest instead.
  likely near none:1
WARNING: Compat.macros_have_sourceloc is deprecated, use true instead.
  likely near none:1
WARNING: Compat.norm is deprecated, use LinearAlgebra.norm instead.
  likely near none:1
WARNING: Compat.notnothing is deprecated, use Base.notnothing instead.
  likely near none:1
WARNING: Compat.opnorm is deprecated, use LinearAlgebra.opnorm instead.
  likely near none:1
WARNING: Compat.qr is deprecated, use LinearAlgebra.qr instead.
  likely near none:1
WARNING: Compat.rmul! is deprecated, use LinearAlgebra.rmul! instead.
  likely near none:1
WARNING: Compat.tr is deprecated, use LinearAlgebra.tr instead.
  likely near none:1
WARNING: Compat.⋅ is deprecated, use LinearAlgebra.dot instead.
  likely near none:1
┌ Info: wtf
└   m = Compat.CompatIterators
┌ Info: wtf
└   m = Compat.CompatIterators
┌ Info: wtf
└   m = Compat.TypeUtils
WARNING: TypeUtils.isabstract is deprecated, use isabstracttype instead.
  likely near none:1
WARNING: TypeUtils.parameter_upper_bound is deprecated, rewrite your code to use static parameters in dispatch or use `Base.rewrap_unionall((Base.unwrap_unionall(t)::DataType).parameters[idx], t)`.
  likely near none:1
WARNING: TypeUtils.typename is deprecated, use Base.typename instead.
  likely near none:1

So apparently every time submodules is called, it re-prints every deprecation warning for that package. Yikes. Not seeing any solutions here, so this looks pretty unpleasant.

@ExpandingMan
Copy link
Contributor Author

I have tried hacking this with redirect_stderr and redirect_stdout. Though this is a really unpleasant hack, my justification is that this is just trying to list names in a module and it's not really an appropriate place to see deprecation warnings.

However, much to my extreme frustration, redirect_ does not work for the deprecation warnings.

Anyone have any ideas how to silence this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant