Skip to content

[windows] Use extended length paths for os.walk invocation. #34265

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

Merged

Conversation

drodriguez
Copy link
Contributor

In the Windows VS 2017 CI machines, the path for certain tests end up
being very long. rewrite-module-triples.py was aware and was using
extended length paths for the copy and remove operations in Windows
but it was not using it for the os.walk invocation, so when a folder
that was longer than MAX_PATH was encountered, the walk stopped
drilling into it, missing some module-triple-here substitutions and
making some test fail.

The changes remove the special treatment of the copy and remove
operations and move it into os.walk, which carries the prefix to
every path.

This should fix the problems seen in the SourceKit test in the
Windows VS 2017 machine:

  • SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift
  • SourceKit/DocSupport/doc_cross_import_common.swift
  • SourceKit/CursorInfo/cursor_info_cross_import_common_case.swift

PD: Misc/stats_dir_profiler.swift is something else. It seems as if
an glob was not being expanded by lit for some reason.

In the Windows VS 2017 CI machines, the path for certain tests end up
being very long. rewrite-module-triples.py was aware and was using
extended length paths for the copy and remove operations in Windows
but it was not using it for the os.walk invocation, so when a folder
that was longer than MAX_PATH was encountered, the walk stopped
drilling into it, missing some module-triple-here substitutions and
making some test fail.

The changes remove the special treatment of the copy and remove
operations and move it into os.walk, which carries the prefix to
every path.

This should fix the problems seen in the SourceKit test in the
Windows VS 2017 machine:

- SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift
- SourceKit/DocSupport/doc_cross_import_common.swift
- SourceKit/CursorInfo/cursor_info_cross_import_common_case.swift

PD: Misc/stats_dir_profiler.swift is something else. It seems as if
an glob was not being expanded by lit for some reason.
@drodriguez
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Nice cleanup, thanks!

@compnerd
Copy link
Member

@swift-ci please smoke test

@drodriguez drodriguez merged commit 53560fe into swiftlang:main Oct 11, 2020
@drodriguez drodriguez deleted the windows-rewrite-module-triples branch October 11, 2020 01:29
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.

2 participants