File: semaphore-run

package info (click to toggle)
casync 2%2B20201210-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,952 kB
  • sloc: ansic: 31,284; sh: 423; python: 69; makefile: 6
file content (103 lines) | stat: -rwxr-xr-x 2,235 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1+

DEVPKGS=(
    pkg-config
    liblzma-dev
    libcurl4-openssl-dev
    libssl-dev
    libacl1-dev
    libfuse-dev
    zlib1g-dev
    libzstd-dev
    libudev-dev
)

echo
echo "============= Installing amd64 build dependencies =============="
set -eu
(
    set -x

    sudo rm /etc/apt/sources.list.d/*

    sudo apt install -y software-properties-common
    sudo add-apt-repository -y ppa:jonathonf/python-3.6
    sudo add-apt-repository -y ppa:ginggs/backports
    sudo apt -y update
    sudo apt -y --no-install-recommends install \
         python3.6 \
         squashfs-tools

    sudo dpkg --add-architecture i386
    sudo apt-get update

    sudo apt -y --no-install-recommends install \
         rsync \
         python3-pip \
         python3-setuptools \
         python3-wheel \
         python-sphinx \
         "${DEVPKGS[@]}"
    python3.6 -m pip install --user meson ninja
)

echo
echo "============= Building amd64 =============="
(
    set -x
    meson build
    ninja -C build
)

echo
echo "============= Running amd64 tests as user =============="
(
    set -x
    ninja -C build test
)

echo
echo "============= Running amd64 tests as root =============="
(
    set -x
    sudo CASYNC_TEST_NBD=0 $(which ninja) -C build test
)

echo
echo "============= Installing i386 build dependencies =============="

# library -dev packages are not co-installable for multiple architectures,
# so this can't go into the setup step
(
    set -x
    # both arch versions provide /usr/bin/curl-config, which can't go well
    sudo apt remove -y libcurl4-openssl-dev
    sudo apt-get install -y --no-install-recommends \
         gcc-multilib \
         libgcc-5-dev:i386 \
         "${DEVPKGS[@]/%/:i386}"
)

echo
echo "============= Building i386 =============="
(
    set -x
    export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu
    CC=gcc-5 CFLAGS=-m32 LDFLAGS=-m32 meson build-i386
    ninja -C build-i386
)

echo
echo "============= Running i386 tests as user =============="
(
    set -x
    linux32 ninja -C build-i386 test
)

echo
echo "============= Running i386 tests as root =============="
(
    set -x
    sudo CASYNC_TEST_NBD=0 linux32 $(which ninja) -C build-i386 test
)