diff --git a/src/packagedef.jl b/src/packagedef.jl index 6c9570c3..41403425 100644 --- a/src/packagedef.jl +++ b/src/packagedef.jl @@ -178,13 +178,21 @@ function fallback_juliadir() normpath(candidate) end +if VERSION >= v"1.8" +Core.eval(@__MODULE__, :(global juliadir::String)) +else +Core.eval(@__MODULE__, :(global juliadir #= ::Any =#; nothing)) +end + """ Revise.juliadir Constant specifying full path to julia top-level source directory. This should be reliable even for local builds, cross-builds, and binary installs. """ -const juliadir = normpath( +juliadir + +juliadir = normpath( if isdir(joinpath(basebuilddir, "base")) basebuilddir else diff --git a/test/juliadir.jl b/test/juliadir.jl index 771a07e7..48d05595 100644 --- a/test/juliadir.jl +++ b/test/juliadir.jl @@ -1,11 +1,12 @@ using Revise, InteractiveUtils, Test -@eval Revise const juliadir = ARGS[1] +@eval Revise juliadir = ARGS[1] @test Revise.juliadir != Revise.basebuilddir @test Revise.juliadir != Revise.fallback_juliadir() -@show Revise.juliadir - # https://github.com/timholy/Revise.jl/issues/697 -@test Revise.definition(@which(Float32(π))) isa Expr +let def = Revise.definition(@which(Float32(π))) + @test isa(def, Expr) + @test Meta.isexpr(def, :macrocall) +end