Skip to content

Commit 3ce350d

Browse files
cliffmccarthymissytake
authored andcommitted
feat: Check whether GCC is installed in initenv.sh
- Before proceeding with installation of Python dependencies, check whether the 'gcc' command is available by running it with the --version argument. If it is not available, print a helpful message and exit. - For the current set of Python dependencies, without GCC, the build process fails when building the crypt-r package. According to the error message, on my system the exact command it tries to run is 'x86_64-linux-gnu-gcc', but rather than depend on this variant specifically, the script checks for the generic 'gcc' command, so as to avoid coupling the check to an architecture or operating system. Similar problems arise if we attempt to check for packages by name; the compiler binary is provided by 'gcc-11', but the symlinks that provide the unversioned commands (as used by the Python build) come from a package named 'gcc'. Trying to be too precise in what we check for could lead to unnecessary failures in some environments, or become a maintenance challenge in the future. For that reason, this change simply attempts to run 'gcc' and uses that as a probably-sufficient proxy for having what the Python package install will need.
1 parent 1e05974 commit 3ce350d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## untagged
44

5+
- Check whether GCC is installed in initenv.sh
6+
([#608](https://github.com/chatmail/relay/pull/608))
7+
58
- Expire push notification tokens after 90 days
69
([#583](https://github.com/chatmail/relay/pull/583))
710

scripts/initenv.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ if command -v lsb_release 2>&1 >/dev/null; then
99
echo "You need to install python3-dev for installing the other dependencies."
1010
exit 1
1111
fi
12-
if ! dpkg -l | grep build-essential 2>&1 >/dev/null
12+
if ! gcc --version 2>&1 >/dev/null
1313
then
14-
echo "You need to install build-essential for building Python dependencies."
14+
echo "You need to install gcc for building Python dependencies."
1515
exit 1
1616
fi
1717
;;

0 commit comments

Comments
 (0)