`ERROR: can not merge projects` when sub-project.toml references parent project
I just came across this error for the first time:
julia> TestEnv.activate()
ERROR: can not merge projects
Stacktrace:
[1] pkgerror(msg::String)
@ Pkg.Types ~/.julia/juliaup/julia-1.11.6+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Pkg/src/Types.jl:68
[2] activate(pkg::String; allow_reresolve::Bool)
@ TestEnv ~/.julia/packages/TestEnv/nGMfF/src/julia-1.11/activate_set.jl:44
[3] activate
@ ~/.julia/packages/TestEnv/nGMfF/src/julia-1.11/activate_set.jl:9 [inlined]
[4] activate()
@ TestEnv ~/.julia/packages/TestEnv/nGMfF/src/julia-1.11/activate_set.jl:9
[5] top-level scope
@ REPL[3]:1
[6] top-level scope
@ none:1
I don't find it particularly helpful to understand what's going on. Any advice for how to go about debugging this? Is there a way to get a verbose version of this error?
This definitely is not a helpful error message.
What happens when you run
] test normally?
With ] test, all the tests run to completion.
I do realize however, that this may be, in part, user error. I don't think our test environment is set up completely correctly. For example, it contains the package itself as a dependency.
This is our main Project.toml file, and this is our test/ Project.toml file.
Even when removing the package itself from test/Project.toml locally, I still seem to get the aforementioned error, so I am a bit confused.
With
] test, all the tests run to completion.
In theory we are supposed to be hitting the exact same code paths that Pkg uses internally for doing this when you run ] test.
However, their is no public API for them (https://github.com/JuliaLang/Pkg.jl/issues/3460).
So often they change (and are improved) in ways that we do not have copied over here yet.
So I suspect we are missing some feature/fix that makes your file work
In particular one of these: https://github.com/search?q=repo%3AJuliaLang%2FPkg.jl+%22can+not+merge+projects%22&type=issues
With that said, there doesn't look like ovbious reasons not to be able to merge there is no clashing compat or UUIDs.
Can you delete your Manifest.toml and try again? (or rename if to _Backup_Manifest.toml etc)
This will clear anything you have dev'd or pinned.
We might have failures to support some part of that.
I am running into the same error. It happens when test/Project.toml has a reference back to the top-level project.
While previously this was not well defined, now using workspaces, this looks safe to me and it would be nice if TestEnv can support this special case
It happens when test/Project.toml has a reference back to the top-level project.
Oh you are right and that was the cause of the other one too.
I think yes we should support this