From eabc8b83d51b9de9ca76667fc547a92b678fc1a5 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 18 Aug 2025 22:52:19 +0800 Subject: improve comax for config --- xmake/modules/core/project/depend.lua | 2 +- xmake/modules/private/action/build/target.lua | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/xmake/modules/core/project/depend.lua b/xmake/modules/core/project/depend.lua index ca05dc2f4..15b5d25c8 100644 --- a/xmake/modules/core/project/depend.lua +++ b/xmake/modules/core/project/depend.lua @@ -70,7 +70,7 @@ end -- show diagnosis info? function _is_show_diagnosis_info() - local show = _g.is_show_diagnosis_info + local show = true -- _g.is_show_diagnosis_info if show == nil then if project.policy("diagnosis.check_build_deps") then show = true diff --git a/xmake/modules/private/action/build/target.lua b/xmake/modules/private/action/build/target.lua index 0116dcd6f..8497baa43 100644 --- a/xmake/modules/private/action/build/target.lua +++ b/xmake/modules/private/action/build/target.lua @@ -778,6 +778,10 @@ end function run_targetjobs(targets_root, opt) opt = opt or {} local job_kind = opt.job_kind + local comax = option.get("jobs") or os.default_njob() + if job_kind == "config" then + --comax = option.get("jobs") or 1 + end local jobgraph = get_targetjobs(targets_root, opt) if jobgraph and not jobgraph:empty() then local curdir = os.curdir() @@ -786,7 +790,7 @@ function run_targetjobs(targets_root, opt) if errors and progress.showing_without_scroll() then print("") end - end, comax = option.get("jobs") or 1, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) + end, comax = comax, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) os.cd(curdir) return true end @@ -804,7 +808,7 @@ function run_filejobs(targets_root, opt) if errors and progress.showing_without_scroll() then print("") end - end, comax = option.get("jobs") or 1, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) + end, comax = option.get("jobs") or os.default_njob(), curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) os.cd(curdir) return true end -- cgit v1.3.1 From 6776bc187295330c3eb0337d065ddd64c5c9638c Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 18 Aug 2025 22:55:23 +0800 Subject: fix mode and module config order --- xmake/rules/c++/modules/xmake.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index ff4bcfc5a..c81e1500e 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -23,6 +23,11 @@ rule("c++.build.modules") -- @note support.contains_modules() need it set_extensions(".cppm", ".ccm", ".cxxm", ".c++m", ".mpp", ".mxx", ".ixx") + -- clang/support/config will be depend on target/symbols in release modules (hidden) + -- @see The default config parallel execution will cause incremental compilation problems + add_orders("mode.release", "c++.build.modules") + add_orders("mode.minsizerel", "c++.build.modules") + add_deps("c++.build.modules.scanner", "c++.build.modules.builder", "c++.build.modules.install") -- cgit v1.3.1 From f27c9d7af95365a0e06a318910db519069ef3c72 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 18 Aug 2025 23:35:23 +0800 Subject: enable build.fence for config --- xmake/modules/private/action/build/target.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/modules/private/action/build/target.lua b/xmake/modules/private/action/build/target.lua index 8497baa43..fa2a85b3e 100644 --- a/xmake/modules/private/action/build/target.lua +++ b/xmake/modules/private/action/build/target.lua @@ -115,7 +115,7 @@ end function _add_targetjobs_deep_orders(jobgraph, target, dep, opt) local jobname, jobname_dep local job_kind = opt.job_kind - if dep:policy("build.fence") or dep:policy("build.across_targets_in_parallel") == false then + if job_kind == "config" or dep:policy("build.fence") or dep:policy("build.across_targets_in_parallel") == false then jobname = string.format("%s/begin_%s", target:fullname(), job_kind) jobname_dep = string.format("%s/end_%s", dep:fullname(), job_kind) -- build.across_targets_in_parallel is deprecated -- cgit v1.3.1 From 8a7b5215e90e944246366197e4fa01bc927dd57a Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 18 Aug 2025 23:44:10 +0800 Subject: remove debug code --- xmake/modules/core/project/depend.lua | 2 +- xmake/modules/private/action/build/target.lua | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/xmake/modules/core/project/depend.lua b/xmake/modules/core/project/depend.lua index 15b5d25c8..ca05dc2f4 100644 --- a/xmake/modules/core/project/depend.lua +++ b/xmake/modules/core/project/depend.lua @@ -70,7 +70,7 @@ end -- show diagnosis info? function _is_show_diagnosis_info() - local show = true -- _g.is_show_diagnosis_info + local show = _g.is_show_diagnosis_info if show == nil then if project.policy("diagnosis.check_build_deps") then show = true diff --git a/xmake/modules/private/action/build/target.lua b/xmake/modules/private/action/build/target.lua index fa2a85b3e..e3c4febb1 100644 --- a/xmake/modules/private/action/build/target.lua +++ b/xmake/modules/private/action/build/target.lua @@ -778,10 +778,6 @@ end function run_targetjobs(targets_root, opt) opt = opt or {} local job_kind = opt.job_kind - local comax = option.get("jobs") or os.default_njob() - if job_kind == "config" then - --comax = option.get("jobs") or 1 - end local jobgraph = get_targetjobs(targets_root, opt) if jobgraph and not jobgraph:empty() then local curdir = os.curdir() @@ -790,7 +786,7 @@ function run_targetjobs(targets_root, opt) if errors and progress.showing_without_scroll() then print("") end - end, comax = comax, curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) + end, comax = option.get("jobs") or os.default_njob(), curdir = curdir, distcc = opt.distcc, progress_factor = opt.progress_factor}) os.cd(curdir) return true end -- cgit v1.3.1 From a115f760c346a010a6633e230dcb57b4ce0f2df0 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 19 Aug 2025 22:51:43 +0800 Subject: add dep_fence --- xmake/core/sandbox/modules/import/core/project/project.lua | 2 +- xmake/modules/private/action/build/target.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua index 2fdce5948..af1ae11bd 100644 --- a/xmake/core/sandbox/modules/import/core/project/project.lua +++ b/xmake/core/sandbox/modules/import/core/project/project.lua @@ -142,7 +142,7 @@ function sandbox_core_project._config_targets(opt) -- we need to config all targets (contains non-default targets) local targets_root = target_buildutils.get_root_targets(nil, {all = true}) - target_buildutils.run_targetjobs(targets_root, {job_kind = "config", job_opt = opt}) + target_buildutils.run_targetjobs(targets_root, {job_kind = "config", dep_fence = true, job_opt = opt}) end -- load rules in the required packages for target diff --git a/xmake/modules/private/action/build/target.lua b/xmake/modules/private/action/build/target.lua index e3c4febb1..444dfc18e 100644 --- a/xmake/modules/private/action/build/target.lua +++ b/xmake/modules/private/action/build/target.lua @@ -115,7 +115,8 @@ end function _add_targetjobs_deep_orders(jobgraph, target, dep, opt) local jobname, jobname_dep local job_kind = opt.job_kind - if job_kind == "config" or dep:policy("build.fence") or dep:policy("build.across_targets_in_parallel") == false then + local dep_fence = opt.dep_fence or dep:policy("build.fence") or dep:policy("build.across_targets_in_parallel") == false + if dep_fence then jobname = string.format("%s/begin_%s", target:fullname(), job_kind) jobname_dep = string.format("%s/end_%s", dep:fullname(), job_kind) -- build.across_targets_in_parallel is deprecated -- cgit v1.3.1