fix: Default "platform" field in zip files should be set to the local platform, rather than always "Unix" (#470)#471
Conversation
Summary of ChangesHello @roynor, 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 bug where the platform field in generated zip files was incorrectly set to "Unix" even when created on a Windows operating system. The change introduces automatic detection of the operating system during zip file creation, ensuring that the Highlights
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 correctly addresses the issue of the zip platform being hardcoded to Unix by introducing OS detection. The platform is now correctly set to DOS on Windows. However, the check for Unix-like systems is too specific, using cfg!(linux), which will incorrectly classify other common platforms like macOS as System::Unknown. I've provided a suggestion to use the more general cfg!(unix) to properly support all Unix-like systems.
Well, I have no idea why all test suites in the "tests" directory was not be counted without specifying In Because of the incorrect
The 2nd point is the reason why the "end_to_end" suite failed. Footnotes |
Head branch was pushed to by a user without write access
|
Sorry,I have limited knowledge of the zip format, so fixing these issues is a bit challenging for me.
|
Don't worry. We need to change internal things. For now, I think adding a field which could be called as Lines 269 to 282 in a157695 Speaking of other errors. The test data was made on platforms other than Windows, so it should fail. We need to add new ones and surround related statements in unit tests by |
ZIP files are supposed to transfer between platforms, so instead of restricting tests to only Windows, we should adapt them to whichever platform they're running on. |
Windows; need auto-detection or manual configuration
refactor: simplify setup system of platform Co-authored-by: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Signed-off-by: ztzuo <zztwangyi@163.com>
8f86545 to
5290fbe
Compare
|
Thanks for your work! I'll test v7.2.0 soon.
I thought that we need cross-testing. For example, on Windows, read ZIP files made on Linux. |
We have that; the tests that were previously failing were ones that didn't actually open the zip file but compared it byte-for-byte with a known good one. |
Fixed the issue where the compression platform was set to Unix in the Windows environment. Now the platform can be automatically set to Dos or Unix based on the specific operating system.
fix #470