Conversation
Summary of ChangesHello @waruqi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances Xmake's dependency management by allowing more granular control over how configurations and build orders are inherited from dependencies. It specifically addresses an issue where build order was being enforced even when dependency linking was disabled, ensuring that the build system behaves as expected when users opt out of certain inheritance behaviors. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly implements the ability to disable build order dependencies when dependency linking is disabled, which resolves the linked issue. The changes in xmake/core/project/target.lua and xmake/modules/private/action/build/target.lua are logical and well-implemented. The accompanying refactoring in _add_targetjobs_deep_orders is also a good improvement, making the logic clearer and fixing a subtle bug. I have one minor suggestion to improve the code by removing a redundant function call. Overall, this is a solid contribution.
| local target_fence = opt.target_fence | ||
| if target_fence == nil and (job_kind == "prepare" or job_kind == "build") then | ||
| target_fence = dep:policy("build.fence") or dep:policy("build.across_targets_in_parallel") == false | ||
| end |
There was a problem hiding this comment.
The logic here is an improvement over the previous version. However, the expression dep:policy("build.across_targets_in_parallel") == false is evaluated on line 123, and it appears to be evaluated again on line 129 to display a deprecation warning. This is redundant.
To avoid this repeated call, you could store the result of the policy check in a variable and reuse it. This would make the code slightly more efficient and adhere to the DRY (Don't Repeat Yourself) principle.
For example, you could modify this block like so:
local target_fence = opt.target_fence
local across_targets_in_parallel_disabled
if target_fence == nil and (job_kind == "prepare" or job_kind == "build") then
across_targets_in_parallel_disabled = dep:policy("build.across_targets_in_parallel") == false
target_fence = dep:policy("build.fence") or across_targets_in_parallel_disabled
endYou could then reuse the across_targets_in_parallel_disabled variable on line 129. As that line is outside the current diff, I cannot provide a direct suggestion for it.
#6925
Disable the entire inheritance
It will disable to inherit dep links, public configuration in deps
Only disable link inheritance
It will disable to inherit links in deps.
Additionally, since it does not require inheritance of links, it does not restrict the build order between targets and dependencies.
Disable some dependency configurations
It disables public configurations from dependencies such as links/includedirs/defines.