Skip to content

Commit

Permalink
setup.py: Pin uplink-c to v1.1.0 (#10)
Browse files Browse the repository at this point in the history
Also, exit the install with an error if the uplink-c build fails.
  • Loading branch information
calebcase authored Dec 3, 2020
1 parent b6ca0dc commit 617d88f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def run(self):
os.system("echo Building libuplinkc.so")
copy_command = "copy" if platform.system() == "Windows" else "cp"
command = "git clone https://github.com/storj/uplink-c && cd uplink-c" \
"&& go build -o libuplinkc.so " \
"-buildmode=c-shared && " \
+ copy_command + " *.so " + install_path
"&& git checkout v1.1.0" \
"&& go build -o libuplinkc.so -buildmode=c-shared" \
"&& " + copy_command + " *.so " + install_path
build_so = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, shell=True)
Expand All @@ -49,7 +49,8 @@ def run(self):
if errors is not None:
os.system("echo " + errors.decode('utf-8'))
os.system("echo Building libuplinkc.so failed.")

if build_so.returncode != 0:
os.exit(1)
except Exception as error:
os.system("echo " + str(error))
os.system("echo Building libuplinkc.so failed.")
Expand Down

0 comments on commit 617d88f

Please sign in to comment.