Skip to content

Commit aef1908

Browse files
committed
Distinguish between with-sanitizer and without-sanitizer dependencies
1 parent 3fa89b9 commit aef1908

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Dependencies.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,10 @@ getname(x::AbstractDependency) = getname(getpkg(x))
267267
filter_platforms(deps::AbstractVector{<:AbstractDependency}, p::AbstractPlatform)
268268
269269
Filter the dependencies `deps` which are compatible with platform `p`.
270+
Here "compatible" includes whether and which sanitizer is enabled.
270271
"""
271272
filter_platforms(deps::AbstractVector{<:AbstractDependency}, p::AbstractPlatform) =
272-
[dep for dep in deps if any(x -> platforms_match(x, p), dep.platforms)]
273+
[dep for dep in deps if any(x -> platforms_match_with_sanitize(x, p), dep.platforms)]
273274

274275
# Wrapper around `Pkg.Types.registry_resolve!` which keeps the type of the
275276
# dependencies. TODO: improve this

test/dependencies.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,13 @@ end
120120
top_level_dep = RuntimeDependency(PackageSpec(; name = top_level_name); top_level=true)
121121
@test is_top_level_dependency(top_level_dep)
122122

123+
dep_no_sanitizer = Platform("x86_64", "linux")
124+
dep_with_sanitizer = Platform("x86_64", "linux"; sanitizer="memory")
123125
@testset "Filter dependencies by platform" begin
124126
@test filter_platforms([dep, dep_buildver, dep_compat], Platform("x86_64", "linux"; cxxstring_abi="cxx03")) == [dep_compat]
125127
@test filter_platforms([dep, dep_buildver, dep_compat], Platform("x86_64", "macos")) == [dep, dep_compat]
128+
@test filter_platforms([dep_no_sanitizer, dep_with_sanitizer], dep_no_sanitizer == [dep_no_sanitizer])
129+
@test filter_platforms([dep_no_sanitizer, dep_with_sanitizer], dep_with_sanitizer == [dep_with_sanitizer])
126130
end
127131

128132
@testset "JSON (de)serialization" begin

0 commit comments

Comments
 (0)