Conversation
waruqi
commented
Nov 22, 2025
- Before adding new features and new modules, please go to issues to submit the relevant feature description first.
- Write good commit messages and use the same coding conventions as the rest of the project.
- Please commit code to dev branch and we will merge into master branch in feature
- Ensure your edited codes with four spaces instead of TAB.
- 增加新特性和新模块之前,请先到issues提交相关特性说明,经过讨论评估确认后,再进行相应的代码提交,避免做无用工作。
- 编写友好可读的提交信息,并使用与工程代码相同的代码规范,代码请用4个空格字符代替tab缩进。
- 请提交代码到dev分支,如果通过,我们会在特定时间合并到master分支上。
- 为了规范化提交日志的格式,commit消息,不要用中文,请用英文描述。
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 introduces comprehensive support for the Solaris operating system within the project. It ensures that Solaris is recognized and properly configured across documentation, core engine logic, and build system definitions, allowing for seamless development and compilation on Solaris platforms. Highlights
Ignored Files
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 adds initial support for the Solaris platform. The changes include updates to README files, a new platform configuration for Solaris in xmake.lua, and necessary adjustments in the C source code to accommodate the new platform. The implementation is a good starting point. I've identified a few potential issues in the tbox configuration for Solaris regarding the availability of certain functions like flock and backtrace. I've also suggested some improvements for the platform definition file to make Solaris support more complete in the future, such as adding SPARC architecture and support for the native Oracle Developer Studio compiler. Additionally, there's a small redundancy in header includes that could be cleaned up.
| #define TB_CONFIG_LIBC_HAVE_SETJMP 1 | ||
| #define TB_CONFIG_LIBC_HAVE_SIGSETJMP 1 | ||
| #define TB_CONFIG_LIBC_HAVE_KILL 1 | ||
| #define TB_CONFIG_LIBC_HAVE_BACKTRACE 1 |
There was a problem hiding this comment.
The backtrace() function and <execinfo.h> are glibc extensions and are not standard on Solaris. Solaris provides printstack() in <ucontext.h> for a similar purpose. Enabling this macro will likely cause compilation errors. This should be undefined unless a compatibility library providing backtrace() is being used.
| #define TB_CONFIG_LIBC_HAVE_BACKTRACE 1 | |
| /* #undef TB_CONFIG_LIBC_HAVE_BACKTRACE */ |
| /* #undef TB_CONFIG_WINDOWS_HAVE__INTERLOCKEDCOMPAREEXCHANGE64_REL */ | ||
|
|
||
| // bsd functions | ||
| #define TB_CONFIG_BSD_HAVE_FLOCK 1 |
There was a problem hiding this comment.
flock() is a BSD-specific function and is not typically available on Solaris. Solaris uses fcntl() for file locking. Enabling this macro might lead to compilation or runtime errors if the code relies on flock(). Please verify if flock() is available in your target Solaris environment or if there's a compatibility layer. If not, this should be undefined.
| #define TB_CONFIG_BSD_HAVE_FLOCK 1 | |
| /* #undef TB_CONFIG_BSD_HAVE_FLOCK */ |
| #ifdef TB_CONFIG_OS_SOLARIS | ||
| #include <sys/types.h> | ||
| #include <signal.h> | ||
| #endif |
There was a problem hiding this comment.
This block is redundant. <signal.h> is already included for Solaris in the preprocessor block at lines 41-44. <sys/types.h> is a very basic header and is likely included by other headers already. If it is strictly necessary, it should be added to the block at lines 41-44 to keep the includes for Solaris grouped together and avoid redundancy. It's best to remove this block.
| platform("solaris") | ||
| set_os("solaris") | ||
| set_hosts("solaris") | ||
| set_archs("i386", "x86_64") | ||
|
|
||
| set_formats("static", "lib$(name).a") | ||
| set_formats("object", "$(name).o") | ||
| set_formats("shared", "lib$(name).so") | ||
| set_formats("symbol", "$(name).sym") | ||
|
|
||
| set_installdir("/usr/local") | ||
|
|
||
| set_toolchains("envs", "gcc", "clang", "yasm", "nasm", "fasm", "cuda", "go", "rust", "gfortran", "zig") |
There was a problem hiding this comment.
This is a good start for Solaris platform support. For future improvements, you could consider the following:
- Architectures: Currently, only
i386andx86_64are listed. Solaris also has significant usage on the SPARC architecture (sparc,sparcv9). Adding these would make the support more complete. - Toolchains: The list of toolchains is missing the native Solaris compiler, Oracle Developer Studio (formerly Sun Studio), which uses
ccfor C andCCfor C++. Adding support for it would provide better integration with the native development environment on Solaris.