Fix build zig hello world project without specifying zig toolchain#7373
Fix build zig hello world project without specifying zig toolchain#7373luadebug wants to merge 2 commits intoxmake-io:devfrom
Conversation
Summary of ChangesHello, 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 resolves a reported issue (#7372) that was preventing the Zig toolchain from working as intended within Xmake. The fix involves a precise modification to the Zig toolchain's configuration file, specifically by removing a Highlights
🧠 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. Changelog
Activity
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 addresses a critical issue where the Zig toolchain was not functioning as expected, particularly in cross-compilation environments. By removing the explicit set_kind("standalone") declaration, the system can now correctly infer the toolchain's nature, resolving the reported problem and enabling proper functionality for Zig projects.
|
|
||
| -- define toolchain | ||
| toolchain("zig") | ||
| set_kind("standalone") |
There was a problem hiding this comment.
Removing set_kind("standalone") is a crucial fix. The previous explicit setting was causing the Zig toolchain to be incorrectly classified, which prevented it from working correctly in cross-compilation scenarios as reported in issue #7372. This change allows the system to dynamically determine the toolchain's capabilities based on the environment, leading to correct behavior.
There was a problem hiding this comment.
We can't simply remove it, as that would break support for zigcc. I haven't thought of a better solution yet. This is an old issue: #6628 (comment)
|
Or we can split it into two toolchains: zig and zigcc. |
Are current changes good enough? |
|
Sorry, I've been quite busy lately. This seems a bit hacky; I still think splitting it into two toolchains, zig and zigcc, might be better. |
It's ok. I am having hard time and being really busy recently so. That's indeed a good idea to split in a two but it looks like a big room of work to support that |
|
we also need to update tests. #7383 |
|
done |
Resolves: #7372
Seems this prevent zig to work ;(
Code example https://ziglang.org/documentation/0.15.2/
--toolchain=zigccwhen need C/C++ wrapper. (set_toolchains("zigcc")orxmake f --toolchain=zigcc)--toolchain=zigwhen need.ziglanguage support. (set_toolchains("zig")orxmake f --toolchain=zig)