Skip to content

find_cuda: revert breaking change#7282

Merged
waruqi merged 1 commit intoxmake-io:devfrom
charlesseizilles:patch-1
Jan 31, 2026
Merged

find_cuda: revert breaking change#7282
waruqi merged 1 commit intoxmake-io:devfrom
charlesseizilles:patch-1

Conversation

@charlesseizilles
Copy link
Contributor

A breaking change was introduced in #6964
This PR fixes it

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @charlesseizilles, 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 regression introduced in a prior change by restoring the correct field name for CUDA SDK versions. The change ensures that the system accurately identifies and utilizes the CUDA SDK version, preventing potential build or configuration issues that arose from the previous breaking change.

Highlights

  • Revert Breaking Change: This pull request reverts a breaking change introduced in a previous PR (support specify cuda sdk version via cuda_sdkver #6964) related to how CUDA SDK versions are handled and accessed.
  • CUDA SDK Version Field Renamed: The field name for the CUDA SDK version has been consistently changed back from sdkver to version within the find_cuda module.
  • Consistent Version Access: Updates were made in has_flags.lua and find_cuda.lua to ensure that the version field is correctly used when accessing CUDA SDK version information, resolving the previous inconsistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 effectively reverts a breaking change by consistently renaming the sdkver field to version within the CUDA detection logic and its usage. This change improves code clarity by distinguishing between the requested SDK version and the detected SDK version, and correctly restores the functionality that was previously broken.

local cuda = get_config("cuda")
local cuda_sdk = find_cuda(cuda)
local cuda_sdkver = cuda_sdk and cuda_sdk.sdkver or "7.0"
local cuda_sdkver = cuda_sdk and cuda_sdk.version or "7.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The change from cuda_sdk.sdkver to cuda_sdk.version correctly reflects the updated field name for the detected CUDA SDK version. This ensures consistency and fixes the previous breaking change.

local cuda_sdkver = cuda_sdk and cuda_sdk.version or "7.0"


-- get version
local sdkver = find_programver(path.join(bindir, "nvcc"), {parse = "release (%d+%.%d+),"})
local version = find_programver(path.join(bindir, "nvcc"), {parse = "release (%d+%.%d+),"})
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Renaming the local variable from sdkver to version enhances readability by clearly indicating that this variable holds the detected version of the CUDA SDK, differentiating it from the sdkver argument which represents the requested version.

local version = find_programver(path.join(bindir, "nvcc"), {parse = "release (%d+%.%d+),"})


-- get toolchains
return {sdkdir = sdkdir, bindir = bindir, sdkver = sdkver, linkdirs = linkdirs, includedirs = includedirs, msbuildextensionsdir = msbuildextensionsdir}
return {sdkdir = sdkdir, bindir = bindir, version = version, linkdirs = linkdirs, includedirs = includedirs, msbuildextensionsdir = msbuildextensionsdir}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Updating the returned table field from sdkver = sdkver to version = version provides better semantic clarity. It explicitly states that the returned value is the detected version, aligning with the local variable name and improving the API's expressiveness.

return {sdkdir = sdkdir, bindir = bindir, version = version, linkdirs = linkdirs, includedirs = includedirs, msbuildextensionsdir = msbuildextensionsdir}

-- save to config
config.set("cuda", cuda.sdkdir, {force = true, readonly = true})
config.set("cuda_sdkver", cuda.sdkver, {force = true, readonly = true})
config.set("cuda_sdkver", cuda.version, {force = true, readonly = true})
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The change from cuda.sdkver to cuda.version here correctly uses the updated field name from the find_cuda function's return value. This ensures that the detected CUDA version is saved to the configuration with the correct key, fixing the previous inconsistency.

config.set("cuda_sdkver", cuda.version, {force = true, readonly = true})

@waruqi waruqi added this to the v3.0.7 milestone Jan 31, 2026
@waruqi waruqi merged commit d658992 into xmake-io:dev Jan 31, 2026
34 of 35 checks passed
@charlesseizilles charlesseizilles deleted the patch-1 branch February 2, 2026 14:22
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