Skip to content

fix: normalize path separators on Windows to ensure consistent output - #2154

Closed
chirizxc wants to merge 2 commits into
zizmorcore:mainfrom
chirizxc:2146
Closed

chirizxc wants to merge 2 commits into
zizmorcore:mainfrom
chirizxc:2146

Conversation

@chirizxc

@chirizxc chirizxc commented Jun 26, 2026 •

Copy link
Copy Markdown

Pre-submission checks

Please check these boxes:

  • Mandatory: This PR corresponds to an issue (if not, please create
    one first).

  • Having read the AI policy, I hereby disclose the use of an LLM or other
    AI coding assistant in the creation of this PR. PRs will not be rejected
    for using AI tools, but will be rejected for undisclosed use or
    use that violates the policy.

If a checkbox is not applicable, you can leave it unchecked.

Summary

Test Plan

Added test test_input_key_windows_path_normalization and run PR version zizmor locally:
изображение

@chirizxc chirizxc changed the title try fix 2146 fix: normalize path separators on Windows to ensure consistent output Jun 26, 2026
@woodruffw

Copy link
Copy Markdown
Member

@chirizxc Could you please use our PR template? Thanks.

@chirizxc

Copy link
Copy Markdown
Author

@chirizxc Could you please use our PR template? Thanks.

done

@woodruffw woodruffw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @chirizxc, but I'm not sure this is the approach we want -- post-hoc transformation of paths into a cross-platform normal form is pretty brittle. I need to look more at why this changed with 1.26 and ensure that we propagate paths in the appropriate native form (except where required by formats like SARIF).

@chirizxc

Copy link
Copy Markdown
Author

Thanks for the PR @chirizxc, but I'm not sure this is the approach we want -- post-hoc transformation of paths into a cross-platform normal form is pretty brittle. I need to look more at why this changed with 1.26 and ensure that we propagate paths in the appropriate native form (except where required by formats like SARIF).

But it didn't change in version 1.26; it seems this behavior has always been there

@woodruffw

Copy link
Copy Markdown
Member

Oh, I misread the logs in #2146, sorry. I still think we want to preserve the native path format here, but I need to think about it more.

@shaanmajid

shaanmajid commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Maybe something the following would be acceptable?

  fn native_path(path: &Utf8Path) -> Utf8PathBuf {
        #[cfg(windows)]
        {
            path.components().collect()
        }

        #[cfg(not(windows))]
        {
            path.to_path_buf()
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants