Skip to content

ParseDepends: keep Windows drive-letter paths in depfiles - #4904

Merged
bdbaddog merged 2 commits into
SCons:masterfrom
r3wretrhy:fix-parsedepends-windows-drive
Sep 16, 2026
Merged

bdbaddog merged 2 commits into
SCons:masterfrom
r3wretrhy:fix-parsedepends-windows-drive

Conversation

@r3wretrhy

Copy link
Copy Markdown
Contributor

Environment.ParseDepends split each make-style depfile line on the first colon. A Windows line such as C:\build\foo.o: C:\src\foo.c was therefore treated as target C and the rest as dependencies.

Skip colons that are drive letters (C:\ / C:/) and keep the existing target.split() / depends.split() behaviour for Unix-style files.

The added unit test fails on the unpatched tree and passes with the change.

Tested: python runtest.py SCons/EnvironmentTests.py

@mwichmann

Copy link
Copy Markdown
Collaborator

This seems a valid concern.

Replace inline comments with a proper docstring to document the purpose
of skipping Windows drive-letter colons when splitting make-style depfile lines.
@bdbaddog

Copy link
Copy Markdown
Contributor

Looks good to me. I just pushed a minor change for the new function where I changed the comment on the functions functionality to be a docstring.
Merging.

@bdbaddog
bdbaddog merged commit 702c39a into SCons:master Sep 16, 2026
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