Skip to content

Commit

Permalink
Add contrib, 3rdparty to copy list for mock buildroot as v2 engine to…
Browse files Browse the repository at this point in the history
… pass prefix checks.

Testing Done:
https://travis-ci.org/pantsbuild/pants/builds/176184104 (v2 engine on, shard 9 passed)
https://travis-ci.org/pantsbuild/pants/builds/176194952 (regular v1 run)

Bugs closed: 4056

Reviewed at https://rbcommons.com/s/twitter/r/4379/
  • Loading branch information
wisechengyi committed Nov 15, 2016
1 parent f4f732d commit 680a033
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/python/pants_test/pants_run_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,20 @@ def temporary_file_content(self, path, content):
def mock_buildroot(self):
"""Construct a mock buildroot and return a helper object for interacting with it."""
Manager = namedtuple('Manager', 'write_file pushd dir')
# N.B. BUILD.tools needs to be copied vs symlinked to avoid a symlink prefix check error.
# N.B. BUILD.tools, contrib, 3rdparty needs to be copied vs symlinked to avoid
# symlink prefix check error in v1 and v2 engine.
files_to_copy = ('BUILD.tools',)
files_to_link = ('pants', 'pants.ini', 'pants.travis-ci.ini', '.pants.d',
'build-support', '3rdparty', 'pants-plugins', 'src', 'contrib')
'build-support', 'pants-plugins', 'src')
dirs_to_copy = ('contrib', '3rdparty')

with self.temporary_workdir() as tmp_dir:
for filename in files_to_copy:
shutil.copy(os.path.join(get_buildroot(), filename), os.path.join(tmp_dir, filename))

for dirname in dirs_to_copy:
shutil.copytree(os.path.join(get_buildroot(), dirname), os.path.join(tmp_dir, dirname))

for filename in files_to_link:
os.symlink(os.path.join(get_buildroot(), filename), os.path.join(tmp_dir, filename))

Expand Down

0 comments on commit 680a033

Please sign in to comment.