-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Stats] Add a test for long input-path bug (0e5b982d) #12279
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
[Stats] Add a test for long input-path bug (0e5b982d) #12279
Conversation
// RUN: mkdir -p %t/very-long-directory-name-that-contains-over-128-characters-which-is-not-enough-to-be-illegal-on-its-own-but-presents | ||
// RUN: cp %s %t/very-long-directory-name-that-contains-over-128-characters-which-is-not-enough-to-be-illegal-on-its-own-but-presents/a-problem-when-combined-with-other-long-path-elements-and-filenames-to-exceed-256-characters-combined-because-yay-arbitrary-limits-amirite.swift | ||
// RUN: touch %t/main.swift | ||
// RUN: %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t %t/main.swift %t/very-long-directory-name-that-contains-over-128-characters-which-is-not-enough-to-be-illegal-on-its-own-but-presents/a-problem-when-combined-with-other-long-path-elements-and-filenames-to-exceed-256-characters-combined-because-yay-arbitrary-limits-amirite.swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why %target-swiftc_driver
rather than %target-build-swift
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not clear on the difference! Does it matter here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it probably doesn't. %target-build-swift
includes things like "pass -O when testing optimized", and that's not so relevant for this test. I mostly asked because I just default to %target-build-swift
and wondered why you didn't.
@@ -0,0 +1,16 @@ | |||
// REQUIRES: OS=macosx | |||
// RUN: rm -rf %t && mkdir -p %t | |||
// RUN: mkdir -p %t/very-long-directory-name-that-contains-over-128-characters-which-is-not-enough-to-be-illegal-on-its-own-but-presents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it doesn't matter that the total path at this point may or may not be over 256?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope. we're just trying to force it to be >256 when combined with the file and mangled into a string that has no path separators, so we need at least two big segments in the combined path. Extra big segments in %t will just make it fail more-thoroughly.
// RUN: rm -rf %t && mkdir -p %t | ||
// RUN: mkdir -p %t/very-long-directory-name-that-contains-over-128-characters-which-is-not-enough-to-be-illegal-on-its-own-but-presents | ||
// RUN: cp %s %t/very-long-directory-name-that-contains-over-128-characters-which-is-not-enough-to-be-illegal-on-its-own-but-presents/a-problem-when-combined-with-other-long-path-elements-and-filenames-to-exceed-256-characters-combined-because-yay-arbitrary-limits-amirite.swift | ||
// RUN: touch %t/main.swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have a main file at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to get the frontend invoked with a designated primary-file (not just 'all'), and this is the nearest to how it happens in the field: a multi-file compilation.
@swift-ci please smoke test and merge |
@swift-ci please smoke test Linux platform |
@swift-ci please clean smoke test Linux platform |
Add a testcase for the bug in 0e5b982 where we were forming over-long stats-dir output filenames.