-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathxde.sh
More file actions
executable file
·148 lines (124 loc) · 3.91 KB
/
xde.sh
File metadata and controls
executable file
·148 lines (124 loc) · 3.91 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/bin/bash
#:
#: name = "opte-xde"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = true
#: output_rules = [
#: "=/work/debug/xde.dbg",
#: "=/work/debug/xde.dbg.sha256",
#: "=/work/debug/xde_link.dbg.so",
#: "=/work/debug/xde_link.dbg.so.sha256",
#: "=/work/release/xde",
#: "=/work/release/xde.sha256",
#: "=/work/release/xde_link.so",
#: "=/work/release/xde_link.so.sha256",
#: "=/work/test/loopback",
#: "=/work/test/multicast_rx",
#: "=/work/test/multicast_multi_sub",
#: "=/work/test/multicast_validation",
#: "=/work/test/multicast_source_filter",
#: "=/work/xde.conf",
#: ]
#:
#: [[publish]]
#: series = "module"
#: name = "xde"
#: from_output = "/work/release/xde"
#:
#: [[publish]]
#: series = "module"
#: name = "xde.sha256"
#: from_output = "/work/release/xde.sha256"
set -o errexit
set -o pipefail
set -o xtrace
source .github/buildomat/common.sh
#
# TGT_BASE allows one to run this more easily in their local
# environment:
#
# TGT_BASE=/var/tmp ./xde.sh
#
TGT_BASE=${TGT_BASE:=/work}
DBG_SRC=target/x86_64-unknown-unknown/debug
DBG_LINK_SRC=target/i686-unknown-illumos/debug
DBG_TGT=$TGT_BASE/debug
REL_SRC=target/x86_64-unknown-unknown/release-lto
REL_LINK_SRC=target/i686-unknown-illumos/release
REL_TGT=$TGT_BASE/release
mkdir -p $DBG_TGT $REL_TGT
cargo --version
rustc --version
install_pkg jq
pushd xde
cp xde.conf /work/xde.conf
header "check style"
ptime -m cargo +$NIGHTLY fmt -p xde -p xde-link -- --check
header "analyze"
ptime -m cargo clippy -- \
--allow clippy::uninlined-format-args --allow clippy::bad_bit_mask
pushd xde-link
ptime -m cargo clippy -- \
--allow clippy::uninlined-format-args --allow clippy::bad_bit_mask
popd
popd
header "build xde (debug)"
ptime -m cargo xtask build --profile debug xde xde-link
header "build xde (release)"
ptime -m cargo xtask build --profile release xde xde-link
#
# Inspect the kernel module for bad relocations in case the old
# codegen issue ever shows its face again.
#
if elfdump $DBG_SRC/xde.dbg | grep GOTPCREL; then
echo "found GOTPCREL relocation in debug build"
exit 1
fi
if elfdump $REL_SRC/xde | grep GOTPCREL; then
echo "found GOTPCREL relocation in release build"
exit 1
fi
cp $DBG_SRC/xde.dbg $DBG_TGT/
sha256sum $DBG_TGT/xde.dbg > $DBG_TGT/xde.dbg.sha256
cp $DBG_LINK_SRC/libxde_link.so $DBG_TGT/xde_link.dbg.so
sha256sum $DBG_TGT/xde_link.dbg.so > $DBG_TGT/xde_link.dbg.so.sha256
cp $REL_SRC/xde $REL_TGT/
sha256sum $REL_TGT/xde > $REL_TGT/xde.sha256
cp $REL_LINK_SRC/libxde_link.so $REL_TGT/xde_link.so
sha256sum $REL_TGT/xde_link.so > $REL_TGT/xde_link.so.sha256
header "build xde integration tests"
pushd xde-tests
cargo +$NIGHTLY fmt -- --check
cargo clippy --all-targets -- --deny warnings
cargo build --test loopback
loopback_test=$(
cargo build -q --test loopback --message-format=json |\
jq -r "select(.profile.test == true) | .filenames[]"
)
cargo build --test multicast_rx
multicast_rx_test=$(
cargo build -q --test multicast_rx --message-format=json |\
jq -r "select(.profile.test == true) | .filenames[]"
)
cargo build --test multicast_multi_sub
multicast_multi_sub_test=$(
cargo build -q --test multicast_multi_sub --message-format=json |\
jq -r "select(.profile.test == true) | .filenames[]"
)
cargo build --test multicast_validation
multicast_validation_test=$(
cargo build -q --test multicast_validation --message-format=json |\
jq -r "select(.profile.test == true) | .filenames[]"
)
cargo build --test multicast_source_filter
multicast_source_filter_test=$(
cargo build -q --test multicast_source_filter --message-format=json |\
jq -r "select(.profile.test == true) | .filenames[]"
)
mkdir -p /work/test
cp $loopback_test /work/test/loopback
cp $multicast_rx_test /work/test/multicast_rx
cp $multicast_multi_sub_test /work/test/multicast_multi_sub
cp $multicast_validation_test /work/test/multicast_validation
cp $multicast_source_filter_test /work/test/multicast_source_filter