"Double" build when adding unregistered dependency

Happy new year,

which I so far have spent with moving my tests from Travis to GitHub Actions. After finally getting it somewhere, I ran into a problem which I already had on Travis.

When using a unregistered package, in my case MKL.jl, the documentation suggest running

 - julia --project --color=yes --check-bounds=yes -e 'using Pkg; Pkg.develop(PackageSpec(path="/home/travis/build/path_to_private_Dependency")); Pkg.instantiate()'

where I run

- julia --project --color=yes --check-bounds=yes -e 'using Pkg;  Pkg.add(PackageSpec(url="https://github.com/JuliaComputing/MKL.jl"));'

which takes >10 min usually, which by itself is fine.

However, the problem is that the default build command for the tested package itself builds MKL.jl once more, again taking 10 min.
I tried to address this by only prompting for the package itself

  - julia --color=yes -e "if VERSION < v\"0.7.0-DEV.5183\"; Pkg.clone(pwd()); Pkg.build(\"IntelVectorMath\"); else using Pkg; if VERSION >= v\"1.1.0-rc1\"; Pkg.build(\"IntelVectorMath\"; verbose=true); else Pkg.build(\"IntelVectorMath\"); end; end"

but MKL still gets rebuild.

This means that my testing takes >20 minutes before running the actual tests which take less than a minute.
For some examples see
WIP GitHub Action
Old Travis

I expect that this specific problem will soon be solved as MKL.jl nears proper registration. But in principle I think there should be a way to avoid something like this.
Maybe a Pkg.add(..., build=false) or so? Or maybe there is a trick that I haven’t found yet that would help here.
Any input would be appreciated.

I don’t see a spurious build happening in the GitHub Actions log. MKL gets automatically built when you call develop then it gets built the second time when you explicitly call build. Why are you calling build a second time?

My goal is to test the package IntelVectorMath (formerly VML), for which the normal workflow would be

  1. setup julia
  2. build package (the “second” build)
  3. run tests

However, VML depends optionally on MKL, which is unregistered and not part of the dependencies. Even worse, even if it was part of the dependencies, unregistered packages are currently not properly resolved (I can’t find the issue that explained this best, here is one that comes close).
Another example is this CI run , where I messed up properly adding MKL to the project. When running the tests, despite MKL being part of a Manifest.toml in the test/ directory, MKL is not being found or automatically added.

This forces me to add MKL manually before the three steps mentioned above, causing the “first” build.

Now the issue is that whether I use a name-specific build instruction as on Travis, or the generic build action on GitHub actions, the “second” build action rebuilds everything, including MKL.

I feel this should not be the case. Calling name-specific build for a package should not rebuild anything else that it does not explicitly depend on, and it doesn’t when I try to reproduce in my own REPL, where I get this: (The name change of to IntelVectorMath is very new)

(v1.1) pkg> build VML
  Building SpecialFunctions → `~/.julia/packages/SpecialFunctions/ne2iw/deps/build.log`
  Building VML ─────────────→ `~/.julia/dev/VML/deps/build.log`
 Resolving package versions...

There is nothing with MKL.jl, it only gets rebuild in CI, which just increases my puzzlement.