Skip to content

package download: don't get submodules if disabled#6901

Merged
waruqi merged 1 commit intoxmake-io:devfrom
SirLynix:patch-21
Oct 8, 2025
Merged

package download: don't get submodules if disabled#6901
waruqi merged 1 commit intoxmake-io:devfrom
SirLynix:patch-21

Conversation

@SirLynix
Copy link
Member

@SirLynix SirLynix commented Oct 7, 2025

should fix https://github.com/xmake-io/xmake-repo/actions/runs/18327237141/job/52194556351?pr=8344 where submodules were disabled

    add_urls("https://github.com/libsdl-org/SDL_ttf.git", {alias = "github", submodules = false})

but were still cloned

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @SirLynix, 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 addresses a bug in the package download process where Git submodules were being cloned despite being explicitly disabled by the user. The change introduces conditional logic to the git.clone operation, ensuring that submodule fetching is skipped when the url_submodules option is set to false. This resolves an unexpected behavior, preventing unnecessary network requests and disk usage for packages that do not require submodules.

Highlights

  • Submodule Handling: This pull request fixes an issue where Git submodules were still being cloned even when explicitly disabled using the submodules = false option in add_urls.
  • Conditional Cloning Logic: The git.clone command has been updated to correctly respect the url_submodules option, ensuring that recursive and shallow_submodules parameters are only enabled when submodules are not explicitly disabled.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays 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 found here.

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

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

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot 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 correctly implements the logic to avoid cloning submodules when submodules = false is specified for a package dependency defined by a git tag. However, this fix appears to be incomplete as it doesn't cover the case where a package dependency is defined by a branch. The same logic should be applied to the git.clone call for branches on line 112 to fully resolve the issue.

Comment on lines +133 to +134
local clone_submodules = opt.url_submodules ~= false
git.clone(url, {depth = 1, recursive = clone_submodules, shallow_submodules = clone_submodules, longpaths = longpaths, branch = tag, outputdir = packagedir})
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This change correctly handles the submodules = false option for git tags. However, the same logic is missing for git branches. To fully fix the issue, a similar change should be applied to the git.clone call on line 112 for cloning branches.

@waruqi waruqi merged commit fb0574d into xmake-io:dev Oct 8, 2025
17 of 22 checks passed
@waruqi waruqi added this to the v3.0.4 milestone Oct 8, 2025
@SirLynix SirLynix deleted the patch-21 branch October 8, 2025 11:49
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.

2 participants