Skip to content

Commit 6b7514c

Browse files
committed
Improve setup scripts for development (rust-lang#322)
* Define dependencies with an array Among other things, this will allow us to comment on them in the future. * Add missing (non-CI) dependency Running setup scripts on the default Ubuntu AMI results in this error message: ``` + sudo python3 -m pip install --upgrade cbmc_viewer-2.5-py3-none-any.whl /usr/bin/python3: No module named pip ``` This fixes the issue. * Use the downloaded file, if already downloaded wget has a default behavior that causes downloads like this to get new unexpected filenames if the file already exists. The switch to curl is simply personal preference. * swap back to wget * keep deps in alpha order for now
1 parent dda8345 commit 6b7514c

File tree

3 files changed

+51
-33
lines changed

3 files changed

+51
-33
lines changed

scripts/setup/install_viewer.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
# SPDX-License-Identifier: Apache-2.0 OR MIT
44

5-
set -eux
5+
set -eu
66

77
# Install cbmc-viewer
8-
if [[ $# -eq 1 ]] ; then
9-
wget https://github.com/awslabs/aws-viewer-for-cbmc/releases/download/viewer-$1/cbmc_viewer-$1-py3-none-any.whl \
10-
&& sudo python3 -m pip install --upgrade cbmc_viewer-$1-py3-none-any.whl
11-
else
12-
echo "Error: Specify the version to install"
8+
9+
if [[ $# -ne 1 ]]; then
10+
echo "$0: Error: Specify the version to install"
1311
exit 1
1412
fi
13+
14+
FILE="cbmc_viewer-$1-py3-none-any.whl"
15+
URL="https://github.com/awslabs/aws-viewer-for-cbmc/releases/download/viewer-$1/$FILE"
16+
17+
set -x
18+
19+
wget -O "$FILE" "$URL"
20+
sudo python3 -m pip install --upgrade "$FILE"

scripts/setup/ubuntu-20.04/install_cbmc.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
# SPDX-License-Identifier: Apache-2.0 OR MIT
44

5-
set -eux
5+
set -eu
66

77
# Install CBMC 5.30.1 for Ubuntu 20.04
8-
wget https://github.com/diffblue/cbmc/releases/download/cbmc-5.30.1/ubuntu-20.04-cbmc-5.30.1-Linux.deb \
9-
&& sudo dpkg -i ubuntu-20.04-cbmc-5.30.1-Linux.deb \
10-
&& cbmc --version
8+
9+
FILE="ubuntu-20.04-cbmc-5.30.1-Linux.deb"
10+
URL="https://github.com/diffblue/cbmc/releases/download/cbmc-5.30.1/$FILE"
11+
12+
set -x
13+
14+
wget -O "$FILE" "$URL"
15+
sudo dpkg -i "$FILE"
16+
17+
cbmc --version

scripts/setup/ubuntu-20.04/install_deps.sh

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,33 @@
22
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
# SPDX-License-Identifier: Apache-2.0 OR MIT
44

5-
set -eux
5+
set -eu
66

7-
# Install tools in Ubuntu 20.04 via `apt-get`
8-
sudo apt-get --yes update \
9-
&& sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
10-
bison \
11-
cmake \
12-
ctags \
13-
curl \
14-
flex \
15-
g++ \
16-
gcc \
17-
git \
18-
gpg-agent \
19-
libssl-dev \
20-
lsb-release \
21-
make \
22-
ninja-build \
23-
patch \
24-
pkg-config \
25-
python-is-python3 \
26-
software-properties-common \
27-
wget \
28-
zlib1g \
7+
DEPS=(
8+
bison
9+
cmake
10+
ctags
11+
curl
12+
flex
13+
g++
14+
gcc
15+
git
16+
gpg-agent
17+
libssl-dev
18+
lsb-release
19+
make
20+
ninja-build
21+
patch
22+
pkg-config
23+
python-is-python3
24+
python3-pip # Default in CI, but missing in AWS AMI
25+
software-properties-common
26+
wget
27+
zlib1g
2928
zlib1g-dev
29+
)
30+
31+
set -x
32+
33+
sudo apt-get --yes update
34+
sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes "${DEPS[@]}"

0 commit comments

Comments
 (0)