Add Windows CI support with Swift 6.3 and swift-jinja migration - #63
Add Windows CI support with Swift 6.3 and swift-jinja migration#63alexey1312 wants to merge 1 commit into
Conversation
Summary of ChangesHello @alexey1312, 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 significantly expands the project's platform compatibility by introducing full Windows support, including dedicated CI/CD workflows. A major refactoring involved migrating from the Stencil templating engine to Jinja2, which was crucial for achieving cross-platform functionality. The changes also include robust conditional compilation to manage platform-specific dependencies and improved URL handling for enhanced security and reliability. Highlights
Changelog
Ignored Files
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 introduces significant improvements by adding Windows CI support and migrating the templating engine from Stencil to swift-jinja for better cross-platform compatibility. The changes are extensive and well-executed, including conditional compilation for platform-specific dependencies like XcodeProj and modernizing platform checks with #if canImport. I've identified a critical security vulnerability in the new path traversal sanitization logic that needs to be addressed. Additionally, the PR includes several other commendable security enhancements, such as preventing network access during PKL evaluation and stripping authentication tokens on cross-host redirects, which greatly improve the tool's robustness.
| if sanitized.isEmpty { | ||
| assertionFailure("Destination path is empty after sanitization (original: \(relativePath))") | ||
| return directory.appendingPathComponent(relativePath) | ||
| } |
There was a problem hiding this comment.
This fallback logic re-introduces the path traversal vulnerability that the sanitization is meant to prevent. If sanitized is empty (e.g., if relativePath is "../"), this code will fall back to using the original, unsafe relativePath. In a release build, the assertionFailure will be ignored, and the code will silently write a file outside the intended directory.
To fix this, you should throw an error if the sanitized path is empty, ensuring that no unsafe file operations can occur.
if sanitized.isEmpty {
throw URLError(.badURL, userInfo: [NSLocalizedDescriptionKey: "Invalid destination path after sanitization (original: \(relativePath))"])
}- Add Windows build to ci.yml and release.yml using Swift 6.3 - Replace Stencil with swift-jinja for cross-platform compatibility - Add JinjaSupport shared module for template rendering - Make XcodeProj conditional (#if !os(Windows)) in Package.swift - Wrap XcodeProjectWriter in #if canImport(XcodeProj) (6 export files) - Use #if canImport(FoundationNetworking) instead of #if os(Linux) - Pin swift-resvg to 0.45.1-swift.15 (Windows artifactbundle) - Delete standalone windows-test.yml - Update docs: CLAUDE.md, linux-compat.md, README.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f87fec7 to
55b01ae
Compare
Description
compnerd/gha-setup-swift#if !os(Windows)) since it depends on Apple-only frameworks#if canImport(XcodeProj)across 6 export files#if canImport(FoundationNetworking)instead of#if os(Linux)for all non-Apple platform importsresvg.libnaming forlld-link)ci.ymlandrelease.yml, remove standalonewindows-test.ymlAdditional notes
libprefix for.libfiles)exact: "0.45.1-swift.15"which includes Windows pre-built binaryexfig-windows-x64.ziparchive withExFig.exeand resource bundles