-
-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"cannot merge projects" error #1585
Comments
Yeah that is a pretty bad error message. It happens when the active manifest and the test manifest both have fixed nodes that disagree (for example the active manifest and the test manifest both are tracking the same UUID by path but are tracking it a different paths). Pkg has to preserve fixed nodes but it doesn't know which one to keep. |
Most of my projects check-in It would be great if I can keep using this workflow. Can Pkg just use |
IMO |
Yeah, that would make sense. Probably better than erroring out |
Why not the other way around? Shouldn't project |
I mean, what we really want is #1233. |
I'm not so sure. I commented my concern in #1233 (comment) |
FYI, I moved |
Is there a workaround for this? I'm getting the error in test, where the test project and the project under test depend on a local package that is tracked with the same UUID and an absolute path.
|
Don't use thefunctionality of |
Could this be made more clear? There's nothing I can find that says this is beta, only that functionality may change in the future. This seems to advocate this approach as the "modern" way of doing things, without any hint that it might be buggy: |
Looking forward to a solution 😀 Using Test-specific dependencies in Julia 1.0 and 1.1 in the mean time. |
To me this happens even when I have completely identical |
I had to include them in the global Project.toml as extras, because I ran into JuliaLang/Pkg.jl#1585. This also deletes the test/Project.toml.
Yes, this happens also when both the package and the test code tries to use the exact same dependency from a URL (i.e., not from a registry). This used to work well with Julia 1.3, but it broke in 1.4, and has not been fixed since then. Pretty annoying. |
Yup, I just ran into this again. My |
I solved the issue removing the tested package from [deps] at my test/Project.toml |
QuantumControlBase extends QuantumPropagators, but QuantumPropagators does not depend on QuantumControlBase except for testing... Thus the dependency should be only in test/Project.toml and docs/Project.toml, but not in the main Project.toml. This also makes it necessary to not use Pkg.test() for local development: There's just no way to dev-install a local test-dependency without that dependency being in the main Project.toml. So anything that's only a test-dependency, but not a dependency of the package itself, will break. That's actually how the circular dependency got into Project.toml in the first place. On CI, we don't have to worry about this as much: the testing will modify the main Project.toml, but we throw away the checkout after the CI run finishes, so it works. All of these problems are because Pkg.test() is has some buggy behavior if there is a test/Manifest.toml (which would be the appropriate place to record the local dev-installation of test dependencies): JuliaLang/Pkg.jl#1585 JuliaLang/Pkg.jl#1233
The "ERROR: can not merge projects" seems impossible to fix when using Packages from custom repos (my patched Gnuplot.jl). See JuliaLang/Pkg.jl#1585. Therefore, we remove the test project and have all dependencies for tests added into the top-level project.
The "ERROR: can not merge projects" seems impossible to fix when using Packages from custom repos (my patched Gnuplot.jl). See JuliaLang/Pkg.jl#1585. Therefore, we remove the test project and have all dependencies for tests added into the top-level project.
The "ERROR: can not merge projects" seems impossible to fix when using Packages from custom repos (my patched Gnuplot.jl). See JuliaLang/Pkg.jl#1585. Therefore, we remove the test project and have all dependencies for tests added into the top-level project.
The "ERROR: can not merge projects" seems impossible to fix when using Packages from custom repos (my patched Gnuplot.jl). See JuliaLang/Pkg.jl#1585. Therefore, we remove the test project and have all dependencies for tests added into the top-level project.
The "ERROR: can not merge projects" seems impossible to fix when using Packages from custom repos (my patched Gnuplot.jl). See JuliaLang/Pkg.jl#1585. Therefore, we remove the test project and have all dependencies for tests added into the top-level project.
We don't use a separate test project, because with it, we get the error "ERROR: can not merge projects", which seems impossible to fix when using packages from custom repos (my patched Gnuplot.jl). See JuliaLang/Pkg.jl#1585.
We don't use a separate test project, because with it, we get the error "ERROR: can not merge projects", which seems impossible to fix when using packages from custom repos (my patched Gnuplot.jl). See JuliaLang/Pkg.jl#1585.
We don't use a separate test project, because with it, we get the error "ERROR: can not merge projects", which seems impossible to fix when using packages from custom repos (my patched Gnuplot.jl). See JuliaLang/Pkg.jl#1585.
864: Move test env to integration_tests, add test/Project.toml r=charleskawczynski a=charleskawczynski I think that this should (hopefully) fix our environment issues. This PR moves our `test/` env to `integration_tests/`, which means that users will need to use `julia --project=integration_tests`. We can change `integration_tests` to a shorter name if people prefer, or just move everything from there into `driver/`-- I have no strong opinions about where these things should live. Right now, if users try to `julia --project; ] test`, they'll see the error: ``` (TurbulenceConvection) pkg> test Testing TurbulenceConvection ERROR: can not merge projects ``` This [is](JuliaLang/Pkg.jl#1714) [not](https://discourse.julialang.org/t/testing-package-where-the-test-depends-on-local-deved-package-fails-in-julia-1-4-2-with-error-can-not-merge-projects/41611) [an](JuliaLang/julia#41819) [uncommon](JuliaLang/Pkg.jl#1788) [issue](JuliaLang/Pkg.jl#1585). This PR has the implications that our unit/package tests, or rather tests that are run with `Pkg.test()`, will not be quite as reproducible as those in our integration tests with `julia --project=integration_tests test/runtests.jl`. But I think that this is okay since the only places it seems we rely on running tests this way is - in GHA CI, which we could customize to run via `julia --project=integration_tests test/runtests.jl` anyway, and - codecov, which I'm not sure how else to correctly pass the `coverage` argument And bors doesn't depend on either of these, so they'll just be a soft test. ```julia help?> Pkg.test Pkg.test(; kwargs...) ... • coverage::Bool=false: enable or disable generation of coverage statistics. ``` Co-authored-by: Charles Kawczynski <[email protected]>
I just ran into this problem with Julia 1.6 on Windows. The suggestion of not using the project/manifest in the test folder was not satisfactory to me, simply because all my other projects are tested this way. I found an easy workaround though. It is somewhat similar to dpinol's suggestion, which did not work for me. The problem is well described so I will not repeat all of it. To explain the workaround, I will refer to two packages,
but this gives an error because
Now everything works without any complaints from Julia (at least for me) |
I also stumbled into this because I wanted to have a nice VSCode support for working interactively within my test environment. Hence I added the parent repo via It would be really nice if it possible to have both
it seems like the only thing needed is that some logic is added which checks for same path names (after making them absolute) so that the error "cannot merge projects" can be circumvented. |
Until #3276 is merged and released, and if you removed your package from |
ERROR: can not merge projects see JuliaLang/Pkg.jl#1585
Testing the package "DisplayAs" gives the error
This type of error message seems similar to an assertion error so is it a bug in Pkg? If not, the error message should probably be expanded to say what is actually wrong and how to fix it. And this package passes on 1.3 so what's up with that?
The text was updated successfully, but these errors were encountered: