From 4c4729ee14c5d281323b1d703ad2cad2ead3ac85 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Tue, 27 Jul 2021 14:57:02 -0700 Subject: [PATCH] fix https://bugs.libre-soc.org/show_bug.cgi?id=661 --- Cargo.lock | 6 ++++-- Cargo.toml | 6 +++--- libre-soc-install.sh | 18 ++++++++++++++++++ .../Cargo.toml | 4 ++-- pyproject.toml | 4 ++-- 5 files changed, 29 insertions(+), 9 deletions(-) create mode 100755 libre-soc-install.sh diff --git a/Cargo.lock b/Cargo.lock index 67a0a64..8f9e33e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "bitflags" version = "1.2.1" @@ -161,7 +163,7 @@ dependencies = [ [[package]] name = "power-instruction-analyzer" -version = "0.2.0" +version = "0.2.1" dependencies = [ "power-instruction-analyzer-proc-macro", "pyo3", @@ -172,7 +174,7 @@ dependencies = [ [[package]] name = "power-instruction-analyzer-proc-macro" -version = "0.2.0" +version = "0.2.1" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index d1ed811..80697a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ # See Notices.txt for copyright information [package] name = "power-instruction-analyzer" -version = "0.2.0" +version = "0.2.1" authors = ["Jacob Lifshay "] edition = "2018" license = "LGPL-2.1-or-later" @@ -26,10 +26,10 @@ pyo3 = { version = "0.11", optional = true } [dependencies.power-instruction-analyzer-proc-macro] path = "power-instruction-analyzer-proc-macro" -version = "=0.2.0" +version = "=0.2.1" [workspace] members = [ ".", "power-instruction-analyzer-proc-macro", -] \ No newline at end of file +] diff --git a/libre-soc-install.sh b/libre-soc-install.sh new file mode 100755 index 0000000..24ccf47 --- /dev/null +++ b/libre-soc-install.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +function fail() +{ + echo "error: $@" >&2 + exit 1 +} + +cargo_version="$(cargo --version)" || fail "can't find cargo, install it from https://rustup.rs/" +[[ "$cargo_version" =~ ^'cargo 1.'([0-9]+)'.'[0-9]+' ' ]] || fail "can't parse cargo's version string" +(( "${BASH_REMATCH[1]}" >= 53 )) || fail 'your rust version is not recent enough, update your rust version using `rustup update`' +python3 -m pip install 'maturin>=0.11,<0.12' +scripts="$(python3 -m sysconfig | sed 's/^\tscripts = "\([^"]\+\)"$/\1/p; d')" +[[ -d "$scripts" ]] || fail "can't find python's \`scripts\` directory" +rm -f target/wheels/power_instruction_analyzer-*.whl +"$scripts"/maturin build --compatibility linux --cargo-extra-args=--features=python-extension -i python3 --release --no-sdist +python3 -m pip install target/wheels/power_instruction_analyzer-*.whl \ No newline at end of file diff --git a/power-instruction-analyzer-proc-macro/Cargo.toml b/power-instruction-analyzer-proc-macro/Cargo.toml index 3ca7cb5..6b1b193 100644 --- a/power-instruction-analyzer-proc-macro/Cargo.toml +++ b/power-instruction-analyzer-proc-macro/Cargo.toml @@ -2,7 +2,7 @@ # See Notices.txt for copyright information [package] name = "power-instruction-analyzer-proc-macro" -version = "0.2.0" +version = "0.2.1" authors = ["Jacob Lifshay "] edition = "2018" license = "LGPL-2.1-or-later" @@ -14,4 +14,4 @@ proc-macro = true [dependencies] quote = "1.0" proc-macro2 = "1.0" -syn = { version = "1.0", features = ["full", "parsing", "extra-traits"] } \ No newline at end of file +syn = { version = "1.0", features = ["full", "parsing", "extra-traits"] } diff --git a/pyproject.toml b/pyproject.toml index 443c8b4..182a4f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later # See Notices.txt for copyright information [build-system] -requires = ["maturin"] +requires = ["maturin>=0.11,<0.12"] build-backend = "maturin" [tool.maturin] bindings = "pyo3" cargo-extra-args = "--features python-extension" -sdist-include = ["power-instruction-analyzer-proc-macro/**/*"] \ No newline at end of file +sdist-include = ["power-instruction-analyzer-proc-macro/**/*"] -- 2.30.2