-
-
Notifications
You must be signed in to change notification settings - Fork 2
295 lines (294 loc) · 16.8 KB
/
build.yaml
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# This file was generated by running ./generate-actions.py - it should not be manually modified
name: PR
'on':
pull_request: null
workflow_dispatch: null
jobs:
unknown-linux-gnu-x86_64-x86_64:
runs-on: ubuntu-latest
container: centos:centos8
steps:
- name: Checkout repo
uses: actions/checkout@v3
- run: sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*
- run: sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g'
/etc/yum.repos.d/CentOS-*
- run: yum install -y bzip2 git make patch wget
- run: dnf group install -y "Development Tools"
- run: ln -s /usr/bin/tar /usr/bin/gnutar
- name: Build musl
run: ./build.sh x86_64
- name: Upload musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl.tar.gz
uses: actions/upload-artifact@v3
with:
name: musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl.tar.gz
path: output/musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl.tar.gz
if-no-files-found: error
unknown-linux-gnu-x86_64-x86_64-test-build:
runs-on: ubuntu-latest
container: centos:centos8
needs:
- unknown-linux-gnu-x86_64-x86_64
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl.tar.gz
uses: actions/download-artifact@v3
with:
name: musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl.tar.gz
path: .
- name: Download bazelisk as bazel
run: curl --fail -L -o /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64
&& chmod 0755 /usr/local/bin/bazel
- name: Generate builder workspace file
run: "cat >test-workspaces/builder/WORKSPACE.bazel <<EOF\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\"\
, \"http_archive\")\n\nhttp_archive(\n name = \"musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl\"\
,\n sha256 = \"$(sha256sum musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl.tar.gz\
\ | awk '{print $1}')\",\n url = \"file://$(pwd)/musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl.tar.gz\"\
,\n)\n\nEOF\n"
- name: Generate builder workspace config BUILD.bazel file
run: "mkdir -p test-workspaces/builder/config && cat >test-workspaces/builder/config/BUILD.bazel\
\ <<EOF\ntoolchain(\n name = \"musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl\"\
,\n exec_compatible_with = [\n \"@platforms//cpu:x86_64\",\n \
\ \"@platforms//os:linux\",\n ],\n target_compatible_with = [\n\
\ \"@platforms//cpu:x86_64\",\n \"@platforms//os:linux\",\n\
\ ],\n toolchain = \"@musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:toolchain_type\",\n)\ntoolchain(\n\
\ name = \"musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl_test_toolchain\"\
,\n exec_compatible_with = [\n \"@platforms//cpu:x86_64\",\n \
\ \"@platforms//os:linux\",\n ],\n target_compatible_with = [\n\
\ \"@platforms//cpu:x86_64\",\n \"@platforms//os:linux\",\n\
\ ],\n toolchain = \"@musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl//:musl-1_2_3-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl_test_toolchain\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:test_runner_toolchain_type\"\
,\n)\n\nplatform(\n name = \"platform\",\n constraint_values = [\n \
\ \"@platforms//cpu:x86_64\",\n \"@platforms//os:linux\",\n \
\ ],\n)\n\nEOF\n"
- name: Test with musl
run: cd test-workspaces/builder && bazel test //:test
- name: Test with musl (static linking)
run: cd test-workspaces/builder && bazel test //:test --dynamic_mode=off
- name: Build with musl
run: cd test-workspaces/builder && bazel build //:binary
- name: Move test binary
run: mkdir output && cp test-workspaces/builder/bazel-bin/binary output/test-binary-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl
- name: Upload test-binary-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl
uses: actions/upload-artifact@v3
with:
name: test-binary-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl
path: output/test-binary-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl
if-no-files-found: error
apple-darwin-x86_64-x86_64:
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v3
- run: brew install wget md5sha1sum gnu-tar
- name: Build musl
run: ./build.sh x86_64
- name: Upload musl-1.2.3-platform-x86_64-apple-darwin-target-x86_64-linux-musl.tar.gz
uses: actions/upload-artifact@v3
with:
name: musl-1.2.3-platform-x86_64-apple-darwin-target-x86_64-linux-musl.tar.gz
path: output/musl-1.2.3-platform-x86_64-apple-darwin-target-x86_64-linux-musl.tar.gz
if-no-files-found: error
apple-darwin-x86_64-x86_64-test-build:
runs-on: macos-12
needs:
- apple-darwin-x86_64-x86_64
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download musl-1.2.3-platform-x86_64-apple-darwin-target-x86_64-linux-musl.tar.gz
uses: actions/download-artifact@v3
with:
name: musl-1.2.3-platform-x86_64-apple-darwin-target-x86_64-linux-musl.tar.gz
path: .
- name: Skipping downloading bazelisk - already installed
run: bazel --version
- name: Generate builder workspace file
run: "cat >test-workspaces/builder/WORKSPACE.bazel <<EOF\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\"\
, \"http_archive\")\n\nhttp_archive(\n name = \"musl-1_2_3-platform-x86_64-apple-darwin-target-x86_64-linux-musl\"\
,\n sha256 = \"$(shasum -a 256 musl-1.2.3-platform-x86_64-apple-darwin-target-x86_64-linux-musl.tar.gz\
\ | awk '{print $1}')\",\n url = \"file://$(pwd)/musl-1.2.3-platform-x86_64-apple-darwin-target-x86_64-linux-musl.tar.gz\"\
,\n)\n\nEOF\n"
- name: Generate builder workspace config BUILD.bazel file
run: "mkdir -p test-workspaces/builder/config && cat >test-workspaces/builder/config/BUILD.bazel\
\ <<EOF\ntoolchain(\n name = \"musl-1_2_3-platform-x86_64-apple-darwin-target-x86_64-linux-musl\"\
,\n exec_compatible_with = [\n \"@platforms//cpu:x86_64\",\n \
\ \"@platforms//os:osx\",\n ],\n target_compatible_with = [\n \
\ \"@platforms//cpu:x86_64\",\n \"@platforms//os:linux\",\n \
\ ],\n toolchain = \"@musl-1_2_3-platform-x86_64-apple-darwin-target-x86_64-linux-musl\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:toolchain_type\",\n)\ntoolchain(\n\
\ name = \"musl-1_2_3-platform-x86_64-apple-darwin-target-x86_64-linux-musl_test_toolchain\"\
,\n exec_compatible_with = [\n \"@platforms//cpu:x86_64\",\n \
\ \"@platforms//os:linux\",\n ],\n target_compatible_with = [\n\
\ \"@platforms//cpu:x86_64\",\n \"@platforms//os:linux\",\n\
\ ],\n toolchain = \"@musl-1_2_3-platform-x86_64-apple-darwin-target-x86_64-linux-musl//:musl-1_2_3-platform-x86_64-apple-darwin-target-x86_64-linux-musl_test_toolchain\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:test_runner_toolchain_type\"\
,\n)\n\nplatform(\n name = \"platform\",\n constraint_values = [\n \
\ \"@platforms//cpu:x86_64\",\n \"@platforms//os:linux\",\n \
\ ],\n)\n\nEOF\n"
- name: Test with musl
run: cd test-workspaces/builder && bazel test //:test
- name: Test with musl (static linking)
run: cd test-workspaces/builder && bazel test //:test --dynamic_mode=off
- name: Build with musl
run: cd test-workspaces/builder && bazel build //:binary
- name: Move test binary
run: mkdir output && cp test-workspaces/builder/bazel-bin/binary output/test-binary-platform-x86_64-apple-darwin-target-x86_64-linux-musl
- name: Upload test-binary-platform-x86_64-apple-darwin-target-x86_64-linux-musl
uses: actions/upload-artifact@v3
with:
name: test-binary-platform-x86_64-apple-darwin-target-x86_64-linux-musl
path: output/test-binary-platform-x86_64-apple-darwin-target-x86_64-linux-musl
if-no-files-found: error
apple-darwin-aarch64-x86_64:
runs-on: macos-14
steps:
- name: Checkout repo
uses: actions/checkout@v3
- run: brew install wget md5sha1sum gnu-tar
- name: Build musl
run: ./build.sh x86_64
- name: Upload musl-1.2.3-platform-aarch64-apple-darwin-target-x86_64-linux-musl.tar.gz
uses: actions/upload-artifact@v3
with:
name: musl-1.2.3-platform-aarch64-apple-darwin-target-x86_64-linux-musl.tar.gz
path: output/musl-1.2.3-platform-aarch64-apple-darwin-target-x86_64-linux-musl.tar.gz
if-no-files-found: error
apple-darwin-aarch64-x86_64-test-build:
runs-on: macos-14
needs:
- apple-darwin-aarch64-x86_64
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download musl-1.2.3-platform-aarch64-apple-darwin-target-x86_64-linux-musl.tar.gz
uses: actions/download-artifact@v3
with:
name: musl-1.2.3-platform-aarch64-apple-darwin-target-x86_64-linux-musl.tar.gz
path: .
- name: Skipping downloading bazelisk - already installed
run: bazel --version
- name: Generate builder workspace file
run: "cat >test-workspaces/builder/WORKSPACE.bazel <<EOF\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\"\
, \"http_archive\")\n\nhttp_archive(\n name = \"musl-1_2_3-platform-aarch64-apple-darwin-target-x86_64-linux-musl\"\
,\n sha256 = \"$(shasum -a 256 musl-1.2.3-platform-aarch64-apple-darwin-target-x86_64-linux-musl.tar.gz\
\ | awk '{print $1}')\",\n url = \"file://$(pwd)/musl-1.2.3-platform-aarch64-apple-darwin-target-x86_64-linux-musl.tar.gz\"\
,\n)\n\nEOF\n"
- name: Generate builder workspace config BUILD.bazel file
run: "mkdir -p test-workspaces/builder/config && cat >test-workspaces/builder/config/BUILD.bazel\
\ <<EOF\ntoolchain(\n name = \"musl-1_2_3-platform-aarch64-apple-darwin-target-x86_64-linux-musl\"\
,\n exec_compatible_with = [\n \"@platforms//cpu:arm64\",\n \
\ \"@platforms//os:osx\",\n ],\n target_compatible_with = [\n \
\ \"@platforms//cpu:x86_64\",\n \"@platforms//os:linux\",\n \
\ ],\n toolchain = \"@musl-1_2_3-platform-aarch64-apple-darwin-target-x86_64-linux-musl\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:toolchain_type\",\n)\ntoolchain(\n\
\ name = \"musl-1_2_3-platform-aarch64-apple-darwin-target-x86_64-linux-musl_test_toolchain\"\
,\n exec_compatible_with = [\n \"@platforms//cpu:x86_64\",\n \
\ \"@platforms//os:linux\",\n ],\n target_compatible_with = [\n\
\ \"@platforms//cpu:x86_64\",\n \"@platforms//os:linux\",\n\
\ ],\n toolchain = \"@musl-1_2_3-platform-aarch64-apple-darwin-target-x86_64-linux-musl//:musl-1_2_3-platform-aarch64-apple-darwin-target-x86_64-linux-musl_test_toolchain\"\
,\n toolchain_type = \"@bazel_tools//tools/cpp:test_runner_toolchain_type\"\
,\n)\n\nplatform(\n name = \"platform\",\n constraint_values = [\n \
\ \"@platforms//cpu:x86_64\",\n \"@platforms//os:linux\",\n \
\ ],\n)\n\nEOF\n"
- name: Build with musl
run: cd test-workspaces/builder && bazel build //:binary
- name: Move test binary
run: mkdir output && cp test-workspaces/builder/bazel-bin/binary output/test-binary-platform-aarch64-apple-darwin-target-x86_64-linux-musl
- name: Upload test-binary-platform-aarch64-apple-darwin-target-x86_64-linux-musl
uses: actions/upload-artifact@v3
with:
name: test-binary-platform-aarch64-apple-darwin-target-x86_64-linux-musl
path: output/test-binary-platform-aarch64-apple-darwin-target-x86_64-linux-musl
if-no-files-found: error
test-x86_64:
runs-on: ubuntu-latest
container: centos:centos8
needs:
- unknown-linux-gnu-x86_64-x86_64-test-build
- apple-darwin-x86_64-x86_64-test-build
- apple-darwin-aarch64-x86_64-test-build
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download test-binary-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl
uses: actions/download-artifact@v3
with:
name: test-binary-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl
path: .
- name: Download test-binary-platform-x86_64-apple-darwin-target-x86_64-linux-musl
uses: actions/download-artifact@v3
with:
name: test-binary-platform-x86_64-apple-darwin-target-x86_64-linux-musl
path: .
- name: Download test-binary-platform-aarch64-apple-darwin-target-x86_64-linux-musl
uses: actions/download-artifact@v3
with:
name: test-binary-platform-aarch64-apple-darwin-target-x86_64-linux-musl
path: .
- name: Download bazelisk as bazel
run: curl --fail -L -o /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64
&& chmod 0755 /usr/local/bin/bazel
- name: Generate tester workspace file
run: "cat >test-workspaces/tester/WORKSPACE.bazel <<EOF\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\"\
, \"http_file\")\n\nhttp_file(\n name = \"built_binary_x86_64-unknown-linux-gnu\"\
,\n executable = True,\n sha256 = \"$(sha256sum test-binary-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl\
\ | awk '{print $1}')\",\n url = \"file://$(pwd)/test-binary-platform-x86_64-unknown-linux-gnu-target-x86_64-linux-musl\"\
,\n)\n\nhttp_file(\n name = \"built_binary_x86_64-apple-darwin\",\n \
\ executable = True,\n sha256 = \"$(sha256sum test-binary-platform-x86_64-apple-darwin-target-x86_64-linux-musl\
\ | awk '{print $1}')\",\n url = \"file://$(pwd)/test-binary-platform-x86_64-apple-darwin-target-x86_64-linux-musl\"\
,\n)\n\nhttp_file(\n name = \"built_binary_aarch64-apple-darwin\",\n \
\ executable = True,\n sha256 = \"$(sha256sum test-binary-platform-aarch64-apple-darwin-target-x86_64-linux-musl\
\ | awk '{print $1}')\",\n url = \"file://$(pwd)/test-binary-platform-aarch64-apple-darwin-target-x86_64-linux-musl\"\
,\n)\n\nEOF\n"
- run: cd test-workspaces/tester && CC=/bin/false bazel test ... --test_output=all
unknown-linux-gnu-x86_64-aarch64:
runs-on: ubuntu-latest
container: centos:centos8
steps:
- name: Checkout repo
uses: actions/checkout@v3
- run: sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*
- run: sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g'
/etc/yum.repos.d/CentOS-*
- run: yum install -y bzip2 git make patch wget
- run: dnf group install -y "Development Tools"
- run: ln -s /usr/bin/tar /usr/bin/gnutar
- name: Build musl
run: ./build.sh aarch64
- name: Upload musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl.tar.gz
uses: actions/upload-artifact@v3
with:
name: musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl.tar.gz
path: output/musl-1.2.3-platform-x86_64-unknown-linux-gnu-target-aarch64-linux-musl.tar.gz
if-no-files-found: error
apple-darwin-x86_64-aarch64:
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v3
- run: brew install wget md5sha1sum gnu-tar
- name: Build musl
run: ./build.sh aarch64
- name: Upload musl-1.2.3-platform-x86_64-apple-darwin-target-aarch64-linux-musl.tar.gz
uses: actions/upload-artifact@v3
with:
name: musl-1.2.3-platform-x86_64-apple-darwin-target-aarch64-linux-musl.tar.gz
path: output/musl-1.2.3-platform-x86_64-apple-darwin-target-aarch64-linux-musl.tar.gz
if-no-files-found: error
apple-darwin-aarch64-aarch64:
runs-on: macos-14
steps:
- name: Checkout repo
uses: actions/checkout@v3
- run: brew install wget md5sha1sum gnu-tar
- name: Build musl
run: ./build.sh aarch64
- name: Upload musl-1.2.3-platform-aarch64-apple-darwin-target-aarch64-linux-musl.tar.gz
uses: actions/upload-artifact@v3
with:
name: musl-1.2.3-platform-aarch64-apple-darwin-target-aarch64-linux-musl.tar.gz
path: output/musl-1.2.3-platform-aarch64-apple-darwin-target-aarch64-linux-musl.tar.gz
if-no-files-found: error