Skip to content

Commit cedd340

Browse files
authored
Work around test failure in Julia nightly (#359)
* Work around test failure in Julia nightly * [CI] Cancel jobs if there are newer commits
1 parent da2a941 commit cedd340

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
pull_request:
88
release:
99

10+
concurrency:
11+
# Skip intermediate builds: always.
12+
# Cancel intermediate builds: always.
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1016
env:
1117
BINARYBUILDER_AUTOMATIC_APPLE: true
1218

test/dependencies.jl

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ function with_temp_project(f::Function)
2020
end
2121
end
2222

23+
function test_setup_dependencies(prefix, dependencies, platform)
24+
if VERSION >= v"1.11.0-"
25+
# A warning is issued in Julia v1.11:
26+
# <https://github.com/JuliaPackaging/BinaryBuilderBase.jl/issues/358>.
27+
setup_dependencies(prefix, dependencies, platform)
28+
else
29+
@test_logs setup_dependencies(prefix, dependencies, platform)
30+
end
31+
end
32+
2333
@testset "Dependencies" begin
2434
name = "Foo_jll"
2535
dep = Dependency(PackageSpec(; name = name); platforms=supported_platforms(; experimental=true, exclude=!Sys.isapple))
@@ -167,7 +177,7 @@ end
167177
Dependency("Zlib_jll")
168178
]
169179
platform = HostPlatform()
170-
ap = @test_logs setup_dependencies(prefix, getpkg.(dependencies), platform)
180+
ap = test_setup_dependencies(prefix, getpkg.(dependencies), platform)
171181
@test "libz." * platform_dlext(platform) in readdir(last(libdirs(Prefix(destdir(dir, platform)))))
172182
@test sort!(readdir(joinpath(destdir(dir, platform), "include"))) == ["zconf.h", "zlib.h"]
173183

@@ -202,7 +212,7 @@ end
202212
Dependency("LibCURL_jll")
203213
]
204214
platform = HostPlatform()
205-
ap = @test_logs setup_dependencies(prefix, getpkg.(dependencies), platform)
215+
ap = test_setup_dependencies(prefix, getpkg.(dependencies), platform)
206216
@test "libcurl." * platform_dlext(platform) in readdir(last(libdirs(Prefix(destdir(dir, platform)))))
207217
@test "curl.h" in readdir(joinpath(destdir(dir, platform), "include", "curl"))
208218
@test "libssh2." * platform_dlext(platform) in readdir(last(libdirs(Prefix(destdir(dir, platform)))))
@@ -225,7 +235,9 @@ end
225235
Dependency("LibOSXUnwind_jll")
226236
]
227237
platform = Platform("i686", "linux"; libc="musl")
228-
@test_logs (:warn, r"Dependency LibOSXUnwind_jll does not have a mapping for artifact LibOSXUnwind for platform i686-linux-musl") begin
238+
# `match_mode=:any` is a workaround for
239+
# <https://github.com/JuliaPackaging/BinaryBuilderBase.jl/issues/358>.
240+
@test_logs (:warn, r"Dependency LibOSXUnwind_jll does not have a mapping for artifact LibOSXUnwind for platform i686-linux-musl") match_mode=(VERSION >= v"1.11.0-" ? :any : :all) begin
229241
setup_dependencies(prefix, getpkg.(dependencies), platform)
230242
end
231243
@test "destdir" readdir(dirname(destdir(dir, platform)))
@@ -238,7 +250,7 @@ end
238250
platform = Platform("x86_64", "linux"; julia_version=v"1.5")
239251

240252
# Test that a particular version of GMP is installed
241-
@test @test_logs !isempty(setup_dependencies(prefix, getpkg.(dependencies), platform))
253+
@test !isempty(test_setup_dependencies(prefix, getpkg.(dependencies), platform))
242254
@test isfile(joinpath(destdir(dir, platform), "lib", "libgmp.so.10.3.2"))
243255
end
244256

@@ -249,7 +261,7 @@ end
249261
platform = Platform("x86_64", "linux"; julia_version=v"1.6")
250262

251263
# Test that a particular version of GMP is installed
252-
@test_logs setup_dependencies(prefix, getpkg.(dependencies), platform)
264+
test_setup_dependencies(prefix, getpkg.(dependencies), platform)
253265
@test isfile(joinpath(destdir(dir, platform), "lib", "libgmp.so.10.4.0"))
254266
end
255267

@@ -269,7 +281,7 @@ end
269281

270282
# If we don't give a `julia_version`, then we are FULLY UNSHACKLED.
271283
platform = Platform("x86_64", "linux")
272-
@test_logs setup_dependencies(prefix, getpkg.(dependencies), platform)
284+
test_setup_dependencies(prefix, getpkg.(dependencies), platform)
273285
@test isfile(joinpath(destdir(dir, platform), "lib", "libgmp.so.10.3.2"))
274286
@test isfile(joinpath(destdir(dir, platform), "lib", "libmpfr.so.6.1.0"))
275287
end
@@ -296,7 +308,7 @@ end
296308
),
297309
]
298310
platform = Platform("x86_64", "linux"; libc="glibc")
299-
@test_logs setup_dependencies(prefix, dependencies, platform)
311+
test_setup_dependencies(prefix, dependencies, platform)
300312
@test readdir(joinpath(destdir(dir, platform), "bin")) == ["hello_world"]
301313
end
302314
end
@@ -314,7 +326,7 @@ end
314326
),
315327
]
316328
platform = Platform("x86_64", "linux"; libc="glibc")
317-
@test_logs setup_dependencies(prefix, dependencies, platform)
329+
test_setup_dependencies(prefix, dependencies, platform)
318330
@test readdir(joinpath(destdir(dir, platform), "bin")) == ["hello_world"]
319331
end
320332

@@ -325,7 +337,7 @@ end
325337
get_addable_spec("Zlib_jll", v"1.2.12+4")
326338
]
327339
platform = Platform("x86_64", "linux")
328-
@test_logs setup_dependencies(prefix, dependencies, platform)
340+
test_setup_dependencies(prefix, dependencies, platform)
329341
readmeta(joinpath(destdir(dir, platform), "lib", "libz.so")) do oh
330342
symbols = symbol_name.(Symbols(oh))
331343
# The platform didn't specify the sanitizer, the library shouldn't contain
@@ -341,7 +353,7 @@ end
341353
get_addable_spec("Zlib_jll", v"1.2.12+4")
342354
]
343355
platform = Platform("x86_64", "linux"; sanitize="memory")
344-
@test_logs setup_dependencies(prefix, dependencies, platform)
356+
test_setup_dependencies(prefix, dependencies, platform)
345357
readmeta(joinpath(destdir(dir, platform), "lib", "libz.so")) do oh
346358
symbols = symbol_name.(Symbols(oh))
347359
# Make sure the library contains only "msan" symbols

0 commit comments

Comments
 (0)