Skip to content

Commit 7c8aa78

Browse files
committed
[ci] Fix linux packages build
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
1 parent 5100079 commit 7c8aa78

8 files changed

Lines changed: 855 additions & 21 deletions

File tree

.github/workflows/linux-package.yml

Lines changed: 101 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,88 @@ env:
4242
BASEREPO: https://boinc.berkeley.edu/dl/linux # no trailing slash
4343
AUTOCONF_WITH_VERSION: autoconf-2.73
4444
BISON_WITH_VERSION: bison-3.8.2
45+
PYTHON_VERSION: 3.9.0
4546

4647
jobs:
48+
prepare-build-dependencies:
49+
name: Prepare build dependencies
50+
runs-on: ubuntu-latest
51+
container:
52+
image: debian:buster
53+
steps:
54+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
55+
with:
56+
fetch-depth: 2
57+
58+
- name: Cache dependencies
59+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
60+
with:
61+
path: |
62+
${{ env.AUTOCONF_WITH_VERSION }}.tar.gz
63+
${{ env.BISON_WITH_VERSION }}.tar.gz
64+
Python-${{ env.PYTHON_VERSION }}.tar.xz
65+
key: ${{ env.AUTOCONF_WITH_VERSION }}_${{ env.BISON_WITH_VERSION }}_Python-${{ env.PYTHON_VERSION }}
66+
67+
- name: Fix debian sources
68+
run: |
69+
sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list
70+
sed -i 's/security.debian.org/archive.debian.org/g' /etc/apt/sources.list
71+
72+
- name: Install dependencies
73+
run: |
74+
apt-get update
75+
apt install -y autopoint make build-essential m4 pkg-config autoconf autoconf-archive libtool curl tar xz-utils make gcc libssl-dev lzma-dev liblzma-dev libreadline-dev libbz2-dev libsqlite3-dev libgdbm-dev libgdbm-compat-dev uuid-dev libffi-dev tk-dev
76+
77+
- name: Build updated version of autoconf
78+
run: |
79+
if [ ! -f ${{ env.AUTOCONF_WITH_VERSION }}.tar.gz ]; then
80+
curl https://ftp.gnu.org/gnu/autoconf/${{ env.AUTOCONF_WITH_VERSION }}.tar.gz -o ${{ env.AUTOCONF_WITH_VERSION }}.tar.gz
81+
fi
82+
tar -xzf ${{ env.AUTOCONF_WITH_VERSION }}.tar.gz
83+
cd ${{ env.AUTOCONF_WITH_VERSION }}
84+
./configure --prefix=/usr
85+
make -j $(nproc --all)
86+
cd ..
87+
88+
- name: Build updated version of bison
89+
run: |
90+
if [ ! -f ${{ env.BISON_WITH_VERSION }}.tar.gz ]; then
91+
curl https://ftp.gnu.org/gnu/bison/${{ env.BISON_WITH_VERSION }}.tar.gz -o ${{ env.BISON_WITH_VERSION }}.tar.gz
92+
fi
93+
tar -xzf ${{ env.BISON_WITH_VERSION }}.tar.gz
94+
cd ${{ env.BISON_WITH_VERSION }}
95+
./configure --prefix=/usr
96+
make -j $(nproc --all)
97+
cd ..
98+
99+
- name: Build updated version of python
100+
run: |
101+
if [ ! -f Python-${{ env.PYTHON_VERSION }}.tar.xz ]; then
102+
curl https://www.python.org/ftp/python/${{ env.PYTHON_VERSION }}/Python-${{ env.PYTHON_VERSION }}.tar.xz -o Python-${{ env.PYTHON_VERSION }}.tar.xz
103+
fi
104+
tar -xf Python-${{ env.PYTHON_VERSION }}.tar.xz
105+
cd Python-${{ env.PYTHON_VERSION }}
106+
./configure --prefix=/usr/local --with-ensurepip=install
107+
make -j $(nproc --all)
108+
cd ..
109+
110+
- name: Add prepared dependencies to archive
111+
run: |
112+
tar -cvzpf build-deps_${{ github.event.pull_request.head.sha }}.tar.gz \
113+
${{ env.AUTOCONF_WITH_VERSION }}/ \
114+
${{ env.BISON_WITH_VERSION }}/ \
115+
Python-${{ env.PYTHON_VERSION }}/
116+
117+
- name: Upload prepared dependencies
118+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
119+
with:
120+
name: build-deps_${{ github.event.pull_request.head.sha }}
121+
path: build-deps_${{ github.event.pull_request.head.sha }}.tar.gz
122+
47123
prepare-binaries:
48124
name: Prepare Binaries
49125
runs-on: ubuntu-latest
126+
needs: prepare-build-dependencies
50127
container:
51128
image: debian:buster
52129
env:
@@ -63,14 +140,6 @@ jobs:
63140
with:
64141
fetch-depth: 2
65142

66-
- name: Cache dependencies
67-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
68-
with:
69-
path: |
70-
${{ env.AUTOCONF_WITH_VERSION }}.tar.gz
71-
${{ env.BISON_WITH_VERSION }}.tar.gz
72-
key: ${{ env.AUTOCONF_WITH_VERSION }}_${{ env.BISON_WITH_VERSION }}
73-
74143
- name: Check if build is running from origin repo
75144
if: ${{ success() && env.AWS_ACCESS_KEY_ID != 0 && env.AWS_SECRET_ACCESS_KEY != 0 }}
76145
run: |
@@ -89,7 +158,7 @@ jobs:
89158
- name: Install dependencies
90159
run: |
91160
apt-get update
92-
apt-get install -y autopoint make build-essential m4 pkg-config autoconf autoconf-archive libtool git python3 python3-distutils python3-jinja2 python3-venv curl zip unzip tar bison p7zip-full dbus flex
161+
apt-get install -y autopoint make build-essential m4 pkg-config autoconf autoconf-archive libtool git curl zip unzip tar p7zip-full dbus flex
93162
94163
- name: Install dependencies for arm64
95164
if: matrix.arch == 'arm64'
@@ -101,32 +170,43 @@ jobs:
101170
run: |
102171
apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
103172
173+
- name: Download prepared dependencies
174+
if: success()
175+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
176+
with:
177+
name: build-deps_${{ github.event.pull_request.head.sha }}
178+
179+
- name: Extract prepared dependencies
180+
if: success()
181+
run: |
182+
tar -xvzpf build-deps_${{ github.event.pull_request.head.sha }}.tar.gz
183+
104184
- name: Install updated version of autoconf
105185
run: |
106-
if [ ! -f ${{ env.AUTOCONF_WITH_VERSION }}.tar.gz ]; then
107-
curl https://ftp.gnu.org/gnu/autoconf/${{ env.AUTOCONF_WITH_VERSION }}.tar.gz -o ${{ env.AUTOCONF_WITH_VERSION }}.tar.gz
108-
fi
109-
tar -xzf ${{ env.AUTOCONF_WITH_VERSION }}.tar.gz
110186
cd ${{ env.AUTOCONF_WITH_VERSION }}
111-
./configure --prefix=/usr
112-
make -j $(nproc --all)
113187
make install
114188
cd ..
115189
autoconf --version
116190
117191
- name: Install updated version of bison
118192
run: |
119-
if [ ! -f ${{ env.BISON_WITH_VERSION }}.tar.gz ]; then
120-
curl https://ftp.gnu.org/gnu/bison/${{ env.BISON_WITH_VERSION }}.tar.gz -o ${{ env.BISON_WITH_VERSION }}.tar.gz
121-
fi
122-
tar -xzf ${{ env.BISON_WITH_VERSION }}.tar.gz
123193
cd ${{ env.BISON_WITH_VERSION }}
124-
./configure --prefix=/usr
125-
make -j $(nproc --all)
126194
make install
127195
cd ..
128196
bison --version
129197
198+
- name: Install updated version of python
199+
run: |
200+
cd Python-${{ env.PYTHON_VERSION }}
201+
make install
202+
cd ..
203+
python3 --version
204+
205+
- name: Install python dependencies
206+
run: |
207+
python3 -m pip install --upgrade pip
208+
python3 -m pip install jinja2
209+
130210
- name: Install aws cli tool
131211
run: |
132212
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/src/basic/memory-util.h b/src/basic/memory-util.h
2+
index 1179513..fc39e06 100644
3+
--- a/src/basic/memory-util.h
4+
+++ b/src/basic/memory-util.h
5+
@@ -41,7 +41,9 @@ static inline int memcmp_safe(const void *s1, const void *s2, size_t n) {
6+
return 0;
7+
assert(s1);
8+
assert(s2);
9+
+DISABLE_WARNING_NONNULL
10+
return memcmp(s1, s2, n);
11+
+REENABLE_WARNING
12+
}
13+
14+
/* Compare s1 (length n1) with s2 (length n2) in lexicographic order. */
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git a/meson.build b/meson.build
2+
index 3d50c83..802de14 100644
3+
--- a/meson.build
4+
+++ b/meson.build
5+
@@ -371,6 +371,8 @@ possible_common_cc_flags = [
6+
'-Warray-bounds=2',
7+
'-Wdate-time',
8+
'-Wendif-labels',
9+
+]
10+
+vcpkg_omit_werror = [
11+
'-Werror=bool-compare',
12+
'-Werror=discarded-qualifiers',
13+
'-Werror=flex-array-member-not-at-end',
14+
@@ -392,6 +394,8 @@ possible_common_cc_flags = [
15+
'-Werror=shift-overflow=2',
16+
'-Werror=strict-flex-arrays',
17+
'-Werror=undef',
18+
+]
19+
+possible_common_cc_flags += [
20+
'-Wfloat-equal',
21+
# gperf prevents us from enabling this because it does not emit fallthrough
22+
# attribute with clang.
23+
@@ -511,19 +515,6 @@ add_project_link_arguments(
24+
userspace_c_args += cc.get_supported_arguments(possible_cc_flags)
25+
userspace_c_ld_args += cc.get_supported_link_arguments(possible_link_flags)
26+
27+
-if cc.compiles('''
28+
- #include <time.h>
29+
- #include <inttypes.h>
30+
- typedef uint64_t usec_t;
31+
- usec_t now(clockid_t clock);
32+
- int main(void) {
33+
- struct timespec now;
34+
- return 0;
35+
- }
36+
-''', args: '-Werror=shadow', name : '-Werror=shadow with local shadowing')
37+
- add_project_arguments('-Werror=shadow', language : 'c')
38+
-endif
39+
-
40+
if cxx_cmd != ''
41+
add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp')
42+
endif

0 commit comments

Comments
 (0)