Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix depfile parser to support ? #2569

Conversation

digit-google
Copy link
Contributor

@digit-google digit-google commented Feb 4, 2025

The ? is actually valid on Unix filesystems, as well as on Windows when it appears at the start of the path, as in \\?\C:\foo or //?/C:/foo.

Before this patch, the depfile parser considered it as whitespace and would mistakenly decompose //?/C:/foo into two separate paths (// and /C:/foo) which broke Ninja incremental builds.

The major change in in src/depfile_parser.in.cc
Note that re2c version 3.1 was used to regenerate depfile_parser.cc from that file.

Fixes #2568

The `?` is actually valid on Unix filesystems, as well as on Windows
when it appears at the start of the path, as in `\\?\C:\foo` or
`//?/C:/foo`.

Before this patch, the depfile parser considered it as whitespace
and would mistakenly decompose `//?/C:/foo` into two separate paths
(`//` and `/C:/foo`) which broke Ninja incremental builds.

The major change in in src/depfile_parser.in.cc
Note that re2c version 3.1 was used to regenerate depfile_parser.cc
from that file.

Fixes ninja-build#2568
@digit-google digit-google force-pushed the fix-depfile-parser-for-win32-local-root-paths branch from c574d1c to e903357 Compare February 5, 2025 17:50
@jhasse jhasse merged commit 649ec6c into ninja-build:master Feb 5, 2025
13 checks passed
@jhasse
Copy link
Collaborator

jhasse commented Feb 5, 2025

Thanks!

@jhasse jhasse added this to the 1.13.0 milestone Feb 5, 2025
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.

windows device paths are handled incorrectly in depfiles
2 participants