diff options
| author | ruki <[email protected]> | 2024-12-03 23:41:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-12-03 23:41:57 +0800 |
| commit | 50b8022ef3a6a25a0ef53775b6cf8dc17503f04a (patch) | |
| tree | 0a3ec77be4d730eaf19bb9a62faee57dc09461e2 | |
| parent | d36ccc63a37662aa47359be90dc19cd6f09c32a5 (diff) | |
improve package install tips
| -rw-r--r-- | tests/projects/package/compatibility/deps_with_version/xmake.lua | 5 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/tests/projects/package/compatibility/deps_with_version/xmake.lua b/tests/projects/package/compatibility/deps_with_version/xmake.lua index 89a388cb1..f82007af9 100644 --- a/tests/projects/package/compatibility/deps_with_version/xmake.lua +++ b/tests/projects/package/compatibility/deps_with_version/xmake.lua @@ -7,14 +7,14 @@ package_end() package("bar") add_deps("zlib 1.2.x") -- add_deps("libpng dev") - add_deps("libpng", {configs = {shared = false}}) +-- add_deps("boost", {system = false, configs = {}}) set_policy("package.install_locally", true) on_install(function () end) package_end() package("zoo") -- add_deps("libpng master") - add_deps("libpng", {configs = {shared = true}}) +-- add_deps("boost", {system = false, configs = {zlib = true}}) set_policy("package.install_locally", true) on_install(function () end) package_end() @@ -26,6 +26,7 @@ package("test") package_end() add_requires("test") +--add_requireconfs("**.boost", {override = true, configs = {zlib = false}}) target("test") set_kind("binary") diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 178fd4542..9a79475e3 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -261,7 +261,8 @@ function _load_require(require_str, requires_extra, opt) verify = require_extra.verify, -- default: true, we can set false to ignore sha256sum and select any version external = require_extra.external, -- default: true, we use sysincludedirs/-isystem instead of -I/xxx private = require_extra.private, -- default: false, private package, only for installation, do not export any links/includes and environments - build = require_extra.build -- default: false, always build packages, we do not use the precompiled artifacts + build = require_extra.build, -- default: false, always build packages, we do not use the precompiled artifacts + resolvedinfo = resolvedinfo -- the resolved info for the conflict version/configs } return required.packagename, required.requireinfo end @@ -1601,11 +1602,19 @@ function get_configs_str(package) if parents_str then table.insert(configs, "from:" .. parents_str) end + local license = package:get("license") + if license then + table.insert(configs, "license:" .. license) + end local configs_str = #configs > 0 and "[" .. table.concat(configs, ", ") .. "]" or "" local limitwidth = math.floor(os.getwinsize().width * 2 / 3) if #configs_str > limitwidth then configs_str = configs_str:sub(1, limitwidth) .. " ..)" end + local resolvedinfo = requireinfo.resolvedinfo + if resolvedinfo then + configs_str = configs_str .. " " .. "${color.warning}(conflict resolved)${clear}" + end return configs_str end |
