New Pkg: Immediate Compile and Version Variable?


#1

I am beginning to use Julia 1.0. Pkg.dir() no longer seems to work (and has no docs). What has replaced it? Pkg.status() works differently. Alas, these are just minor questions. I have a reason for posting to development"

  1. Should the default on Pkg.add() be to do the first-time compilation right away, too? Who would want to add a package and not run it? Is there a reason?

  2. Do packages have a variable that tells the package manager whether they have been ported/tested on a particular julia version? (This is not just a minimum Julia version.) I am asking because Glob and TimeSeries have a successful Pkg.add(), but both flunk on first-time compilation (and I have a fresh julia 1.0). So I am wondering whether these two packages [as examples] have made the jump from 0.6 to 1.0. if they have, then not very successfully so. if they have not, then the Pkg.add() should have told me this.


#2

In 99.5% of cases you can replace it with @__DIR__ usage. Otherwise there is Base.pathof.

If you plan to add an extra package after it might be that you need to recompile anyway, so you do double work.

No, and in theory/in the future the package manager should not install packages, unless the package declares that it works. For example, when Julia v2.0 is released, packages that don’t explicitly support this will not be installable. See https://docs.julialang.org/en/latest/stdlib/Pkg/#Compatibility-1


#3

@__DIR__ just gives the cwd for me. It does not tell me where the (local) packages for this version are installed for me. can you please give an example of Base.pathof() usage?


#4

You should use this in the file which need to reach into the package.

using Example
Base.pathof(Example)

but again, try to use @__DIR__.