diff --git a/src/Products.jl b/src/Products.jl index 12e3b012..6c826743 100644 --- a/src/Products.jl +++ b/src/Products.jl @@ -494,6 +494,8 @@ function locate(fp::FileProduct, prefix::Prefix; platform::AbstractPlatform = Ho end # Necessary to get the products in the wrappers always sorted consistently +Base.isless(x::LibraryProduct, y::ExecutableProduct) = true +Base.isless(x::ExecutableProduct, y::LibraryProduct) = false Base.isless(x::Product, y::Product) = isless(variable_name(x), variable_name(y)) Base.sort(d::Dict{Product}) = sort(collect(d), by = first) diff --git a/test/products.jl b/test/products.jl index 95c81ed4..57cc3889 100644 --- a/test/products.jl +++ b/test/products.jl @@ -25,12 +25,12 @@ const platform = HostPlatform() # Test sorting of products.... @test sort([LibraryProduct("libbar", :libbar), ExecutableProduct("foo", :foo), FrameworkProduct("buzz", :buzz)]) == - [FrameworkProduct("buzz", :buzz), ExecutableProduct("foo", :foo), LibraryProduct("libbar", :libbar)] + [FrameworkProduct("buzz", :buzz), LibraryProduct("libbar", :libbar), ExecutableProduct("foo", :foo)] # ...and products info p1 = LibraryProduct(["libchafa"], :libchafa, ) => Dict("soname" => "libchafa.so.0","path" => "lib/libchafa.so") p2 = ExecutableProduct(["chafa"], :chafa, ) => Dict("path" => "bin/chafa") products_info = Dict{Product,Any}(p1, p2) - @test sort(products_info) == [p2, p1] + @test sort(products_info) == [p1, p2] temp_prefix() do prefix # Test that basic satisfication is not guaranteed