Conversation
Compilation of mirb with Cosmopolitan fails because of missing include (Cosmopolitan seems to be more strict than "traditional" compilers.
Summary of ChangesHello @katafrakt, 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 critical build failure that occurred when compiling the 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. 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
|
d354e68 to
142ae5b
Compare
There was a problem hiding this comment.
Code Review
This pull request correctly identifies and fixes a build issue on the Cosmopolitan toolchain by explicitly including <sys/select.h>. This is a good practice for portability, as it avoids relying on transitive includes. The change is correct and directly addresses the compilation errors. I've added one minor suggestion to improve code style by sorting the include directives.
| #include <unistd.h> | ||
| #include <termios.h> | ||
| #include <sys/ioctl.h> | ||
| #include <sys/select.h> | ||
| #include <errno.h> |
There was a problem hiding this comment.
While the added include is correct, for better long-term maintainability it's a good practice to keep header includes sorted alphabetically. This makes it easier to locate headers and helps prevent accidental duplicates. I'd suggest reordering this block of includes.
| #include <unistd.h> | |
| #include <termios.h> | |
| #include <sys/ioctl.h> | |
| #include <sys/select.h> | |
| #include <errno.h> | |
| #include <errno.h> | |
| #include <sys/ioctl.h> | |
| #include <sys/select.h> | |
| #include <termios.h> | |
| #include <unistd.h> |
142ae5b to
1881a90
Compare
When I try to build
mrubyusing Cosmopolitan (COSMO_ROOT=/path/to/cosmo ruby ./minirake MRUBY_CONFIG=cosmopolitan), I'm getting the following error:This seems to be related to the fact that Cosmopolitan is much mor strict when it comes to adding includes and you need to specifically include
sys/select.hto access its functions.I also added a Cosmopolitan build to the CI to avoid regressions in the future.