Skip to content

Commit 6367d04

Browse files
committed
Make apt-get calls consistent
- Don't install packages implicitely - Make quiet(er) - Use retries
1 parent 8dbb11e commit 6367d04

8 files changed

Lines changed: 32 additions & 23 deletions

File tree

.azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# Copyright 2015-2019 Rene Rivera.
33
# Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
4-
# Copyright 2020-2021 Alexander Grund
4+
# Copyright 2020-2024 Alexander Grund
55
# Distributed under the Boost Software License, Version 1.0.
66
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
77

@@ -127,7 +127,7 @@ stages:
127127
# Need (newer) git
128128
sudo add-apt-repository ppa:git-core/ppa
129129
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
130-
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y g++ python libpython-dev git
130+
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install g++ python libpython-dev git
131131
displayName: 'Install required sw for containers'
132132
- task: Cache@2
133133
condition: eq(variables.B2_USE_CCACHE, '1')

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright 2020-2021 Peter Dimov
22
# Copyright 2021 Andrey Semashev
3-
# Copyright 2021 Alexander Grund
3+
# Copyright 2021-2024 Alexander Grund
44
# Copyright 2022 James E. King III
55
#
66
# Distributed under the Boost Software License, Version 1.0.
@@ -128,7 +128,7 @@ jobs:
128128
fi
129129
if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then
130130
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
131-
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common curl
131+
apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install sudo software-properties-common curl
132132
# Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80
133133
curl -sSL --retry ${NET_RETRY_COUNT:-5} 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xE1DD270288B4E6030699E45FA1715D88E1DF1F24' | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/git-core_ubuntu_ppa.gpg
134134
for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
@@ -141,7 +141,7 @@ jobs:
141141
else
142142
pkgs+=" python libpython-dev"
143143
fi
144-
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs
144+
apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install $pkgs
145145
fi
146146
# For jobs not compatible with ccache, use "ccache: no" in the matrix
147147
if [[ "${{ matrix.ccache }}" == "no" ]]; then
@@ -197,15 +197,15 @@ jobs:
197197
else
198198
pkgs="${{matrix.install}}"
199199
fi
200-
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs
200+
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install $pkgs
201201
202202
- name: Setup GCC Toolchain
203203
if: matrix.gcc_toolchain
204204
run: |
205205
GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain"
206206
echo "GCC_TOOLCHAIN_ROOT=$GCC_TOOLCHAIN_ROOT" >> $GITHUB_ENV
207207
if ! command -v dpkg-architecture; then
208-
apt-get install -y dpkg-dev
208+
apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install dpkg-dev
209209
fi
210210
MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
211211
mkdir -p "$GCC_TOOLCHAIN_ROOT"

.github/workflows/old_ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright 2020-2021 Peter Dimov
22
# Copyright 2021 Andrey Semashev
3-
# Copyright 2021 Alexander Grund
3+
# Copyright 2021-2024 Alexander Grund
44
#
55
# Distributed under the Boost Software License, Version 1.0.
66
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
@@ -19,6 +19,9 @@ concurrency:
1919
group: ${{format('compat-{0}:{1}', github.repository, github.ref)}}
2020
cancel-in-progress: true
2121

22+
env:
23+
NET_RETRY_COUNT: 5
24+
2225
jobs:
2326
posix:
2427
defaults:
@@ -119,7 +122,7 @@ jobs:
119122
if: startsWith(matrix.os, 'ubuntu')
120123
run: |
121124
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
122-
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y ${{matrix.install}}
125+
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install ${{matrix.install}}
123126
124127
- name: Setup Boost
125128
run: source ci/github/install.sh

ci/azure-pipelines/install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Copyright 2017 - 2019 James E. King III
44
# Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
5-
# Copyright 2021 Alexander Grund
5+
# Copyright 2021-2024 Alexander Grund
66
# Distributed under the Boost Software License, Version 1.0.
77
# (See accompanying file LICENSE_1_0.txt or copy at
88
# http://www.boost.org/LICENSE_1_0.txt)
@@ -52,15 +52,15 @@ if [ "$AGENT_OS" != "Darwin" ]; then
5252
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS:-xenial}/ ${LLVM_REPO} main" && break || sleep 10
5353
done
5454
fi
55-
sudo apt-get ${NET_RETRY_COUNT:+ -o Acquire::Retries=$NET_RETRY_COUNT} update
56-
sudo apt-get ${NET_RETRY_COUNT:+ -o Acquire::Retries=$NET_RETRY_COUNT} install -y ${PACKAGES}
55+
sudo apt-get -o Acquire::Retries="${NET_RETRY_COUNT:-3}" update
56+
sudo apt-get -o Acquire::Retries="${NET_RETRY_COUNT:-3}" -y -q --no-install-suggests --no-install-recommends install ${PACKAGES}
5757
fi
5858

5959
if [[ -z "$GCC_TOOLCHAIN_ROOT" ]] && [[ -n "$GCC_TOOLCHAIN" ]]; then
6060
GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain"
6161
echo "##vso[task.setvariable variable=GCC_TOOLCHAIN_ROOT]$GCC_TOOLCHAIN_ROOT"
6262
if ! command -v dpkg-architecture; then
63-
apt-get install -y dpkg-dev
63+
apt-get -o Acquire::Retries="${NET_RETRY_COUNT:-3}" -y -q --no-install-suggests --no-install-recommends install dpkg-dev
6464
fi
6565
MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
6666
mkdir -p "$GCC_TOOLCHAIN_ROOT"

ci/codecov.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
#
33
# Copyright 2017 - 2022 James E. King III
4-
# Copyright 2021 Alexander Grund
4+
# Copyright 2021-2024 Alexander Grund
55
# Distributed under the Boost Software License, Version 1.0.
66
# (See accompanying file LICENSE_1_0.txt or copy at
77
# http://www.boost.org/LICENSE_1_0.txt)
@@ -58,7 +58,7 @@ elif [[ "$coverage_action" == "collect" ]] || [[ "$coverage_action" == "upload"
5858
: "${LCOV_VERSION:=v1.15}"
5959

6060
if [[ "$LCOV_VERSION" =~ ^v[2-9] ]]; then
61-
sudo apt-get install -y libcapture-tiny-perl libdatetime-perl || true
61+
sudo apt-get -o Acquire::Retries="${NET_RETRY_COUNT:-3}" -y -q --no-install-suggests --no-install-recommends install libcapture-tiny-perl libdatetime-perl || true
6262
LCOV_OPTIONS="${LCOV_OPTIONS} --ignore-errors unused"
6363
LCOV_OPTIONS=$(echo ${LCOV_OPTIONS} | xargs echo)
6464
fi

ci/drone/linux-cxx-install.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/bash
2+
#
3+
# Copyright 2020-2022 Sam Darwin
4+
# Copyright 2021-2024 Alexander Grund
5+
# Distributed under the Boost Software License, Version 1.0.
6+
# (See accompanying file LICENSE_1_0.txt or copy at
7+
# http://www.boost.org/LICENSE_1_0.txt)
28

39
set -e
410

@@ -41,7 +47,7 @@ if [ -n "${LLVM_OS}" ]; then
4147
# Snapshot (i.e. trunk) build
4248
llvm_toolchain="llvm-toolchain-${LLVM_OS}"
4349
fi
44-
add_repository "deb http://apt.llvm.org/${LLVM_OS}/ ${llvm_toolchain} main"
50+
add_repository "deb https://apt.llvm.org/${LLVM_OS}/ ${llvm_toolchain} main"
4551
fi
4652

4753
if [ -n "${SOURCES}" ]; then
@@ -52,7 +58,7 @@ if [ -n "${SOURCES}" ]; then
5258
fi
5359

5460
echo ">>>>> APT: UPDATE..."
55-
sudo -E apt-get -o Acquire::Retries=3 update
61+
sudo -E apt-get -o Acquire::Retries="${NET_RETRY_COUNT:-3}" update
5662

5763
echo ">>>>> APT: INSTALL ${PACKAGES}..."
58-
sudo -E DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -y --no-install-suggests --no-install-recommends install ${PACKAGES}
64+
sudo -E DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries="${NET_RETRY_COUNT:-3}" -y -q --no-install-suggests --no-install-recommends install ${PACKAGES}

ci/setup_bdde.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
set -ex
2020

2121
if [ -f "/etc/debian_version" ]; then
22-
sudo apt-get install --no-install-recommends -y binfmt-support qemu-user-static
22+
sudo apt-get -o Acquire::Retries="${NET_RETRY_COUNT:-3}" -y -q --no-install-suggests --no-install-recommends install binfmt-support qemu-user-static
2323
fi
2424

2525
# this prepares the VM for multiarch docker

ci/setup_ccache.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright 2021 Alexander Grund
3+
# Copyright 2021-2024 Alexander Grund
44
# Distributed under the Boost Software License, Version 1.0.
55
# (See accompanying file LICENSE_1_0.txt or copy at
66
# http://www.boost.org/LICENSE_1_0.txt)
@@ -11,7 +11,7 @@ set -ex
1111

1212
if ! command -v ccache &> /dev/null; then
1313
if [ -f "/etc/debian_version" ]; then
14-
sudo apt-get install ${NET_RETRY_COUNT:+ -o Acquire::Retries=$NET_RETRY_COUNT} -y ccache
14+
sudo apt-get -o Acquire::Retries="${NET_RETRY_COUNT:-3}" -y -q --no-install-suggests --no-install-recommends install ccache
1515
elif command -v brew &> /dev/null; then
1616
brew update > /dev/null
1717
if ! brew install ccache; then
@@ -24,7 +24,7 @@ if ! command -v ccache &> /dev/null; then
2424
fi
2525
fi
2626
fi
27-
ccache --set-config=cache_dir=${B2_CCACHE_DIR:-~/.ccache}
28-
ccache --set-config=max_size=${B2_CCACHE_SIZE:-500M}
27+
ccache --set-config=cache_dir="${B2_CCACHE_DIR:-~/.ccache}"
28+
ccache --set-config=max_size="${B2_CCACHE_SIZE:-500M}"
2929
ccache -z
3030
echo "CCache config: $(ccache -p)"

0 commit comments

Comments
 (0)