Skip to content

Commit

Permalink
Extract PPC64LE into script and port to Python.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Sep 24, 2020
1 parent 896ef66 commit d8b5461
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
10 changes: 1 addition & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,7 @@ jobs:
cache: pip

before_install:
- |
# Except on bionic, Travis Linux base image for PPC64LE
# platform lacks the proper
# permissions to the directory ~/.cache/pip/wheels that allow
# the user running travis build to install pip packages.
# TODO: is someone tracking this issue? Maybe just move to bionic?
if [[ "$TRAVIS_CPU_ARCH" == "ppc64le" ]]; then
sudo chown -Rfv $USER:$GROUP ~/.cache/pip/wheels
fi
- python tools/ppc64le-patch.py

install:

Expand Down
28 changes: 28 additions & 0 deletions tools/ppc64le-patch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
Except on bionic, Travis Linux base image for PPC64LE
platform lacks the proper
permissions to the directory ~/.cache/pip/wheels that allow
the user running travis build to install pip packages.
TODO: is someone tracking this issue? Maybe just move to bionic?
"""

import subprocess
import collections
import os


def patch():
env = collections.defaultdict(str, os.environ)
if env['TRAVIS_CPU_ARCH'] != 'ppc64le':
return
cmd = [
'sudo',
'chown',
'-Rfv',
'{USER}:{GROUP}'.format_map(env),
os.path.expanduser('~/.cache/pip/wheels'),
]
subprocess.Popen(cmd)


__name__ == '__main__' and patch()

0 comments on commit d8b5461

Please sign in to comment.