From dd59dac57167b6d67bbb21acffeac249a959da59 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Mon, 6 Apr 2020 11:25:11 -0700 Subject: [PATCH 1/2] litex_setup: Use subprocess so failures are noticed. os.system doesn't report if any of the commands fail. This means that if something goes wrong it happily reports success making it hard to debug issues. --- litex_setup.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/litex_setup.py b/litex_setup.py index e70f31f30..be5e819fc 100755 --- a/litex_setup.py +++ b/litex_setup.py @@ -2,6 +2,7 @@ import os import sys +import subprocess from collections import OrderedDict @@ -46,7 +47,9 @@ if "init" in sys.argv[1:]: print("[cloning " + name + "]...") full_url = url + name 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:]: for name in repos.keys(): @@ -56,13 +59,19 @@ if "install" in sys.argv[1:]: if need_develop: os.chdir(os.path.join(current_path, name)) if "--user" in sys.argv[1:]: - os.system("python3 setup.py develop --user") + subprocess.check_call( + "python3 setup.py develop --user", + shell=True) else: - os.system("python3 setup.py develop") + subprocess.check_call( + "python3 setup.py develop", + shell=True) if "update" in sys.argv[1:]: for name in repos.keys(): # update print("[updating " + name + "]...") os.chdir(os.path.join(current_path, name)) - os.system("git pull") + subprocess.check_call( + "git pull", + shell=True) From d781bf208844f7b335578f899334d36628bd208f Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Mon, 6 Apr 2020 11:38:23 -0700 Subject: [PATCH 2/2] Run `litex_setup.py` outside the git clone directory. Otherwise it tries to overwrite the litex directory by cloning LiteX into it. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index eeddc7c78..c892607ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,12 @@ python: "3.6" install: # Get Migen / LiteX / Cores + - cd ~/ - wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py - python3 litex_setup.py init install + # Install the LiteX version being tested. + - cd $TRAVIS_BUILD_DIR + - python3 setup.py install before_script: # Get RISC-V toolchain