Commit bcb04df7 authored by Robert Flack's avatar Robert Flack Committed by Commit Bot

Symlink default rr trace directory in dummy home directory.

rr defaults to writing the trace to $HOME/.local/share/rr but run-webkit-tests
creates a dummy home directory that is deleted after tests run. In order to
make this "just work" we can symlink .local/share/rr to the real directory if
it exists.

Bug: 817861
Change-Id: I845c023c3be98835bddb757dad9a18231c7e69ce
Reviewed-on: https://chromium-review.googlesource.com/943826Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540281}
parent 89b772d7
...@@ -141,12 +141,14 @@ class LinuxPort(base.Port): ...@@ -141,12 +141,14 @@ class LinuxPort(base.Port):
if not fs.exists(original_path): if not fs.exists(original_path):
continue continue
fs.copyfile(original_path, fs.join(dummy_home, filename)) fs.copyfile(original_path, fs.join(dummy_home, filename))
# Prevent fontconfig etc. from reconstructing the cache. # Prevent fontconfig etc. from reconstructing the cache and symlink rr
for dirname in ['.cache']: # trace directory.
original_path = fs.join(self._original_home, dirname) for dirpath in [['.cache'], ['.local', 'share', 'rr']]:
original_path = fs.join(self._original_home, *dirpath)
if not fs.exists(original_path): if not fs.exists(original_path):
continue continue
fs.symlink(original_path, fs.join(dummy_home, dirname)) fs.maybe_make_directory(fs.join(dummy_home, *dirpath[:-1]))
fs.symlink(original_path, fs.join(dummy_home, *dirpath))
def _clean_up_dummy_home_dir(self): def _clean_up_dummy_home_dir(self):
"""Cleans up the dummy dir and resets the HOME environment variable.""" """Cleans up the dummy dir and resets the HOME environment variable."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment