Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Addbuild.link_target_with_fullpath policy to attempt to link target with full path#7011

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
waruqi wants to merge3 commits intodev
base:dev
Choose a base branch
Loading
fromlinks

Conversation

@waruqi
Copy link
Member

@waruqiwaruqi added this to thev3.0.5 milestoneNov 10, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello@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 linking capabilities by introducing a new policy,build.link_target_with_fullpath. This policy, enabled by default, allows the build system to use the full absolute path of target libraries when inheriting links. This change is designed to prevent linking conflicts that can arise when multiple libraries with the same name exist in different directories, ensuring a more reliable and explicit linking process.

Highlights

  • New Build Policy: Introducedbuild.link_target_with_fullpath to control linking behavior, allowing target libraries to be linked using their absolute paths.
  • Full Path Linking: When enabled, this policy ensures target libraries are linked with their full paths when inheriting dependencies, which helps resolve potential linking conflicts.
  • Toolchain Compatibility: A new utility functioncan_link_fullpath was added to check if the current toolchain supports linking with full paths before applying the policy.
  • Inherit Links Rule Update: Theinherit_links rule was modified to integrate the new policy and utility, conditionally using full paths for links and adjustinglinkdirs accordingly.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on ourdocumentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either/gemini <command> or@gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

FeatureCommandDescription
Code Review/gemini reviewPerforms a code review for the current pull request in its current state.
Pull Request Summary/gemini summaryProvides a summary of the current pull request in its current state.
Comment@gemini-code-assistResponds in comments when explicitly tagged, both in pull request comments and review comments.
Help/gemini helpDisplays a list of available commands.

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.gemini/ folder in the base of the repository. Detailed instructions can be foundhere.

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 uphere.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with theGemini Code Assist IDE Extension.

Footnotes

  1. Review thePrivacy Notices,Generative AI Prohibited Use Policy,Terms of Service, and learn how to configure Gemini Code Assist in GitHubhere. Gemini can make mistakes, so double check it anduse code with caution.

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Code Review

This pull request introduces a new policybuild.link_target_with_fullpath to control whether to use full paths when linking target dependencies, which is a useful feature for avoiding link conflicts. The implementation is generally good, but I have identified a minor bug in the linker detection logic and a couple of areas where the code could be simplified for better readability and maintainability. My review includes specific suggestions to address these points.

Comment on lines +173 to +176
iftarget:policy("build.link_target_with_fullpath")andtarget:has_tool("ld","gxx","clangxx","link")then
link_filepath=true
end
link_filepath=link_filepathorfalse
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

high

The logic here can be simplified for better readability. Also, the call totarget:has_tool is missing"ld" from the list of tools to check. This means if the linker isld,has_tool will returnfalse, which is likely not the intended behavior.

I suggest refactoring this block to fix the bug and make the logic clearer.

        if target:policy("build.link_target_with_fullpath") and target:has_tool("ld", "ld", "gxx", "clangxx", "link") then            link_filepath = true        else            link_filepath = false        end

Comment on lines 80 to 82
iftarget_utils.can_link_fullpath(target)then
link_filepath=true
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

medium

Thisif block can be simplified to a direct assignment, sincetarget_utils.can_link_fullpath(target) already returns a boolean value. This makes the code more concise.

            link_filepath = target_utils.can_link_fullpath(target)

@waruqiwaruqi removed this from thev3.0.5 milestoneNov 25, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@gemini-code-assistgemini-code-assist[bot]gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@waruqi

[8]ページ先頭

©2009-2025 Movatter.jp