Skip to content

Commit c1a0d6a

Browse files
authored
[AutoBuild] Split log files into a separate tarball (#1229)
* [AutoBuild] Split log files into a separate tarball Long term plan is still to do #778, but that's a lot of work, and we have little time at the moment. Simply splitting the logs into a separate tarball, instead, is a simpler short-term solution which has some very important bonuses: - the git tree hash of the main tarball should be reproducible (as long as you use the same toolchain) - which means we can start testing reproducibility of builds - rebuilding a package without changing its content won't create a new artifact: less strain on the Package Storage Server. * [AutoBuild] Filter out logs tarball when rebuilding the package
1 parent c3ab910 commit c1a0d6a

File tree

4 files changed

+86
-22
lines changed

4 files changed

+86
-22
lines changed

Manifest.toml

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.7.3"
3+
julia_version = "1.8.1"
44
manifest_format = "2.0"
5+
project_hash = "f35810f1518b3c855e1d8ed4f1522241fc6dcb7a"
56

67
[[deps.ArgParse]]
78
deps = ["Logging", "TextWrap"]
@@ -11,6 +12,7 @@ version = "1.1.4"
1112

1213
[[deps.ArgTools]]
1314
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
15+
version = "1.1.1"
1416

1517
[[deps.Artifacts]]
1618
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
@@ -31,11 +33,11 @@ uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
3133

3234
[[deps.BinaryBuilderBase]]
3335
deps = ["CodecZlib", "Downloads", "InteractiveUtils", "JSON", "LibGit2", "LibGit2_jll", "Libdl", "Logging", "OrderedCollections", "OutputCollectors", "Pkg", "ProgressMeter", "Random", "SHA", "Scratch", "SimpleBufferStream", "TOML", "Tar", "UUIDs", "p7zip_jll", "pigz_jll"]
34-
git-tree-sha1 = "4f53be732387e0b07975c968cc114f0824479fe9"
36+
git-tree-sha1 = "9b1c2e9866fdf353f925693d69aa440dec5b4c60"
3537
repo-rev = "master"
3638
repo-url = "https://github.com/JuliaPackaging/BinaryBuilderBase.jl.git"
3739
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
38-
version = "1.13.0"
40+
version = "1.15.0"
3941

4042
[[deps.CodecZlib]]
4143
deps = ["TranscodingStreams", "Zlib_jll"]
@@ -52,6 +54,7 @@ version = "3.46.0"
5254
[[deps.CompilerSupportLibraries_jll]]
5355
deps = ["Artifacts", "Libdl"]
5456
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
57+
version = "0.5.2+0"
5558

5659
[[deps.DataAPI]]
5760
git-tree-sha1 = "fb5f5316dd3fd4c5e7c30a24d50643b73e37cd40"
@@ -76,8 +79,9 @@ deps = ["Random", "Serialization", "Sockets"]
7679
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
7780

7881
[[deps.Downloads]]
79-
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
82+
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
8083
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
84+
version = "1.6.0"
8185

8286
[[deps.ExprTools]]
8387
git-tree-sha1 = "56559bbef6ca5ea0c0818fa5c90320398a6fbf8d"
@@ -107,9 +111,9 @@ version = "5.7.3"
107111

108112
[[deps.HTTP]]
109113
deps = ["Base64", "CodecZlib", "Dates", "IniFile", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"]
110-
git-tree-sha1 = "f0956f8d42a92816d2bf062f8a6a6a0ad7f9b937"
114+
git-tree-sha1 = "59ba44e0aa49b87a8c7a8920ec76f8afe87ed502"
111115
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
112-
version = "1.2.1"
116+
version = "1.3.3"
113117

114118
[[deps.Hiccup]]
115119
deps = ["MacroTools", "Test"]
@@ -133,9 +137,9 @@ version = "1.0.0"
133137

134138
[[deps.JLD2]]
135139
deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "Pkg", "Printf", "Reexport", "TranscodingStreams", "UUIDs"]
136-
git-tree-sha1 = "81b9477b49402b47fbe7f7ae0b252077f53e4a08"
140+
git-tree-sha1 = "6c38bbe47948f74d63434abed68bdfc8d2c46b99"
137141
uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
138-
version = "0.4.22"
142+
version = "0.4.23"
139143

140144
[[deps.JLLWrappers]]
141145
deps = ["Preferences"]
@@ -158,10 +162,12 @@ version = "0.3.4"
158162
[[deps.LibCURL]]
159163
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
160164
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
165+
version = "0.6.3"
161166

162167
[[deps.LibCURL_jll]]
163168
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
164169
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
170+
version = "7.84.0+0"
165171

166172
[[deps.LibGit2]]
167173
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
@@ -170,10 +176,12 @@ uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
170176
[[deps.LibGit2_jll]]
171177
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"]
172178
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
179+
version = "1.3.0+0"
173180

174181
[[deps.LibSSH2_jll]]
175182
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
176183
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
184+
version = "1.10.2+0"
177185

178186
[[deps.Libdl]]
179187
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
@@ -203,13 +211,14 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
203211

204212
[[deps.MbedTLS]]
205213
deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "Random", "Sockets"]
206-
git-tree-sha1 = "d9ab10da9de748859a7780338e1d6566993d1f25"
214+
git-tree-sha1 = "6872f9594ff273da6d13c7c1a1545d5a8c7d0c1c"
207215
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
208-
version = "1.1.3"
216+
version = "1.1.6"
209217

210218
[[deps.MbedTLS_jll]]
211219
deps = ["Artifacts", "Libdl"]
212220
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
221+
version = "2.28.0+0"
213222

214223
[[deps.Mmap]]
215224
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
@@ -222,6 +231,7 @@ version = "0.7.3"
222231

223232
[[deps.MozillaCACerts_jll]]
224233
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
234+
version = "2022.2.1"
225235

226236
[[deps.Mustache]]
227237
deps = ["Printf", "Tables"]
@@ -237,6 +247,7 @@ version = "1.0.0"
237247

238248
[[deps.NetworkOptions]]
239249
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
250+
version = "1.2.0"
240251

241252
[[deps.ObjectFile]]
242253
deps = ["Reexport", "StructIO"]
@@ -247,6 +258,7 @@ version = "0.3.7"
247258
[[deps.OpenBLAS_jll]]
248259
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
249260
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
261+
version = "0.3.20+0"
250262

251263
[[deps.OrderedCollections]]
252264
git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
@@ -260,9 +272,9 @@ version = "0.1.1"
260272

261273
[[deps.Parsers]]
262274
deps = ["Dates"]
263-
git-tree-sha1 = "0044b23da09b5608b4ecacb4e5e6c6332f833a7e"
275+
git-tree-sha1 = "3d5bf43e3e8b412656404ed9466f1dcbf7c50269"
264276
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
265-
version = "2.3.2"
277+
version = "2.4.0"
266278

267279
[[deps.Pidfile]]
268280
deps = ["FileWatching", "Test"]
@@ -273,6 +285,7 @@ version = "1.3.0"
273285
[[deps.Pkg]]
274286
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
275287
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
288+
version = "1.8.0"
276289

277290
[[deps.PkgLicenses]]
278291
deps = ["Test"]
@@ -329,6 +342,7 @@ version = "1.3.0"
329342

330343
[[deps.SHA]]
331344
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
345+
version = "0.7.0"
332346

333347
[[deps.Scratch]]
334348
deps = ["Dates"]
@@ -374,6 +388,7 @@ version = "0.3.0"
374388
[[deps.TOML]]
375389
deps = ["Dates"]
376390
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
391+
version = "1.0.0"
377392

378393
[[deps.TableTraits]]
379394
deps = ["IteratorInterfaceExtensions"]
@@ -383,13 +398,14 @@ version = "1.0.1"
383398

384399
[[deps.Tables]]
385400
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"]
386-
git-tree-sha1 = "5ce79ce186cc678bbb5c5681ca3379d1ddae11a1"
401+
git-tree-sha1 = "7149a60b01bf58787a1b83dad93f90d4b9afbe5d"
387402
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
388-
version = "1.7.0"
403+
version = "1.8.1"
389404

390405
[[deps.Tar]]
391406
deps = ["ArgTools", "SHA"]
392407
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
408+
version = "1.10.0"
393409

394410
[[deps.Test]]
395411
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
@@ -408,9 +424,9 @@ version = "0.3.0"
408424

409425
[[deps.TranscodingStreams]]
410426
deps = ["Random", "Test"]
411-
git-tree-sha1 = "ed5d390c7addb70e90fd1eb783dcb9897922cbfa"
427+
git-tree-sha1 = "8a75929dcd3c38611db2f8d08546decb514fcadf"
412428
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
413-
version = "0.9.8"
429+
version = "0.9.9"
414430

415431
[[deps.URIs]]
416432
git-tree-sha1 = "e59ecc5a41b000fa94423a578d29290c7266fc10"
@@ -439,6 +455,7 @@ version = "4.3.4+0"
439455
[[deps.Zlib_jll]]
440456
deps = ["Libdl"]
441457
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
458+
version = "1.2.12+3"
442459

443460
[[deps.ghr_jll]]
444461
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
@@ -449,6 +466,7 @@ version = "0.14.0+0"
449466
[[deps.libblastrampoline_jll]]
450467
deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
451468
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
469+
version = "5.1.1+0"
452470

453471
[[deps.libsodium_jll]]
454472
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
@@ -459,10 +477,12 @@ version = "1.0.20+0"
459477
[[deps.nghttp2_jll]]
460478
deps = ["Artifacts", "Libdl"]
461479
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
480+
version = "1.48.0+0"
462481

463482
[[deps.p7zip_jll]]
464483
deps = ["Artifacts", "Libdl"]
465484
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
485+
version = "17.4.0+0"
466486

467487
[[deps.pigz_jll]]
468488
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"]

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ghr_jll = "07c12ed4-43bc-5495-8a2a-d5838ef8d533"
3333

3434
[compat]
3535
ArgParse = "1.1"
36-
BinaryBuilderBase = "1.12"
36+
BinaryBuilderBase = "1.15"
3737
GitHub = "5.1"
3838
HTTP = "0.8, 0.9, 1"
3939
JLD2 = "0.1.6, 0.2, 0.3, 0.4"

src/AutoBuild.jl

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ function Base.show(io::IO, t::BuildTimer)
4343
end
4444
end
4545

46+
exclude_logs(_, f) = f != "logs"
47+
only_logs(_, f) = f == "logs"
48+
4649
# Helper function to get the minimum version supported by the given compat
4750
# specification, given as a string.
4851
minimum_compat(compat::String) =
@@ -953,6 +956,18 @@ function autobuild(dir::AbstractString,
953956
platform=platform,
954957
verbose=verbose,
955958
force=true,
959+
# Do not include logs into the main tarball
960+
filter=exclude_logs,
961+
)
962+
# Create another tarball only for the logs
963+
package(
964+
dest_prefix,
965+
joinpath(out_path, src_name * "-logs"),
966+
src_version;
967+
platform=platform,
968+
verbose=verbose,
969+
force=true,
970+
filter=only_logs,
956971
)
957972
timer.end_package = time()
958973

@@ -1112,11 +1127,15 @@ function rebuild_jll_package(name::String, build_version::VersionNumber, sources
11121127
# We're going to recreate "build_output_meta"
11131128
build_output_meta = Dict()
11141129

1130+
# For each platform, we have two tarballs: the main with the full product,
1131+
# and the logs-only one. This function filters out the logs one.
1132+
filter_main_tarball(f, platform) = occursin(".$(triplet(platform)).tar", f) && !occursin("-logs.", f)
1133+
11151134
# Then generate a JLL package for each platform
11161135
downloaded_files = readdir(download_dir)
11171136
for platform in sort(collect(platforms), by = triplet)
11181137
# Find the corresponding tarball:
1119-
tarball_idx = findfirst([occursin(".$(triplet(platform)).tar", f) for f in downloaded_files])
1138+
tarball_idx = findfirst(f -> filter_main_tarball(f, platform), downloaded_files)
11201139

11211140
# No tarball matching the given platform...
11221141
if tarball_idx === nothing
@@ -1126,7 +1145,7 @@ function rebuild_jll_package(name::String, build_version::VersionNumber, sources
11261145
if isos(platform) && os_version(platform) === nothing
11271146
tmp_platform = deepcopy(platform)
11281147
tmp_platform["os_version"] = try_os_version
1129-
tarball_idx = findfirst([occursin(".$(triplet(tmp_platform)).tar", f) for f in downloaded_files])
1148+
tarball_idx = findfirst(f -> filter_main_tarball(f, tmp_platform), downloaded_files)
11301149
end
11311150
end
11321151
end

test/building.jl

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,21 @@ end
180180

181181
@testset "gfortran linking specialty flags" begin
182182
# We test things like linking against libgfortran with `$FC` on a couple of troublesome platforms
183+
expected_git_shas = Dict(
184+
v"4" => Dict(
185+
Platform("x86_64", "linux"; libgfortran_version=v"3") => Base.SHA1("6b705c0ff5760e236ab414fb9a366193f36d3e45"),
186+
Platform("aarch64", "linux"; libgfortran_version=v"3") => Base.SHA1("fb501d0fb03bbf8f034cff50d8d8a1b2956cdf1a"),
187+
),
188+
v"5" => Dict(
189+
Platform("x86_64", "linux"; libgfortran_version=v"3") => Base.SHA1("ef9653f47abba2895b14c1086ba40ad8c64ac098"),
190+
Platform("aarch64", "linux"; libgfortran_version=v"3") => Base.SHA1("ed873d488f47fb8bf5b4b89bb31ed1cad27ee27c"),
191+
),
192+
v"6" => Dict(
193+
Platform("x86_64", "linux"; libgfortran_version=v"3") => Base.SHA1("b3829adf90f6521e4a05f20924506c8358247e06"),
194+
Platform("aarch64", "linux"; libgfortran_version=v"3") => Base.SHA1("641031469413f4fa776c74310098b1b181796720"),
195+
),
196+
)
197+
183198
for gcc_version in (v"4", v"5", v"6")
184199
mktempdir() do build_path
185200
build_output_meta = autobuild(
@@ -210,6 +225,11 @@ end
210225
preferred_gcc_version=gcc_version,
211226
)
212227

228+
for p in (Platform("x86_64", "linux"; libgfortran_version=v"3"), Platform("aarch64", "linux"; libgfortran_version=v"3"))
229+
# Test build reproducibility
230+
@test build_output_meta[p][3] == expected_git_shas[gcc_version][p]
231+
end
232+
213233
# Just a simple test to ensure that it worked.
214234
@test length(keys(build_output_meta)) == 6
215235
end
@@ -218,6 +238,7 @@ end
218238
# Test that building something that links against gfortran suggests depending on CSL
219239
@test_logs (:warn, r"CompilerSupportLibraries_jll") match_mode=:any begin
220240
mktempdir() do build_path
241+
p = Platform("x86_64", "linux"; libgfortran_version=v"3")
221242
build_output_meta = autobuild(
222243
build_path,
223244
"csl_dependency",
@@ -231,10 +252,12 @@ end
231252
# Install fake license just to silence the warning
232253
install_license /usr/share/licenses/libuv/LICENSE
233254
""",
234-
[Platform("x86_64", "linux"; libgfortran_version=v"3")],
255+
[p],
235256
[ExecutableProduct("hello_world_fortran", :hello_world_fortran)],
236257
Dependency[],
237258
)
259+
# Test build reproducibility
260+
@test build_output_meta[p][3] == Base.SHA1("95e005d9b057b3a28af61189b9af5613127416a6")
238261
end
239262
end
240263
end
@@ -319,6 +342,7 @@ end
319342

320343
@testset "AnyPlatform" begin
321344
mktempdir() do build_path
345+
p = AnyPlatform()
322346
build_output_meta = autobuild(
323347
build_path,
324348
"header",
@@ -330,12 +354,13 @@ end
330354
touch ${includedir}/libqux.h
331355
install_license /usr/share/licenses/MIT
332356
""",
333-
[AnyPlatform()],
357+
[p],
334358
[FileProduct("include/libqux.h", :libqux_h)],
335359
# No dependencies
336360
Dependency[]
337361
)
338-
@test haskey(build_output_meta, AnyPlatform())
362+
@test haskey(build_output_meta, p)
363+
@test build_output_meta[p][3] == Base.SHA1("45c55bfed92bd890d6487c58c4c03e07f5fb8829")
339364

340365
# Test that having a LibraryProduct for AnyPlatform raises an error
341366
@test_throws ErrorException autobuild(

0 commit comments

Comments
 (0)