Recompilation of test project

In the past, I put my test dependencies in the main Project.toml file in the [extras] section.

Recently, I started to use sub-projects and a separate Project.toml file in the test folder.

But now the packages are pre-compiled much more often:

  • once when running ]test
  • and again when running Pkg.activate("test")

I use the second command when I want to execute only one of the files in the test folder.

Questions:

  • Is this a bug?
  • If not, is there a way to avoid the double precompilation without reverting to the old way of defining the test dependencies?

Do you mean they’re precompiled every time or just the first time activation or test? Are you using a workspace to merge the subprojects’ manifests into the parent project’s?

The first time, and every time after updating or adding or removing any package.

And yes, I use a workspace. In the main Project.toml I have:

[workspace]
projects = ["examples", "test"]

And in the Project.toml of the test folder I have:

[deps]
RamAirKite = "7ebed07a-3d9a-4117-97d2-0a397f5b89df"

[sources]
RamAirKite = {path = ".."}

where RamAirKite is the name of the main Package/ Project.

Then I’m more confident that something has gone wrong. It’s not unusual to precompile a first time, which could be running a test after updating dependencies or source, but a manifest and the cached package images should have prevented further recompilation, including a mere activate. Caching does have a limit (default to 10 unique instances per package), but I have no way of knowing if you’re hitting that somewhere. The workspace actually reduces that risk within a main project by resolving 10+ subprojects together with it; activate would only change the using/import-able names while referencing the same manifest of exact versions. When you recompile, is there a consistent set of recompiled packages and versions?

Try with JULIA_DEBUG=loading and try to figure out why no caches are usable.