Merge pull request #450 from mithro/litex-setup-fix

litex_setup: Use subprocess so failures are noticed.
This commit is contained in:
enjoy-digital 2020-04-06 23:04:47 +02:00 committed by GitHub
commit e408fb8f08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 4 deletions

View File

@ -4,8 +4,12 @@ python: "3.6"
install: install:
# Get Migen / LiteX / Cores # Get Migen / LiteX / Cores
- cd ~/
- wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py - wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
- python3 litex_setup.py init install - python3 litex_setup.py init install
# Install the LiteX version being tested.
- cd $TRAVIS_BUILD_DIR
- python3 setup.py install
before_script: before_script:
# Get RISC-V toolchain # Get RISC-V toolchain

View File

@ -2,6 +2,7 @@
import os import os
import sys import sys
import subprocess
from collections import OrderedDict from collections import OrderedDict
@ -46,7 +47,9 @@ if "init" in sys.argv[1:]:
print("[cloning " + name + "]...") print("[cloning " + name + "]...")
full_url = url + name full_url = url + name
opts = "--recursive" if need_recursive else "" opts = "--recursive" if need_recursive else ""
os.system("git clone " + full_url + " " + opts) subprocess.check_call(
"git clone " + full_url + " " + opts,
shell=True)
if "install" in sys.argv[1:]: if "install" in sys.argv[1:]:
for name in repos.keys(): for name in repos.keys():
@ -56,13 +59,19 @@ if "install" in sys.argv[1:]:
if need_develop: if need_develop:
os.chdir(os.path.join(current_path, name)) os.chdir(os.path.join(current_path, name))
if "--user" in sys.argv[1:]: if "--user" in sys.argv[1:]:
os.system("python3 setup.py develop --user") subprocess.check_call(
"python3 setup.py develop --user",
shell=True)
else: else:
os.system("python3 setup.py develop") subprocess.check_call(
"python3 setup.py develop",
shell=True)
if "update" in sys.argv[1:]: if "update" in sys.argv[1:]:
for name in repos.keys(): for name in repos.keys():
# update # update
print("[updating " + name + "]...") print("[updating " + name + "]...")
os.chdir(os.path.join(current_path, name)) os.chdir(os.path.join(current_path, name))
os.system("git pull") subprocess.check_call(
"git pull",
shell=True)