This is an archive of the discontinued LLVM Phabricator instance.

Allow custom formatting of session log file names
ClosedPublic

Authored by zturner on May 16 2016, 3:15 PM.

Details

Summary

I'm trying to get the LLDB buildbot to run tests, and currently the issue is that many tests fail when trying to write the session log file. The build directory on the buildbot is already nested kind of deep, which means the path to clang.exe is also deep, and having this in the filename results in paths that are 400+ characters long, which don't work well in Windows.

To fix this, I'm allowing the specification of a custom file format, where you can specify various fields to be included in the filename. The default behavior of dotest is unchanged, it will still display everything it's always displayed. But if you're using CMake then the default will be to not include the compiler path. This is because by default CMake also uses only runs tests with one compiler anyway, so the compiler path is not needed to distinguish identical tests run with different compilers.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner updated this revision to Diff 57409.May 16 2016, 3:15 PM
zturner retitled this revision from to Allow custom formatting of session log file names.
zturner updated this object.
zturner added reviewers: labath, tfiala.
zturner added a subscriber: lldb-commits.
tfiala edited edge metadata.May 16 2016, 9:24 PM

Hi Zachary,

I'll have a look at this first thing in the morning!

-Todd

Okay I had a look now. Just one comment on the code (inline), just for consideration. Other than that, LGTM.

packages/Python/lldbsuite/test/dotest_args.py
73 ↗(On Diff #57409)

group.add_argument('-S', metavar='format', help='Specify session file name format. See configuration.py for a description. Default="fnmac"')

Maybe include a long-style arg name as well? Something like:

group.add_argument('--session-file-format', '-S', metavar='format', help='Specify session file name format. See configuration.py for a description. Default="fnmac"')

Then it could be referenced as "if args.session_file_format" instead of "if args.S". But users could still use either '--session-file-format' or '-S' on the command line.

Not a big deal, but more readable for future maintainability, particularly if these options get ensconced in other CI scripts and the like, where a longer name is more helpful to see.

labath accepted this revision.May 17 2016, 1:31 AM
labath edited edge metadata.

I agree with Todd that we should have a long option for this, as short ones tend to be cryptic. If we don't anticipate using this often (I don't), we could even drop the short option altogether, as it's only advantage is that it is shorter to type. I'll leave that up to you, no need to go through review second time.

test/CMakeLists.txt
30 ↗(On Diff #57409)

If you don't intend to use this functionality, I wouldn't be opposed to just hardcoding the default. Any advanced users needing to set this will probably invoke dotest directly. Doesn't really matter though...

This revision is now accepted and ready to land.May 17 2016, 1:31 AM
tfiala accepted this revision.May 17 2016, 10:37 AM
tfiala edited edge metadata.

(Changing to Accept - although please have a look at the comments from Pavel and me).

This revision was automatically updated to reflect the committed changes.