How to get Julia home in Julia 0.7?

question

#1

How can I get Julia home directory in 0.7? In 0.6 we could ccall jl_get_julia_home, but it seems to be missing from the latest master.

Context: I’m trying to help in migrating Sugar.jl which uses jl_get_julia_home to discover Base sources and extract code from there.


Allow Pkg.dir on JuliaBox
#2

Perhaps joinpath(homedir(),".julia") ?


#3

Apparently the runtime function is now jl_get_julia_bindir(), but perhaps it’s better to use Sys.BINDIR.


#4

joinpath(homedir(),".julia") returns package path, not path to Julia installation where Base files are. Sys.BINDIR does the trick, thanks!


#5

That’s the default package path, which doesn’t take the JULIA_PKGDIR environment variable into account. Pkg.Dir._pkgroot() should be used on master for the package path. Just to avoid confusion.