If I clone a Julia package from git, should the local folder have the ending .jl?

I am a bit confused:
If I clone a package using the URL provided by GitHub (see picture)

using

git clone https://github.com/OpenSourceAWE/KiteUtils.jl.git

I get a local folder named KiteUtils.jl.

If I do ]dev KiteUtils I get a local folder with the name KiteUtils.

Should the source code of a package in a local git clone have the ending .jl or not?

The behavior you see is how it works. Does it matter whether the directory has the .jl on it or not? Not really. I generally put make my packages with the .jl but when you ]dev them they end up in .julia/dev/Package without the extension.

:person_shrugging:

Yes, it does matter. I want to dev a package into the folder ~/repos (where the packages I work with live), and I want that dev does not do a fresh clone if an up-to-date clone already exists at that location. Could that work?

It cannot work if the folder names are different.

If you clone the repo yourself, you can use ]dev <path to repo> and it will reference it there instead of the default ~/.julia/dev directory.

It doesn’t matter to Julia. It’s only a question of what works best for your workflows.

It matters. I now do the following:

  • checked out all my dependencies into the folder ~/repos
  • renamed them to the package name without .jl ending
  • added the line export JULIA_PKG_DEVDIR=/home/ufechner/repos to my .bashrc file

Now I can do:

pkg> dev KiteUtils

and it uses the code that is already checked out in the folder ~/repos/KiteUtils.

It seems to work, but only if the package folders do not have the .jl suffix.

I’d consider this at least a “friction point” that should be reported at Issues · JuliaLang/Pkg.jl · GitHub

Maybe not a “bug” per se, but I find it surprising and potentially inconvenient that when ]dev KiteUtils creates a checkout, the resulting folder is different from when I clone the repo first and then ]dev the checkout.

That’s exactly what I mean with what works best for your workflow. Personally I always develop packages by path.

I agree with @ufechner7 and @goerz that this is an annoying friction point. I also always delete the .jl after cloning a repo to my JULIA_PKG_DEVDIR.

The issue is that the preferred workflow by @ufechner7 (and also me) is currently not possible. Our preferred workflow would be to clone a repo to JULIA_PKG_DEVDIR and after that directly do ]dev PackageName, which should then pick up the correct package.

For what it’s worth you can clone to whatever name you prefer.

git clone https://github.com/OpenSourceAWE/KiteUtils.jl.git KiteUtils

But if you have already set JULIA_PKG_DEVDIR it seems easier to just do ]dev URL in the first place instead of an doing an external git clone?