From 93880bbef4f9d176dd501ee125aebf7fffb016d0 Mon Sep 17 00:00:00 2001 From: Piotr Zierhoffer Date: Wed, 30 Oct 2019 23:27:14 +0100 Subject: [PATCH 1/3] scripts: Fix build-linux script to properly verify if gcc is installed The change is quite obvious, but without it conda is always trying to install new things and, possibly, update the current environment, which is not wanted. --- scripts/build-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-linux.sh b/scripts/build-linux.sh index 732055b7d..a6a04ebd2 100755 --- a/scripts/build-linux.sh +++ b/scripts/build-linux.sh @@ -44,7 +44,7 @@ if [ "$FIRMWARE" != "linux" ]; then fi # Install a baremetal toolchain with the newlib standard library -if ! ${CPU_ARCH}-elf-newlib --version > /dev/null 2>&1; then +if ! ${CPU_ARCH}-elf-newlib-gcc --version > /dev/null 2>&1; then conda install gcc-${CPU_ARCH}-elf-newlib fi # Install a Linux userspace toolchain with the musl standard library From b8d29a8f122b5c5d1d1e51fc52970e13fe6ffa22 Mon Sep 17 00:00:00 2001 From: Piotr Zierhoffer Date: Thu, 31 Oct 2019 13:42:20 +0100 Subject: [PATCH 2/3] scripts: Set CONDA_PREFIX in enter-env.sh and download-env.sh This is required for Renode package to run properly. This variable is set automatically when activating an environment, but not if we work with the base one, without activation. Setting it in download-env will ensure the proper path when running it from an activated environment. Please note this is not a default usage scenario. --- scripts/download-env.sh | 4 ++++ scripts/enter-env.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/scripts/download-env.sh b/scripts/download-env.sh index 166834ad7..d0b0b4f2f 100755 --- a/scripts/download-env.sh +++ b/scripts/download-env.sh @@ -74,6 +74,10 @@ set -e . $SETUP_DIR/settings.sh +# If we activate an environment, CONDA_PREFIX is set. Otherwise use CONDA_DIR. +export CONDA_PREFIX="${CONDA_PREFIX:-$CONDA_DIR}" +export CONDA_DIR=$CONDA_PREFIX + echo " This script is: $SETUP_SRC" echo " Firmware directory: $TOP_DIR" echo " Build directory is: $BUILD_DIR" diff --git a/scripts/enter-env.sh b/scripts/enter-env.sh index b15c4675e..4f47d3c18 100755 --- a/scripts/enter-env.sh +++ b/scripts/enter-env.sh @@ -74,6 +74,10 @@ fi . $SETUP_DIR/settings.sh +# If we activate an environment, CONDA_PREFIX is set. Otherwise use CONDA_DIR. +export CONDA_PREFIX="${CONDA_PREFIX:-$CONDA_DIR}" +export CONDA_DIR=$CONDA_PREFIX + echo " This script is: $SETUP_SRC" echo " Firmware directory: $TOP_DIR" echo " Build directory is: $BUILD_DIR" From ab1cca1c1c9b784e397f38531adcf79209596def Mon Sep 17 00:00:00 2001 From: Piotr Zierhoffer Date: Thu, 31 Oct 2019 13:44:12 +0100 Subject: [PATCH 3/3] scripts: renode: Use Renode from conda package --- scripts/build-renode.sh | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/scripts/build-renode.sh b/scripts/build-renode.sh index 40d5b929e..024360dc0 100755 --- a/scripts/build-renode.sh +++ b/scripts/build-renode.sh @@ -26,24 +26,7 @@ fi if ! $RENODE_FOUND; then # Download prebuilt renode Release if none is currently installed - - RENODE_PACKAGE=renode-latest.linux-portable.tar.gz - RENODE_URL=https://antmicro.com/projects/renode/builds/$RENODE_PACKAGE - RENODE_LOCATION="$BUILD_DIR/renode" - mkdir -p $RENODE_LOCATION - - RENODE_BIN=`find $RENODE_LOCATION -executable -type f -name renode` - if [ ! -x "$RENODE_BIN" ]; then - ( - cd $RENODE_LOCATION - wget $RENODE_URL - tar -xf $RENODE_PACKAGE - ) - - RENODE_BIN=`find $RENODE_LOCATION -executable -type f -name renode` - chmod u+x $RENODE_BIN - echo "Renode downloaded and installed locally: $RENODE_BIN" - fi + conda install -c antmicro -c conda-forge renode fi case $CPU in