Skip to content
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

Solve the package configs conflict #5923

Merged
merged 12 commits into from
Dec 4, 2024
Merged

Solve the package configs conflict #5923

merged 12 commits into from
Dec 4, 2024

Conversation

waruqi
Copy link
Member

@waruqi waruqi commented Dec 3, 2024

#5901
#5745

We can use set_policy("package.resolve_depconflict", false) to disable resolve deps conflict

and we can enable package.sync_requires_to_deps policy to sync requires to all deps configs. #5745 (comment)

Merge package configs without conflict automatically

package("foo")
    add_deps("zlib >=1.2.13")
    on_install(function () end)
package_end()

package("bar")
    add_deps("zlib 1.2.x")
    add_deps("boost", {system = false, configs = {lzma = true}})
    on_install(function () end)
package_end()

package("zoo")
    add_deps("boost", {system = false, configs = {zlib = true}})
    on_install(function () end)
package_end()

package("test")
    add_deps("foo", "bar", "zoo")
    on_install(function () end)
package_end()
note: install or modify (m) these packages (pass -y to skip confirm)?
  -> bar latest [from:test]
  -> zoo latest [from:test]
  -> test latest
in xmake-repo:
  -> zlib v1.2.13 [from:foo,bar, license:zlib] (conflict resolved)
  -> boost 1.86.0 [zlib:y, lzma:y, from:bar,zoo, license:BSL-1.0] (conflict resolved)
please input: y (y/n/m)

Unresolvable package configuration conflict

package("bar")
    add_deps("boost", {system = false, configs = {zlib = false}})
    on_install(function () end)
package_end()

package("zoo")
    add_deps("boost", {system = false, configs = {zlib = true}})
    on_install(function () end)
package_end()
package(test): add_deps(boost, ...)
  -> boost 1.86.0 [zlib:n, from:bar, license:BSL-1.0]
  -> boost#1 1.86.0 [zlib:y, from:zoo, license:BSL-1.0]
we can use add_requireconfs("**.boost", {override = true, configs = {}}) to override configs.
error: package(boost): conflict configs dependencies!

@waruqi waruqi added this to the v2.9.7 milestone Dec 3, 2024
@waruqi waruqi marked this pull request as ready for review December 3, 2024 08:48
@waruqi waruqi merged commit ded88ac into dev Dec 4, 2024
38 checks passed
@waruqi waruqi deleted the deps branch December 4, 2024 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant