From 797a24d4b37e97376d9d42c5605ae80e6a88c43b Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 7 Dec 2018 21:05:43 +0100 Subject: [PATCH 01/65] Some more compat annotations (#30297) * Compat annotation for unique!(f, A), #30141. Compat annotation for rank(A; rtol=..., atol=...), #29926. * Update stdlib/LinearAlgebra/src/generic.jl (cherry picked from commit 4fc446f1790fe04e227ff96ab75a01d130e2d930) --- base/set.jl | 3 +++ stdlib/LinearAlgebra/src/generic.jl | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/base/set.jl b/base/set.jl index 6afff54d7cf0a..cc2d69c4ca8d7 100644 --- a/base/set.jl +++ b/base/set.jl @@ -184,6 +184,9 @@ end Selects one value from `A` for each unique value produced by `f` applied to elements of `A` , then return the modified A. +!!! compat "Julia 1.1" + This method is available as of Julia 1.1. + # Examples ```jldoctest julia> unique!(x -> x^2, [1, -1, 3, -3, 4]) diff --git a/stdlib/LinearAlgebra/src/generic.jl b/stdlib/LinearAlgebra/src/generic.jl index f124331f450d4..77de34bb84fb9 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -713,7 +713,7 @@ end """ rank(A::AbstractMatrix; atol::Real=0, rtol::Real=atol>0 ? 0 : n*ϵ) - rank(A::AbstractMatrix, rtol::Real) = rank(A; rtol=rtol) # to be deprecated in Julia 2.0 + rank(A::AbstractMatrix, rtol::Real) Compute the rank of a matrix by counting how many singular values of `A` have magnitude greater than `max(atol, rtol*σ₁)` where `σ₁` is @@ -722,6 +722,11 @@ tolerances, respectively. The default relative tolerance is `n*ϵ`, where `n` is the size of the smallest dimension of `A`, and `ϵ` is the [`eps`](@ref) of the element type of `A`. +!!! compat "Julia 1.1" + The `atol` and `rtol` keyword arguments requires at least Julia 1.1. + In Julia 1.0 `rtol` is available as a positional argument, but this + will be deprecated in Julia 2.0. + # Examples ```jldoctest julia> rank(Matrix(I, 3, 3)) From 36b60b71b7c991b20033228ab6e942eb1b3fe3a2 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 7 Dec 2018 21:43:43 -0500 Subject: [PATCH 02/65] fix #30303, escaping $ when showing Symbols (#30304) * fix #30303, escaping $ when showing Symbols * use repr instead of escape_string (cherry picked from commit f0b9499f5f311567ba4fda1bf14355009d592ff3) --- base/show.jl | 2 +- test/show.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/base/show.jl b/base/show.jl index fefb5d2650dd1..164031b7a5884 100644 --- a/base/show.jl +++ b/base/show.jl @@ -1031,7 +1031,7 @@ function show_unquoted_quote_expr(io::IO, @nospecialize(value), indent::Int, pre print(io, ":") print(io, value) else - print(io, "Symbol(\"", escape_string(s), "\")") + print(io, "Symbol(", repr(s), ")") end else if isa(value,Expr) && value.head === :block diff --git a/test/show.jl b/test/show.jl index a480812f4618e..b48b33a43d560 100644 --- a/test/show.jl +++ b/test/show.jl @@ -1416,3 +1416,6 @@ end replstrcolor(x) = sprint((io, x) -> show(IOContext(io, :limit => true, :color => true), MIME("text/plain"), x), x) @test occursin("\e[", replstrcolor(`curl abc`)) + +# issue #30303 +@test repr(Symbol("a\$")) == "Symbol(\"a\\\$\")" From 1af3b187f5d0b450cce13f2eb325762a13b7f56b Mon Sep 17 00:00:00 2001 From: Mus Date: Sat, 8 Dec 2018 13:06:16 -0500 Subject: [PATCH 03/65] Fix makefile not removing libjulia-debugon windows (#30059) (cherry picked from commit bcca2504b082ccb9dd19eb3696f9fc6e547ccfd5) --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7c4a3faae43f9..ea67778254cbe 100644 --- a/Makefile +++ b/Makefile @@ -340,9 +340,10 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1) $(INSTALL_M) $(build_bindir)/julia-debug $(DESTDIR)$(bindir)/ endif ifeq ($(OS),WINNT) - -$(INSTALL_M) $(build_bindir)/*.dll $(DESTDIR)$(bindir)/ + -$(INSTALL_M) $(filter-out $(build_bindir)/libjulia-debug.dll,$(wildcard $(build_bindir)/*.dll)) $(DESTDIR)$(bindir)/ -$(INSTALL_M) $(build_libdir)/libjulia.dll.a $(DESTDIR)$(libdir)/ ifeq ($(BUNDLE_DEBUG_LIBS),1) + -$(INSTALL_M) $(build_bindir)/libjulia-debug.dll $(DESTDIR)$(bindir)/ -$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/ endif -$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/ From 1fc30b5a651e528d4052eb688573f5df27c2a167 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Sat, 8 Dec 2018 19:35:42 +0100 Subject: [PATCH 04/65] Add LinearAlgebra as test dependency to Distributed. (#30311) (cherry picked from commit a0bc8fdb7569aaf83a477e0ee59a2ef791a52756) --- stdlib/Distributed/Project.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/Distributed/Project.toml b/stdlib/Distributed/Project.toml index af0e5ca7c5806..ecec870290041 100644 --- a/stdlib/Distributed/Project.toml +++ b/stdlib/Distributed/Project.toml @@ -2,12 +2,13 @@ name = "Distributed" uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [deps] -Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" [extras] +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test"] +test = ["LinearAlgebra", "Test"] From ae331181ace6bcd5764ebf4ab303da8d0c8d2055 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Sat, 8 Dec 2018 16:03:39 -0800 Subject: [PATCH 05/65] Fix armv7l compilation (#30253) * src/task.c: Use `bx` instead of `br` instruction on armv7l * Fix typo and incorrect initialization within `jl_getauxval` on armv7l. (cherry picked from commit d7c3926b85c9c4e5e31438d2974ef707c8456684) --- src/processor_arm.cpp | 4 ++-- src/task.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/processor_arm.cpp b/src/processor_arm.cpp index 000894fb05d7d..7b5fe0003bb56 100644 --- a/src/processor_arm.cpp +++ b/src/processor_arm.cpp @@ -522,8 +522,8 @@ static inline unsigned long jl_getauxval(unsigned long type) { // First, try resolving getauxval in libc auto libc = jl_dlopen(nullptr, JL_RTLD_LOCAL); - static (unsigned long (*)(unsigned long) getauxval_p; - if (jl_dlsym(libc, "getauxval", &getauxval_p, 0) { + static unsigned long (*getauxval_p)(unsigned long) = NULL; + if (getauxval_p == NULL && jl_dlsym(libc, "getauxval", (void **)&getauxval_p, 0)) { return getauxval_p(type); } diff --git a/src/task.c b/src/task.c index 3dce377a01a89..b54bbbc2df32b 100644 --- a/src/task.c +++ b/src/task.c @@ -762,7 +762,9 @@ static void jl_start_fiber(jl_ucontext_t *lastt, jl_ucontext_t *t) asm(" mov sp, %0;\n" " mov lr, #0;\n" // Clear link register (lr) and frame pointer " mov fp, #0;\n" // (fp) to terminate unwinder. - " br %1;\n" // call `fn` with fake stack frame + " bx %1;\n" // call `fn` with fake stack frame. While `bx` can change + // the processor mode to thumb, this will never happen + // because all our addresses are word-aligned. " udf #0" // abort : : "r" (stk), "r"(fn) : "memory" ); #else From 7fd07d9bef5d3bc393ab184442dbf74c3eab8405 Mon Sep 17 00:00:00 2001 From: Andy Ferris Date: Sun, 9 Dec 2018 17:02:18 +1000 Subject: [PATCH 06/65] Make `unique(f, itr)` and `unique!(f, itr)` faster (#30286) * Make `unique(f, itr)` and `unique!(f, itr)` faster Avoid creation of a `Set{Any}`. * Fix unique! for resizable OffsetVector (cherry picked from commit c2fb1dc7f1ce40bca76945422a4f62f07ae58d81) --- base/set.jl | 75 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 17 deletions(-) diff --git a/base/set.jl b/base/set.jl index cc2d69c4ca8d7..c53c50610c40f 100644 --- a/base/set.jl +++ b/base/set.jl @@ -167,15 +167,39 @@ julia> unique(x -> x^2, [1, -1, 3, -3, 4]) """ function unique(f, C) out = Vector{eltype(C)}() - seen = Set() - for x in C + + s = iterate(C) + if s === nothing + return out + end + (x, i) = s + y = f(x) + seen = Set{typeof(y)}() + push!(seen, y) + push!(out, x) + + return _unique!(f, out, C, seen, i) +end + +function _unique!(f, out::AbstractVector, C, seen::Set, i) + s = iterate(C, i) + while s !== nothing + (x, i) = s y = f(x) - if !in(y, seen) - push!(seen, y) + if y ∉ seen push!(out, x) + if y isa eltype(seen) + push!(seen, y) + else + seen2 = convert(Set{promote_typejoin(eltype(seen), typeof(y))}, seen) + push!(seen2, y) + return _unique!(f, out, C, seen2, i) + end end + s = iterate(C, i) end - out + + return out end """ @@ -208,22 +232,39 @@ julia> unique!(iseven, [2, 3, 5, 7, 9]) ``` """ function unique!(f, A::AbstractVector) - seen = Set() - idxs = eachindex(A) - y = iterate(idxs) - count = 0 - for x in A - t = f(x) - if t ∉ seen - push!(seen,t) - count += 1 - A[y[1]] = x - y = iterate(idxs, y[2]) + if length(A) <= 1 + return A + end + + i = firstindex(A) + x = @inbounds A[i] + y = f(x) + seen = Set{typeof(y)}() + push!(seen, y) + return _unique!(f, A, seen, i, i+1) +end + +function _unique!(f, A::AbstractVector, seen::Set, current::Integer, i::Integer) + while i <= lastindex(A) + x = @inbounds A[i] + y = f(x) + if y ∉ seen + current += 1 + @inbounds A[current] = x + if y isa eltype(seen) + push!(seen, y) + else + seen2 = convert(Set{promote_typejoin(eltype(seen), typeof(y))}, seen) + push!(seen2, y) + return _unique!(f, A, seen2, current, i+1) + end end + i += 1 end - resize!(A, count) + return resize!(A, current - firstindex(A) + 1) end + # If A is not grouped, then we will need to keep track of all of the elements that we have # seen so far. _unique!(A::AbstractVector) = unique!(identity, A::AbstractVector) From c9baf5c537fa69b742ab6b0fe3a785bbfe26817d Mon Sep 17 00:00:00 2001 From: Chris Foster Date: Sat, 8 Dec 2018 10:00:56 +1000 Subject: [PATCH 07/65] Unexport catch_stack This API is experimental in julia 1.1 and will be replaced with something more convenient (see #29901). In the meantime, make sure it's clearly marked as experimental and not exported from Base. (cherry picked from commit 1bd316b972cb4ef83b9b8e79f435cc4d59029a93) --- NEWS.md | 4 +++- base/error.jl | 3 ++- base/exports.jl | 1 - doc/src/manual/control-flow.md | 2 +- doc/src/manual/stacktraces.md | 6 +++--- test/exceptions.jl | 1 + 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index 82eabe62f81b2..2833e53cb3f43 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,9 @@ Julia v1.1 Release Notes New language features --------------------- - * An *exception stack* is maintained on each task to make exception handling more robust and enable root cause analysis using `catch_stack` ([#28878]). + * An *exception stack* is maintained on each task to make exception handling + more robust and enable root cause analysis. The stack may be accessed using + the experimental function `Base.catch_stack` ([#28878]). * The experimental macro `Base.@locals` returns a dictionary of current local variable names and values ([#29733]). diff --git a/base/error.jl b/base/error.jl index 488ddc6867386..ff13dbef2ec35 100644 --- a/base/error.jl +++ b/base/error.jl @@ -105,7 +105,8 @@ arbitrary task. This is useful for inspecting tasks which have failed due to uncaught exceptions. !!! compat "Julia 1.1" - This function requires at least Julia 1.1. + This function is experimental in Julia 1.1 and will likely be renamed in a + future release (see https://github.com/JuliaLang/julia/pull/29901). """ function catch_stack(task=current_task(); include_bt=true) raw = ccall(:jl_get_excstack, Any, (Any,Cint,Cint), task, include_bt, typemax(Cint)) diff --git a/base/exports.jl b/base/exports.jl index d9c3812b5aebf..3163d4914d3dc 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -682,7 +682,6 @@ export # errors backtrace, catch_backtrace, - catch_stack, error, rethrow, retry, diff --git a/doc/src/manual/control-flow.md b/doc/src/manual/control-flow.md index 9de3b8206c8a7..6d4cf729d502d 100644 --- a/doc/src/manual/control-flow.md +++ b/doc/src/manual/control-flow.md @@ -794,7 +794,7 @@ The power of the `try/catch` construct lies in the ability to unwind a deeply ne immediately to a much higher level in the stack of calling functions. There are situations where no error has occurred, but the ability to unwind the stack and pass a value to a higher level is desirable. Julia provides the [`rethrow`](@ref), [`backtrace`](@ref), [`catch_backtrace`](@ref) -and [`catch_stack`](@ref) functions for more advanced error handling. +and [`Base.catch_stack`](@ref) functions for more advanced error handling. ### `finally` Clauses diff --git a/doc/src/manual/stacktraces.md b/doc/src/manual/stacktraces.md index 01a3417d33031..8deff082140f1 100644 --- a/doc/src/manual/stacktraces.md +++ b/doc/src/manual/stacktraces.md @@ -187,7 +187,7 @@ ERROR: Whoops! [...] ``` -## Exception stacks and [`catch_stack`](@ref) +## Exception stacks and `catch_stack` !!! compat "Julia 1.1" Exception stacks requires at least Julia 1.1. @@ -197,7 +197,7 @@ identify the root cause of a problem. The julia runtime supports this by pushing *exception stack* as it occurs. When the code exits a `catch` normally, any exceptions which were pushed onto the stack in the associated `try` are considered to be successfully handled and are removed from the stack. -The stack of current exceptions can be accessed using the [`catch_stack`](@ref) function. For example, +The stack of current exceptions can be accessed using the experimental [`Base.catch_stack`](@ref) function. For example, ```julia-repl julia> try @@ -206,7 +206,7 @@ julia> try try error("(B) An exception while handling the exception") catch - for (exc, bt) in catch_stack() + for (exc, bt) in Base.catch_stack() showerror(stdout, exc, bt) println() end diff --git a/test/exceptions.jl b/test/exceptions.jl index 6bbeebd88e4c5..e1a415a2c6c0d 100644 --- a/test/exceptions.jl +++ b/test/exceptions.jl @@ -1,4 +1,5 @@ using Test +using Base: catch_stack @testset "Basic exception stack handling" begin # Exiting the catch block normally pops the exception From 0f8c505f36c196923e76d0b0f76fd80f122ffebc Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Sun, 9 Dec 2018 13:57:44 -0800 Subject: [PATCH 08/65] Use `JL_AArch64_crc` instead of `HWCAP_CRC32` (#30324) Closes https://github.com/JuliaLang/julia/issues/26458 (cherry picked from commit bd21aa75eb4c0e56ef870f6bffea3281c724cbb1) --- src/crc32c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crc32c.c b/src/crc32c.c index f9100a22abe93..9ad1991d3c804 100644 --- a/src/crc32c.c +++ b/src/crc32c.c @@ -43,6 +43,7 @@ #include "julia.h" #include "julia_internal.h" +#include "processor.h" #ifdef _CPU_AARCH64_ # include @@ -333,7 +334,7 @@ JL_DLLEXPORT uint32_t jl_crc32c(uint32_t crc, const char *buf, size_t len) # else static crc32c_func_t crc32c_dispatch(unsigned long hwcap) { - if (hwcap & HWCAP_CRC32) + if (hwcap & (1 << JL_AArch64_crc)) return crc32c_armv8; return jl_crc32c_sw; } From 7b52bed2126c5c3b2af1cd3a0432c4e1105ba5e0 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Mon, 10 Dec 2018 02:34:47 -0500 Subject: [PATCH 09/65] NEWS edits for 1.1 (#30302) (cherry picked from commit 0a401f2b5dfa288e1812016b2b0311316de77697) --- NEWS.md | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2833e53cb3f43..7e3c727b8c011 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ Julia v1.1 Release Notes -========================== +======================== New language features --------------------- @@ -27,13 +27,14 @@ Language changes the old behavior, or `CartesianIndices(a)[findall(in(b), a)]` to get the new behavior on previous Julia versions ([#30226]). * `findmin(::BitArray)` and `findmax(::BitArray)` now return a `CartesianIndex` when `a` is a matrix - or a higher-dimensional array, for consistency with for other array types. + or a higher-dimensional array, for consistency with other array types. Use `LinearIndices(a)[findmin(a)[2]]` to get the old behavior, or `CartesianIndices(a)[findmin(a)[2]]` to get the new behavior on previous Julia versions ([#30102]). * Method signatures such as `f(::Type{T}, ::T) where {T <: X}` and `f(::Type{X}, ::Any)` - are now considered ambiguous. Previously a bug caused the first one to be considered more specific ([#30160]). + are now considered ambiguous. Previously a bug caused the first one to be considered more specific in + some cases ([#30160]). Command-line option changes --------------------------- @@ -45,13 +46,14 @@ Command-line option changes New library functions --------------------- - * `splitpath(p::String)` function, which is the opposite of `joinpath(parts...)`: it splits a filepath into its components ([#28156]). - * `isnothing(::Any)` function, to check whether something is a `Nothing`, returns a `Bool` ([#29679]). + * `splitpath(p::String)` function, which is the opposite of `joinpath(parts...)`: it splits a filepath + into its components ([#28156]). + * `isnothing(::Any)` predicate, to check whether the argument is `nothing`. ([#29679]). * `getpid(::Process)` method ([#24064]). * `eachrow`, `eachcol` and `eachslice` functions provide efficient iterators over slices of arrays ([#29749]). - * `fieldtypes(T::Type)` which return the declared types of the field in type T ([#29600]). + * `fieldtypes(T::Type)` which returns the declared types of the field in type T ([#29600]). * `uuid5` has been added to the `UUIDs` standard library ([#28761]). - * Predicate functions `Sys.isfreebsd`, `Sys.isopenbsd`, `Sys.isnetbsd`, and `Sys.isdragonfly` for + * Predicates `Sys.isfreebsd`, `Sys.isopenbsd`, `Sys.isnetbsd`, and `Sys.isdragonfly` for detecting BSD systems have been added ([#30249]). * Internal `Base.disable_library_threading` that sets libraries to use one thread. It executes function hooks that have been registered with @@ -72,7 +74,7 @@ Standard library changes argument ([#29157]). * The use of scientific notation when printing `BigFloat` values is now consistent with other floating point types ([#29211]). - * `Regex` now behave like a scalar when used in broadcasting ([#29913]). + * `Regex` now behaves like a scalar when used in broadcasting ([#29913]). * `Char` now behaves like a read-only 0-dimensional array ([#29819]). * `parse` now allows strings representing integer 0 and 1 for type `Bool` ([#29980]). * `Base.tail` now works on named tuples ([#29595]). @@ -81,24 +83,21 @@ Standard library changes * `Base.julia_cmd` now propagates the `--inline=(yes|no)` flag ([#29858]). * `Base.@kwdef` can now be used for parametric structs, and for structs with supertypes ([#29316]). * `merge(::NamedTuple, ::NamedTuple...)` can now be used with more than 2 `NamedTuple`s ([#29259]). - * `Future.copy!` has been moved to `Base` ([#29178]). * New `ncodeunits(c::Char)` method as a fast equivalent to `ncodeunits(string(c))` ([#29153]). * New `sort!(::AbstractArray; dims)` method that can sort the array along the `dims` dimension ([#28902]). - * `range` now accept `stop` as a positional argument ([#28708]). - * `get(A::AbstractArray, (), default)` now returns the result of `A[]` if it can instead of always - returning an empty array ([#30270]). + * `range` now accepts `stop` as a positional argument ([#28708]). + * `get(A::AbstractArray, (), default)` now returns `A[]` instead of an empty array ([#30270]). * `parse(Bool, str)` is now supported ([#29997]). - * `copyto!(::AbstractMatrix, ::UniformScaling)` supports rectangular matrices now ([#28790]). - * In `put!(c::Channel{T}, v)`, `v` now gets converted to `T` as `put!` is being called ([#29092]). + * `copyto!(::AbstractMatrix, ::UniformScaling)` now supports rectangular matrices ([#28790]). * `current_project()` now searches the parent directories of a Git repository for a `Project.toml` file. This also affects the behavior of the `--project` command line option when using the default `--project=@.` ([#29108]). - * The `spawn` API is now more flexible and supports taking IOBuffer directly as a I/O stream, + * The `spawn` API is now more flexible and supports taking IOBuffer directly as an I/O stream, converting to a system pipe as needed ([#30278]). #### Dates * New `DateTime(::Date, ::Time)` constructor ([#29754]). - * `TimeZone` now behave like a scalar when used in broadcasting ([#30159]). + * `TimeZone` now behaves like a scalar when used in broadcasting ([#30159]). #### InteractiveUtils * `edit` can now be called on a module to edit the file that defines it ([#29636]). @@ -110,7 +109,7 @@ Standard library changes * `isdiag` and `isposdef` for `Diagonal` and `UniformScaling` ([#29638]). * `mul!`, `rmul!` and `lmul!` methods for `UniformScaling` ([#29506]). * `Symmetric` and `Hermitian` matrices now preserve the wrapper when scaled with a number ([#29469]). - * Exponentiation operator `^` now supports raising a `Irrational` to an `AbstractMatrix` power ([#29782]). + * Exponentiation operator `^` now supports raising an `Irrational` to an `AbstractMatrix` power ([#29782]). #### Random * `randperm` and `randcycle` now use the type of their argument to determine the element type of @@ -122,7 +121,7 @@ Standard library changes * `sprandn` now supports specifying the output element type ([#30083]). #### Statistics - * `mean` and `var` now handles the empty case ([#29033]). + * `mean` and `var` now handle more kinds of empty inputs ([#29033]). External dependencies --------------------- @@ -165,7 +164,6 @@ Deprecated or removed [#29153]: https://github.com/JuliaLang/julia/issues/29153 [#29157]: https://github.com/JuliaLang/julia/issues/29157 [#29173]: https://github.com/JuliaLang/julia/issues/29173 -[#29178]: https://github.com/JuliaLang/julia/issues/29178 [#29211]: https://github.com/JuliaLang/julia/issues/29211 [#29259]: https://github.com/JuliaLang/julia/issues/29259 [#29316]: https://github.com/JuliaLang/julia/issues/29316 @@ -200,8 +198,15 @@ Deprecated or removed [#29978]: https://github.com/JuliaLang/julia/issues/29978 [#29980]: https://github.com/JuliaLang/julia/issues/29980 [#29997]: https://github.com/JuliaLang/julia/issues/29997 +[#30004]: https://github.com/JuliaLang/julia/issues/30004 [#30022]: https://github.com/JuliaLang/julia/issues/30022 [#30035]: https://github.com/JuliaLang/julia/issues/30035 [#30083]: https://github.com/JuliaLang/julia/issues/30083 +[#30102]: https://github.com/JuliaLang/julia/issues/30102 +[#30151]: https://github.com/JuliaLang/julia/issues/30151 [#30159]: https://github.com/JuliaLang/julia/issues/30159 +[#30160]: https://github.com/JuliaLang/julia/issues/30160 +[#30226]: https://github.com/JuliaLang/julia/issues/30226 [#30249]: https://github.com/JuliaLang/julia/issues/30249 +[#30270]: https://github.com/JuliaLang/julia/issues/30270 +[#30278]: https://github.com/JuliaLang/julia/issues/30278 From 5fca9de703aed43d5521c227eb23109ae2c65b31 Mon Sep 17 00:00:00 2001 From: Andy Ferris Date: Tue, 11 Dec 2018 12:06:55 +1000 Subject: [PATCH 10/65] `@inbounds` annotations for filter (#30156) (cherry picked from commit 58f9bf7042c0e0ad8a50b0914a5aff76613962b6) --- base/array.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/array.jl b/base/array.jl index 0e7e0b71db2c6..a8256ec8ff99a 100644 --- a/base/array.jl +++ b/base/array.jl @@ -2333,7 +2333,7 @@ function filter!(f, a::AbstractVector) for acurr in a if f(acurr) - a[i] = acurr + @inbounds a[i] = acurr y = iterate(idx, state) y === nothing && (i += 1; break) i, state = y From ca1b40e6bf9b9a3ea84c57a7e3725395138853ec Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Tue, 11 Dec 2018 02:28:26 -0500 Subject: [PATCH 11/65] Expand and fix documentation of BitArray (#30340) Fixes #30337... and while I was there I added a bit more information about what BitArrays do and when you might run into them. (cherry picked from commit 0d620001c200e49e2882500c94b9a150124bf875) --- base/bitarray.jl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/base/bitarray.jl b/base/bitarray.jl index 7f16d00185f4f..a93909a4bbbbd 100644 --- a/base/bitarray.jl +++ b/base/bitarray.jl @@ -5,9 +5,16 @@ # notes: bits are stored in contiguous chunks # unused bits must always be set to 0 """ - BitArray{N} <: DenseArray{Bool, N} + BitArray{N} <: AbstractArray{Bool, N} -Space-efficient `N`-dimensional boolean array, which stores one bit per boolean value. +Space-efficient `N`-dimensional boolean array, using just one bit for each boolean value. + +`BitArray`s pack up to 64 values into every 8 bytes, resulting in an 8x space efficiency +over `Array{Bool, N}` and allowing some operations to work on 64 values at once. + +By default, Julia returns `BitArrays` from [broadcasting](@ref Broadcasting) operations +that generate boolean elements (including dotted-comparisons like `.==`) as well as from +the functions [`trues`](@ref) and [`falses`](@ref). """ mutable struct BitArray{N} <: AbstractArray{Bool, N} chunks::Vector{UInt64} From 2be2ebf1194216585ce925883bd87466ef3da1db Mon Sep 17 00:00:00 2001 From: Klaus Crusius Date: Tue, 11 Dec 2018 12:56:49 +0100 Subject: [PATCH 12/65] oneunit of sparse matrix should return sparse matrix (#30228) * added sprandn methods with Type * oneunit of sparse matrix should return sparse array (cherry picked from commit 5c5489ea7d19ea93bb9239cec65644c6b95882b5) --- stdlib/SparseArrays/src/sparsematrix.jl | 3 ++- stdlib/SparseArrays/test/sparse.jl | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/stdlib/SparseArrays/src/sparsematrix.jl b/stdlib/SparseArrays/src/sparsematrix.jl index c4b335701400d..fe73825db4d18 100644 --- a/stdlib/SparseArrays/src/sparsematrix.jl +++ b/stdlib/SparseArrays/src/sparsematrix.jl @@ -1524,7 +1524,8 @@ function spzeros(::Type{Tv}, ::Type{Ti}, sz::Tuple{Integer,Integer}) where {Tv, spzeros(Tv, Ti, sz[1], sz[2]) end -function one(S::SparseMatrixCSC{T}) where T +import Base._one +function Base._one(unit::T, S::SparseMatrixCSC) where T S.m == S.n || throw(DimensionMismatch("multiplicative identity only defined for square matrices")) return SparseMatrixCSC{T}(I, S.m, S.n) end diff --git a/stdlib/SparseArrays/test/sparse.jl b/stdlib/SparseArrays/test/sparse.jl index 60bd97f23da87..4328d59592ce9 100644 --- a/stdlib/SparseArrays/test/sparse.jl +++ b/stdlib/SparseArrays/test/sparse.jl @@ -9,6 +9,7 @@ using Base.Printf: @printf using Random using Test: guardseed using InteractiveUtils: @which +using Dates @testset "issparse" begin @test issparse(sparse(fill(1,5,5))) @@ -2350,4 +2351,12 @@ end @test success(pipeline(cmd; stdout=stdout, stderr=stderr)) end +@testset "oneunit of sparse matrix" begin + A = sparse([Second(0) Second(0); Second(0) Second(0)]) + @test oneunit(sprand(2, 2, 0.5)) isa SparseMatrixCSC{Float64} + @test oneunit(A) isa SparseMatrixCSC{Second} + @test one(sprand(2, 2, 0.5)) isa SparseMatrixCSC{Float64} + @test one(A) isa SparseMatrixCSC{Int} +end + end # module From 76ce618647d30df8ceee72b05805dfae4dd1472f Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Tue, 11 Dec 2018 13:10:20 +0100 Subject: [PATCH 13/65] Upgrade Pkg to version 1.1. (#30342) (cherry picked from commit 411a7cf1a74d61b0bb00f7b8738583d1b136a061) --- NEWS.md | 2 ++ .../Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/md5 | 1 - .../Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/sha512 | 1 - .../Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 | 1 + .../Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 | 1 + stdlib/Pkg.version | 2 +- 6 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 deps/checksums/Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/sha512 create mode 100644 deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 create mode 100644 deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 diff --git a/NEWS.md b/NEWS.md index 7e3c727b8c011..9ad5b213c8de5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -132,6 +132,7 @@ External dependencies * The source code for Pkg is no longer included in JuliaLang/julia. Pkg is instead downloaded during the build process ([#29615]). * LLVM has been upgraded to 6.0.1 and support for LLVM < 6.0 has been dropped ([#28745], [#28696]). + * Pkg has been upgraded to version 1.1 ([#30342]). Deprecated or removed --------------------- @@ -210,3 +211,4 @@ Deprecated or removed [#30249]: https://github.com/JuliaLang/julia/issues/30249 [#30270]: https://github.com/JuliaLang/julia/issues/30270 [#30278]: https://github.com/JuliaLang/julia/issues/30278 +[#30342]: https://github.com/JuliaLang/julia/issues/30342 diff --git a/deps/checksums/Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/md5 b/deps/checksums/Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/md5 deleted file mode 100644 index 58901a73acbe6..0000000000000 --- a/deps/checksums/Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -006468f2f3090f1c5fd64eac3105981e diff --git a/deps/checksums/Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/sha512 b/deps/checksums/Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/sha512 deleted file mode 100644 index 90f2c54ebb74f..0000000000000 --- a/deps/checksums/Pkg-193e494c22f7ce8b5956829286c6212133edcbf1.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -fee2e9731acfc70a2488fe7d0ff6656ccc36f3620ab654dc147e554006fe630409ccd823a1b44b9bd235ba008c7a4c649f785299dff435d68f118741aacacb68 diff --git a/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 b/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 new file mode 100644 index 0000000000000..b5ede4b4e00c4 --- /dev/null +++ b/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 @@ -0,0 +1 @@ +2ef64823cc872c423a575a8425819154 diff --git a/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 b/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 new file mode 100644 index 0000000000000..f8afd463f201c --- /dev/null +++ b/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 @@ -0,0 +1 @@ +fd2c929d076761c2deebd76aac4fbc8777d43ebdb58ff3024104b671bed4895e2a5d92aeeaae27b785667e0793b99b328829f2bbc737cc8e2634f2fe80d3b55f diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index 2f8d270786fc3..695b02f828c62 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,2 +1,2 @@ PKG_BRANCH = master -PKG_SHA1 = 193e494c22f7ce8b5956829286c6212133edcbf1 +PKG_SHA1 = dacd88b50aca09406c98aa9d418ee2716940d9c4 From acbb3cc22381525611eca91b24199e1ad2e81401 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 12 Dec 2018 00:24:59 +0900 Subject: [PATCH 14/65] adding == for structured matrices (#30108) (cherry picked from commit 2460301b46dba0b2c1c97889a399edb5162ee86f) --- stdlib/LinearAlgebra/src/bidiag.jl | 9 ++++++++- stdlib/LinearAlgebra/src/special.jl | 22 ++++++++++++++++++++++ stdlib/LinearAlgebra/test/special.jl | 24 ++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/bidiag.jl b/stdlib/LinearAlgebra/src/bidiag.jl index 24c3a015dd3c9..eb055ffbe72f6 100644 --- a/stdlib/LinearAlgebra/src/bidiag.jl +++ b/stdlib/LinearAlgebra/src/bidiag.jl @@ -322,7 +322,14 @@ end *(A::Bidiagonal, B::Number) = Bidiagonal(A.dv*B, A.ev*B, A.uplo) *(B::Number, A::Bidiagonal) = A*B /(A::Bidiagonal, B::Number) = Bidiagonal(A.dv/B, A.ev/B, A.uplo) -==(A::Bidiagonal, B::Bidiagonal) = (A.uplo==B.uplo) && (A.dv==B.dv) && (A.ev==B.ev) + +function ==(A::Bidiagonal, B::Bidiagonal) + if A.uplo == B.uplo + return A.dv == B.dv && A.ev == B.ev + else + return iszero(A.ev) && iszero(B.ev) && A.dv == B.dv + end +end const BiTriSym = Union{Bidiagonal,Tridiagonal,SymTridiagonal} const BiTri = Union{Bidiagonal,Tridiagonal} diff --git a/stdlib/LinearAlgebra/src/special.jl b/stdlib/LinearAlgebra/src/special.jl index 54fd00c402746..bad7ad8581de4 100644 --- a/stdlib/LinearAlgebra/src/special.jl +++ b/stdlib/LinearAlgebra/src/special.jl @@ -148,3 +148,25 @@ function fill!(A::Union{Diagonal,Bidiagonal,Tridiagonal,SymTridiagonal}, x) throw(ArgumentError("array of type $(typeof(A)) and size $(size(A)) can not be filled with $x, since some of its entries are constrained.")) end + +# equals and approx equals methods for structured matrices +# SymTridiagonal == Tridiagonal is already defined in tridiag.jl + +# SymTridiagonal and Bidiagonal have the same field names +==(A::Diagonal, B::Union{SymTridiagonal, Bidiagonal}) = iszero(B.ev) && A.diag == B.dv +==(B::Bidiagonal, A::Diagonal) = A == B + +==(A::Diagonal, B::Tridiagonal) = iszero(B.dl) && iszero(B.du) && A.diag == B.d +==(B::Tridiagonal, A::Diagonal) = A == B + +function ==(A::Bidiagonal, B::Tridiagonal) + if A.uplo == 'U' + return iszero(B.dl) && A.dv == B.d && A.ev == B.du + else + return iszero(B.du) && A.dv == B.d && A.ev == B.dl + end +end +==(B::Tridiagonal, A::Bidiagonal) = A == B + +==(A::Bidiagonal, B::SymTridiagonal) = iszero(B.ev) && iszero(A.ev) && A.dv == B.dv +==(B::SymTridiagonal, A::Bidiagonal) = A == B diff --git a/stdlib/LinearAlgebra/test/special.jl b/stdlib/LinearAlgebra/test/special.jl index 2092122c33458..ecfa26d63837d 100644 --- a/stdlib/LinearAlgebra/test/special.jl +++ b/stdlib/LinearAlgebra/test/special.jl @@ -252,4 +252,28 @@ end @test isa((@inferred vcat(Float64[], spzeros(1))), SparseVector) end +@testset "== for structured matrices" begin + diag = rand(10) + offdiag = rand(9) + D = Diagonal(rand(10)) + Bup = Bidiagonal(diag, offdiag, 'U') + Blo = Bidiagonal(diag, offdiag, 'L') + Bupd = Bidiagonal(diag, zeros(9), 'U') + Blod = Bidiagonal(diag, zeros(9), 'L') + T = Tridiagonal(offdiag, diag, offdiag) + Td = Tridiagonal(zeros(9), diag, zeros(9)) + Tu = Tridiagonal(zeros(9), diag, offdiag) + Tl = Tridiagonal(offdiag, diag, zeros(9)) + S = SymTridiagonal(diag, offdiag) + Sd = SymTridiagonal(diag, zeros(9)) + + mats = [D, Bup, Blo, Bupd, Blod, T, Td, Tu, Tl, S, Sd] + + for a in mats + for b in mats + @test (a == b) == (Matrix(a) == Matrix(b)) == (b == a) == (Matrix(b) == Matrix(a)) + end + end +end + end # module TestSpecial From cef11677997f8d7385db669e3e5bb197edefcdc1 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Tue, 11 Dec 2018 16:29:41 +0100 Subject: [PATCH 15/65] Update to Documenter 0.21 and prepare for PDF documentation builds. (#30339) (cherry picked from commit 217d330296debe0567bb07addabf66b00602e325) --- doc/Makefile | 3 ++- doc/Manifest.toml | 27 ++++++++++++++------------- doc/Project.toml | 1 + doc/make.jl | 17 +++++++++++++---- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 3d0773342fc1d..99e60ee665c1f 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -20,7 +20,8 @@ help: @echo "To fix outdated doctests, use 'make doctest=fix'" -DOCUMENTER_OPTIONS := linkcheck=$(linkcheck) doctest=$(doctest) buildroot=$(call cygpath_w,$(BUILDROOT)) +DOCUMENTER_OPTIONS := linkcheck=$(linkcheck) doctest=$(doctest) buildroot=$(call cygpath_w,$(BUILDROOT)) \ + texplatform=$(texplatform) UnicodeData.txt: $(JLDOWNLOAD) http://www.unicode.org/Public/9.0.0/ucd/UnicodeData.txt diff --git a/doc/Manifest.toml b/doc/Manifest.toml index 609d04b817e2b..5cbd6d684b7ed 100644 --- a/doc/Manifest.toml +++ b/doc/Manifest.toml @@ -1,3 +1,5 @@ +# This file is machine-generated - editing it directly is not advised + [[Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" @@ -6,35 +8,34 @@ deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" [[Distributed]] -deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"] +deps = ["Random", "Serialization", "Sockets"] uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [[DocStringExtensions]] deps = ["LibGit2", "Markdown", "Pkg", "Test"] -git-tree-sha1 = "a016e0bfe98a748c4488e2248c2ef4c67d6fdd35" +git-tree-sha1 = "1df01539a1c952cef21f2d2d1c092c2bcf0177d7" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.5.0" +version = "0.6.0" [[Documenter]] deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "LibGit2", "Logging", "Markdown", "Pkg", "REPL", "Random", "Test", "Unicode"] -git-tree-sha1 = "9f2135e0e7ecb63f9c3ef73ea15a31d8cdb79bb7" +git-tree-sha1 = "a6db1c69925cdc53aafb38caec4446be26e0c617" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "0.20.0" +version = "0.21.0" + +[[DocumenterLaTeX]] +deps = ["Documenter", "Test"] +git-tree-sha1 = "653299370be20ff580bccd707dc9f360c0852d7f" +uuid = "cd674d7a-5f81-5cf3-af33-235ef1834b99" +version = "0.2.0" [[InteractiveUtils]] -deps = ["LinearAlgebra", "Markdown"] +deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[LibGit2]] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" -[[Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[LinearAlgebra]] -deps = ["Libdl"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - [[Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" diff --git a/doc/Project.toml b/doc/Project.toml index dfa65cd107d06..c09e74d6533a4 100644 --- a/doc/Project.toml +++ b/doc/Project.toml @@ -1,2 +1,3 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DocumenterLaTeX = "cd674d7a-5f81-5cf3-af33-235ef1834b99" diff --git a/doc/make.jl b/doc/make.jl index 6a89666da974d..bae4096990cac 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -6,7 +6,7 @@ pushfirst!(DEPOT_PATH, joinpath(@__DIR__, "deps")) using Pkg Pkg.instantiate() -using Documenter +using Documenter, DocumenterLaTeX # Include the `build_sysimg` file. @@ -159,6 +159,17 @@ let r = r"buildroot=(.+)", i = findfirst(x -> occursin(r, x), ARGS) global const buildroot = i === nothing ? (@__DIR__) : first(match(r, ARGS[i]).captures) end +const format = if render_pdf + LaTeX( + platform = "texplatform=docker" in ARGS ? "docker" : "native" + ) +else + Documenter.HTML( + prettyurls = ("deploy" in ARGS), + canonical = ("deploy" in ARGS) ? "https://docs.julialang.org/en/v1/" : nothing, + ) +end + makedocs( build = joinpath(buildroot, "doc", "_build", (render_pdf ? "pdf" : "html"), "en"), modules = [Base, Core, BuildSysImg, [Base.root_module(Base, stdlib.stdlib) for stdlib in STDLIB_DOCS]...], @@ -168,13 +179,11 @@ makedocs( linkcheck_ignore = ["https://bugs.kde.org/show_bug.cgi?id=136779"], # fails to load from nanosoldier? strict = true, checkdocs = :none, - format = render_pdf ? :latex : :html, + format = format, sitename = "The Julia Language", authors = "The Julia Project", analytics = "UA-28835595-6", pages = PAGES, - html_prettyurls = ("deploy" in ARGS), - html_canonical = ("deploy" in ARGS) ? "https://docs.julialang.org/en/v1/" : nothing, assets = ["assets/julia-manual.css", ] ) From 4ca783786fcfe9909697198ddc60101b25336c57 Mon Sep 17 00:00:00 2001 From: Samikshya Chand Date: Tue, 11 Dec 2018 22:44:34 +0530 Subject: [PATCH 16/65] Adding rtol and atol for pinv and nullspace (#29998) * Add code for rtol and atol * add tests * resolve comment * fix typo * fix tests * add news.md item * Not deprecated yet. * Tweak docs slightly * typo from diff [skip ci] (cherry picked from commit 5b2e3e7d410ed0576b65f34fbd86edf495c1ea43) --- NEWS.md | 1 + stdlib/LinearAlgebra/src/dense.jl | 57 +++++++++++++++----------- stdlib/LinearAlgebra/src/deprecated.jl | 3 ++ stdlib/LinearAlgebra/test/dense.jl | 8 ++++ 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/NEWS.md b/NEWS.md index 9ad5b213c8de5..8ec6cf567e752 100644 --- a/NEWS.md +++ b/NEWS.md @@ -110,6 +110,7 @@ Standard library changes * `mul!`, `rmul!` and `lmul!` methods for `UniformScaling` ([#29506]). * `Symmetric` and `Hermitian` matrices now preserve the wrapper when scaled with a number ([#29469]). * Exponentiation operator `^` now supports raising an `Irrational` to an `AbstractMatrix` power ([#29782]). + * Added keyword arguments `rtol`, `atol` to `pinv`, `nullspace` and `rank` ([#29998], [#29926]). #### Random * `randperm` and `randcycle` now use the type of their argument to determine the element type of diff --git a/stdlib/LinearAlgebra/src/dense.jl b/stdlib/LinearAlgebra/src/dense.jl index 14b9ddec25d83..f9fd39a18f11c 100644 --- a/stdlib/LinearAlgebra/src/dense.jl +++ b/stdlib/LinearAlgebra/src/dense.jl @@ -1237,19 +1237,21 @@ factorize(A::Transpose) = transpose(factorize(parent(A))) ## Moore-Penrose pseudoinverse """ - pinv(M[, rtol::Real]) + pinv(M; atol::Real=0, rtol::Real=atol>0 ? 0 : n*ϵ) + pinv(M, rtol::Real) = pinv(M; rtol=rtol) # to be deprecated in Julia 2.0 Computes the Moore-Penrose pseudoinverse. For matrices `M` with floating point elements, it is convenient to compute the pseudoinverse by inverting only singular values greater than -`rtol * maximum(svdvals(M))`. +`max(atol, rtol*σ₁)` where `σ₁` is the largest singular value of `M`. -The optimal choice of `rtol` varies both with the value of `M` and the intended application -of the pseudoinverse. The default value of `rtol` is -`eps(real(float(one(eltype(M)))))*minimum(size(M))`, which is essentially machine epsilon -for the real part of a matrix element multiplied by the larger matrix dimension. For -inverting dense ill-conditioned matrices in a least-squares sense, +The optimal choice of absolute (`atol`) and relative tolerance (`rtol`) varies +both with the value of `M` and the intended application of the pseudoinverse. +The default relative tolerance is `n*ϵ`, where `n` is the size of the smallest +dimension of `M`, and `ϵ` is the [`eps`](@ref) of the element type of `M`. + +For inverting dense ill-conditioned matrices in a least-squares sense, `rtol = sqrt(eps(real(float(one(eltype(M))))))` is recommended. For more information, see [^issue8859], [^B96], [^S84], [^KY88]. @@ -1280,7 +1282,7 @@ julia> M * N [^KY88]: Konstantinos Konstantinides and Kung Yao, "Statistical analysis of effective singular values in matrix rank determination", IEEE Transactions on Acoustics, Speech and Signal Processing, 36(5), 1988, 757-763. [doi:10.1109/29.1585](https://doi.org/10.1109/29.1585) """ -function pinv(A::AbstractMatrix{T}, rtol::Real) where T +function pinv(A::AbstractMatrix{T}; atol::Real = 0.0, rtol::Real = (eps(real(float(one(T))))*min(size(A)...))*iszero(atol)) where T m, n = size(A) Tout = typeof(zero(T)/sqrt(one(T) + one(T))) if m == 0 || n == 0 @@ -1289,9 +1291,10 @@ function pinv(A::AbstractMatrix{T}, rtol::Real) where T if istril(A) if istriu(A) maxabsA = maximum(abs.(diag(A))) + tol = max(rtol*maxabsA, atol) B = zeros(Tout, n, m) for i = 1:min(m, n) - if abs(A[i,i]) > rtol*maxabsA + if abs(A[i,i]) > tol Aii = inv(A[i,i]) if isfinite(Aii) B[i,i] = Aii @@ -1302,17 +1305,14 @@ function pinv(A::AbstractMatrix{T}, rtol::Real) where T end end SVD = svd(A, full = false) + tol = max(rtol*maximum(SVD.S), atol) Stype = eltype(SVD.S) Sinv = zeros(Stype, length(SVD.S)) - index = SVD.S .> rtol*maximum(SVD.S) + index = SVD.S .> tol Sinv[index] = one(Stype) ./ SVD.S[index] Sinv[findall(.!isfinite.(Sinv))] .= zero(Stype) return SVD.Vt' * (Diagonal(Sinv) * SVD.U') end -function pinv(A::AbstractMatrix{T}) where T - rtol = eps(real(float(one(T))))*min(size(A)...) - return pinv(A, rtol) -end function pinv(x::Number) xi = inv(x) return ifelse(isfinite(xi), xi, zero(xi)) @@ -1321,13 +1321,16 @@ end ## Basis for null space """ - nullspace(M[, rtol::Real]) + nullspace(M; atol::Real=0, rtol::Rea=atol>0 ? 0 : n*ϵ) + nullspace(M, rtol::Real) = nullspace(M; rtol=rtol) # to be deprecated in Julia 2.0 Computes a basis for the nullspace of `M` by including the singular -vectors of A whose singular have magnitude are greater than `rtol*σ₁`, -where `σ₁` is `A`'s largest singular values. By default, the value of -`rtol` is the smallest dimension of `A` multiplied by the [`eps`](@ref) -of the [`eltype`](@ref) of `A`. +vectors of A whose singular have magnitude are greater than `max(atol, rtol*σ₁)`, +where `σ₁` is `M`'s largest singularvalue. + +By default, the relative tolerance `rtol` is `n*ϵ`, where `n` +is the size of the smallest dimension of `M`, and `ϵ` is the [`eps`](@ref) of +the element type of `M`. # Examples ```jldoctest @@ -1343,21 +1346,29 @@ julia> nullspace(M) 0.0 1.0 -julia> nullspace(M, 2) +julia> nullspace(M, rtol=3) 3×3 Array{Float64,2}: 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 + +julia> nullspace(M, atol=0.95) +3×1 Array{Float64,2}: + 0.0 + 0.0 + 1.0 ``` """ -function nullspace(A::AbstractMatrix, rtol::Real = min(size(A)...)*eps(real(float(one(eltype(A)))))) +function nullspace(A::AbstractMatrix; atol::Real = 0.0, rtol::Real = (min(size(A)...)*eps(real(float(one(eltype(A))))))*iszero(atol)) m, n = size(A) (m == 0 || n == 0) && return Matrix{eltype(A)}(I, n, n) SVD = svd(A, full=true) - indstart = sum(s -> s .> SVD.S[1]*rtol, SVD.S) + 1 + tol = max(atol, SVD.S[1]*rtol) + indstart = sum(s -> s .> tol, SVD.S) + 1 return copy(SVD.Vt[indstart:end,:]') end -nullspace(a::AbstractVector, rtol::Real = min(size(a)...)*eps(real(float(one(eltype(a)))))) = nullspace(reshape(a, length(a), 1), rtol) + +nullspace(A::AbstractVector; atol::Real = 0.0, rtol::Real = (min(size(A)...)*eps(real(float(one(eltype(A))))))*iszero(atol)) = nullspace(reshape(A, length(A), 1), rtol= rtol, atol= atol) """ cond(M, p::Real=2) diff --git a/stdlib/LinearAlgebra/src/deprecated.jl b/stdlib/LinearAlgebra/src/deprecated.jl index b56241c2ab918..28c090634a2d8 100644 --- a/stdlib/LinearAlgebra/src/deprecated.jl +++ b/stdlib/LinearAlgebra/src/deprecated.jl @@ -2,3 +2,6 @@ # To be deprecated in 2.0 rank(A::AbstractMatrix, tol::Real) = rank(A,rtol=tol) +nullspace(A::AbstractVector, tol::Real) = nullspace(reshape(A, length(A), 1), rtol= tol) +nullspace(A::AbstractMatrix, tol::Real) = nullspace(A, rtol=tol) +pinv(A::AbstractMatrix{T}, tol::Real) where T = pinv(A, rtol=tol) diff --git a/stdlib/LinearAlgebra/test/dense.jl b/stdlib/LinearAlgebra/test/dense.jl index 8f2dbb9760db3..ccff54921f58c 100644 --- a/stdlib/LinearAlgebra/test/dense.jl +++ b/stdlib/LinearAlgebra/test/dense.jl @@ -72,6 +72,8 @@ bimg = randn(n,2)/2 @test norm(a[:,1:n1]'a15null,Inf) ≈ zero(eltya) atol=300ε @test norm(a15null'a[:,1:n1],Inf) ≈ zero(eltya) atol=400ε @test size(nullspace(b), 2) == 0 + @test size(nullspace(b, rtol=0.001), 2) == 0 + @test size(nullspace(b, atol=100*εb), 2) == 0 @test size(nullspace(b, 100*εb), 2) == 0 @test nullspace(zeros(eltya,n)) == Matrix(I, 1, 1) @test nullspace(zeros(eltya,n), 0.1) == Matrix(I, 1, 1) @@ -82,6 +84,12 @@ bimg = randn(n,2)/2 end end # for eltyb +@testset "Test pinv (rtol, atol)" begin + M = [1 0 0; 0 1 0; 0 0 0] + @test pinv(M,atol=1)== zeros(3,3) + @test pinv(M,rtol=0.5)== M +end + for (a, a2) in ((copy(ainit), copy(ainit2)), (view(ainit, 1:n, 1:n), view(ainit2, 1:n, 1:n))) @testset "Test pinv" begin pinva15 = pinv(a[:,1:n1]) From adadb3112596cf22fef969b25678517b4c718e16 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 11 Dec 2018 14:23:42 -0500 Subject: [PATCH 17/65] use non Pkg for workflow (#30194) (cherry picked from commit 560e82906d9afdd6b841208160eeb70a85c63eb2) --- doc/src/manual/workflow-tips.md | 106 ++++++++++++++------------------ 1 file changed, 45 insertions(+), 61 deletions(-) diff --git a/doc/src/manual/workflow-tips.md b/doc/src/manual/workflow-tips.md index 8cae4cefb0635..cdc74a45a68ff 100644 --- a/doc/src/manual/workflow-tips.md +++ b/doc/src/manual/workflow-tips.md @@ -8,75 +8,59 @@ As already elaborated in [The Julia REPL](@ref), Julia's REPL provides rich func that facilitates an efficient interactive workflow. Here are some tips that might further enhance your experience at the command line. -## Command-line-based basic editor/REPL workflow +### A basic editor/REPL workflow The most basic Julia workflows involve using a text editor in conjunction with the `julia` command line. A common pattern includes the following elements: - * **Generate a new project** - - ``` - $ julia -e 'using Pkg;Pkg.generate("Tmp")' -Generating project Tmp: - Tmp/Project.toml - Tmp/src/Tmp.jl - $ ls -R Tmp -Tmp: -Project.toml src - -Tmp/src: -Tmp.jl - $ cat -n Tmp/src/Tmp.jl - 1 module Tmp - 2 - 3 greet() = print("Hello World!") - 4 - 5 end # module - ``` - - * **Create a test folder** - ``` - $ mkdir Tmp/test - ``` - * **Put your test code in `test/runtests.jl` file.** + * **Put code under development in a temporary module.** Create a file, say `Tmp.jl`, and include + within it + ```julia + module Tmp + export say_hello + + say_hello() = println("Hello!") + + # your other definitions here + + end ``` - $ cat -n Tmp/test/runtests.jl - 1 using Tmp - 2 Tmp.greet() + * **Put your test code in another file.** Create another file, say `tst.jl`, which looks like + + ```julia + include("Tmp.jl") + import .Tmp + # using .Tmp # we can use `using` to bring the exported symbols in `Tmp` into our namespace + + Tmp.say_hello() + # say_hello() + + # your other test code here ``` - * **Run test** - ``` - $ julia -e 'using Pkg;Pkg.activate("Tmp");Pkg.test()' - Updating registry at `~/.julia/registries/General` - Updating git-repo `https://github.com/JuliaRegistries/General.git` - Resolving package versions... - Updating `~/Tmp/Project.toml` - [no changes] - Testing Tmp - Resolving package versions... -Hello World! Testing Tmp tests passed - ``` - * **Lather. Rinse. Repeat.** Explore ideas at the `julia` command prompt. Save good ideas in `Tmp.jl` and test with `runtests.jl`. - -## Simplify initialization - -To simplify restarting the REPL, put project-specific initialization code in a file, say `_init.jl`, -which you can run on startup by issuing the command: - -``` -julia -L _init.jl -``` - -If you further add the following to your `~/.julia/config/startup.jl` file - -```julia -isfile("_init.jl") && include(joinpath(pwd(), "_init.jl")) -``` - -then calling `julia` from that directory will run the initialization code without the additional -command line argument. + and includes tests for the contents of `Tmp`. + Alternatively, you can wrap the contents of your test file in a module, as + + ```julia + module Tst + include("Tmp.jl") + import .Tmp + #using .Tmp + + Tmp.say_hello() + # say_hello() + + # your other test code here + end + ``` + + The advantage is that your testing code is now contained in a module and does not use the global scope in `Main` for + definitions, which is a bit more tidy. + + * `include` the `tst.jl` file in the Julia REPL with `include("tst.jl")`. + + * **Lather. Rinse. Repeat.** Explore ideas at the `julia` command prompt. Save good ideas in `tst.jl`. To execute `tst.jl` after it has been changed, just `include` it again. ## Browser-based workflow From 5ccafa93767cb9cc3d2cec62cfa219adbffbb936 Mon Sep 17 00:00:00 2001 From: Rafael Fourquet Date: Tue, 11 Dec 2018 23:39:17 +0100 Subject: [PATCH 18/65] fix bug with max_values in union! (#30315) (cherry picked from commit f49cb42fb06492765f6320f3161e8363be5b7ada) --- base/abstractset.jl | 6 ++++-- test/sets.jl | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/base/abstractset.jl b/base/abstractset.jl index 32aeb0c0f0230..4083c88de99c7 100644 --- a/base/abstractset.jl +++ b/base/abstractset.jl @@ -69,9 +69,11 @@ function union!(s::AbstractSet, sets...) end max_values(::Type) = typemax(Int) -max_values(T::Type{<:Union{Nothing,BitIntegerSmall}}) = 1 << (8*sizeof(T)) -max_values(T::Union) = max(max_values(T.a), max_values(T.b)) +max_values(T::Union{map(X -> Type{X}, BitIntegerSmall_types)...}) = 1 << (8*sizeof(T)) +# saturated addition to prevent overflow with typemax(Int) +max_values(T::Union) = max(max_values(T.a), max_values(T.b), max_values(T.a) + max_values(T.b)) max_values(::Type{Bool}) = 2 +max_values(::Type{Nothing}) = 1 function union!(s::AbstractSet{T}, itr) where T haslength(itr) && sizehint!(s, length(s) + length(itr)) diff --git a/test/sets.jl b/test/sets.jl index ebe9db8ba90d9..2e5448d989d9d 100644 --- a/test/sets.jl +++ b/test/sets.jl @@ -628,6 +628,27 @@ end end end +@testset "optimized union! with max_values" begin + # issue #30315 + T = Union{Nothing, Bool} + @test Base.max_values(T) == 3 + d = Set{T}() + union!(d, (nothing, true, false)) + @test length(d) == 3 + @test d == Set((nothing, true, false)) + @test nothing in d + @test true in d + @test false in d + + for X = (Int8, Int16, Int32, Int64) + @test Base.max_values(Union{Nothing, X}) == (sizeof(X) < sizeof(Int) ? + 2^(8*sizeof(X)) + 1 : + typemax(Int)) + end + # this does not account for non-empty intersections of the unioned types + @test Base.max_values(Union{Int8,Int16}) == 2^8 + 2^16 +end + struct OpenInterval{T} lower::T upper::T From 485ed6592b0cf7a96aac37800d1dfaab81157edc Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Wed, 12 Dec 2018 10:50:03 +0100 Subject: [PATCH 19/65] Force specialization on the type argument of `_similar_for` (#30331) (cherry picked from commit 891e2abdd778ae053451863f0ee81950834f881c) --- base/array.jl | 10 ++++++---- base/dict.jl | 3 ++- base/set.jl | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/base/array.jl b/base/array.jl index a8256ec8ff99a..f13c6ee08358e 100644 --- a/base/array.jl +++ b/base/array.jl @@ -512,10 +512,12 @@ function _collect(::Type{T}, itr, isz::SizeUnknown) where T end # make a collection similar to `c` and appropriate for collecting `itr` -_similar_for(c::AbstractArray, T, itr, ::SizeUnknown) = similar(c, T, 0) -_similar_for(c::AbstractArray, T, itr, ::HasLength) = similar(c, T, Int(length(itr)::Integer)) -_similar_for(c::AbstractArray, T, itr, ::HasShape) = similar(c, T, axes(itr)) -_similar_for(c, T, itr, isz) = similar(c, T) +_similar_for(c::AbstractArray, ::Type{T}, itr, ::SizeUnknown) where {T} = similar(c, T, 0) +_similar_for(c::AbstractArray, ::Type{T}, itr, ::HasLength) where {T} = + similar(c, T, Int(length(itr)::Integer)) +_similar_for(c::AbstractArray, ::Type{T}, itr, ::HasShape) where {T} = + similar(c, T, axes(itr)) +_similar_for(c, ::Type{T}, itr, isz) where {T} = similar(c, T) """ collect(collection) diff --git a/base/dict.jl b/base/dict.jl index 3f52110e8b8f9..fb27cc10cc04d 100644 --- a/base/dict.jl +++ b/base/dict.jl @@ -760,4 +760,5 @@ isempty(t::ImmutableDict) = !isdefined(t, :parent) empty(::ImmutableDict, ::Type{K}, ::Type{V}) where {K, V} = ImmutableDict{K,V}() _similar_for(c::Dict, ::Type{Pair{K,V}}, itr, isz) where {K, V} = empty(c, K, V) -_similar_for(c::AbstractDict, T, itr, isz) = throw(ArgumentError("for AbstractDicts, similar requires an element type of Pair;\n if calling map, consider a comprehension instead")) +_similar_for(c::AbstractDict, ::Type{T}, itr, isz) where {T} = + throw(ArgumentError("for AbstractDicts, similar requires an element type of Pair;\n if calling map, consider a comprehension instead")) diff --git a/base/set.jl b/base/set.jl index c53c50610c40f..0ed73407ca6b1 100644 --- a/base/set.jl +++ b/base/set.jl @@ -34,7 +34,7 @@ empty(s::AbstractSet{T}, ::Type{U}=T) where {T,U} = Set{U}() # by default, a Set is returned emptymutable(s::AbstractSet{T}, ::Type{U}=T) where {T,U} = Set{U}() -_similar_for(c::AbstractSet, T, itr, isz) = empty(c, T) +_similar_for(c::AbstractSet, ::Type{T}, itr, isz) where {T} = empty(c, T) function show(io::IO, s::Set) print(io, "Set(") From 7a26d7b966f28a589ec20b47cd29bfb449736756 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Wed, 12 Dec 2018 09:02:07 -0800 Subject: [PATCH 20/65] Allow dotted binary tilde (#30351) The expression `x .~ y` now parses. Currently it's a syntax error. (cherry picked from commit 8965a81bcb113be0909a8366dc9c854de2f0bbaf) --- NEWS.md | 1 + src/julia-parser.scm | 5 +++-- test/parse.jl | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8ec6cf567e752..9fb48d3a00af9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,7 @@ New language features the experimental function `Base.catch_stack` ([#28878]). * The experimental macro `Base.@locals` returns a dictionary of current local variable names and values ([#29733]). + * Binary `~` can now be dotted, as in `x .~ y` ([#30341]). Language changes ---------------- diff --git a/src/julia-parser.scm b/src/julia-parser.scm index 8cd3564f7869d..37e6a24dde122 100644 --- a/src/julia-parser.scm +++ b/src/julia-parser.scm @@ -8,7 +8,8 @@ ;; be an operator. (define prec-assignment (append! (add-dots '(= += -= *= /= //= |\\=| ^= ÷= %= <<= >>= >>>= |\|=| &= ⊻= ≔ ⩴ ≕)) - '(:= ~ $=))) + (add-dots '(~)) + '(:= $=))) ;; comma - higher than assignment outside parentheses, lower when inside (define prec-pair (add-dots '(=>))) (define prec-conditional '(?)) @@ -742,7 +743,7 @@ ex (begin (take-token s) - (cond ((eq? t '~) ;; ~ is the only non-syntactic assignment-precedence operators + (cond ((or (eq? t '~) (eq? t '|.~|)) ;; ~ is the only non-syntactic assignment-precedence operators (if (and space-sensitive (ts:space? s) (not (space-before-next-token? s))) (begin (ts:put-back! s t (ts:space? s)) diff --git a/test/parse.jl b/test/parse.jl index 00d6ced46a26c..45e13a95b7f90 100644 --- a/test/parse.jl +++ b/test/parse.jl @@ -332,3 +332,9 @@ end @test_throws ArgumentError parse(Bool, "2") @test_throws ArgumentError parse(Bool, "02") end + +@testset "issue #30341" begin + @test Meta.parse("x .~ y") == Expr(:call, :.~, :x, :y) + # Ensure dotting binary doesn't break dotting unary + @test Meta.parse(".~[1,2]") == Expr(:call, :.~, Expr(:vect, 1, 2)) +end From 7b9c0e814d7b092e647707ad5301d6e1bfac896a Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Wed, 12 Dec 2018 11:05:56 -0800 Subject: [PATCH 21/65] Add compat annotation for NaN handling in (l|r)mul! (#30361) (cherry picked from commit 797ddbb87aa4a36ce0ea00693801f605fdb88cbc) --- stdlib/LinearAlgebra/src/generic.jl | 28 ++++++++++++++++++++++++++-- stdlib/LinearAlgebra/test/generic.jl | 12 ++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/stdlib/LinearAlgebra/src/generic.jl b/stdlib/LinearAlgebra/src/generic.jl index 77de34bb84fb9..cdbffcf2665bc 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -31,7 +31,15 @@ mul!(C::AbstractArray, X::AbstractArray, s::Number) = generic_mul!(C, s, X) """ rmul!(A::AbstractArray, b::Number) -Scale an array `A` by a scalar `b` overwriting `A` in-place. +Scale an array `A` by a scalar `b` overwriting `A` in-place. Use +[`lmul!`](@ref) to multiply scalar from left. The scaling operation +respects the semantics of the multiplication [`*`](@ref) between an +element of `A` and `b`. In particular, this also applies to +multiplication involving non-finite numbers such as `NaN` and `±Inf`. + +!!! compat "Julia 1.1" + Prior to Julia 1.1, `NaN` and `±Inf` entries in `A` were treated + inconsistently. # Examples ```jldoctest @@ -44,6 +52,10 @@ julia> rmul!(A, 2) 2×2 Array{Int64,2}: 2 4 6 8 + +julia> rmul!([NaN], 0.0) +1-element Array{Float64,1}: + NaN ``` """ function rmul!(X::AbstractArray, s::Number) @@ -57,7 +69,15 @@ end """ lmul!(a::Number, B::AbstractArray) -Scale an array `B` by a scalar `a` overwriting `B` in-place. +Scale an array `B` by a scalar `a` overwriting `B` in-place. Use +[`rmul!`](@ref) to multiply scalar from right. The scaling operation +respects the semantics of the multiplication [`*`](@ref) between `a` +and an element of `B`. In particular, this also applies to +multiplication involving non-finite numbers such as `NaN` and `±Inf`. + +!!! compat "Julia 1.1" + Prior to Julia 1.1, `NaN` and `±Inf` entries in `B` were treated + inconsistently. # Examples ```jldoctest @@ -70,6 +90,10 @@ julia> lmul!(2, B) 2×2 Array{Int64,2}: 2 4 6 8 + +julia> lmul!(0.0, [Inf]) +1-element Array{Float64,1}: + NaN ``` """ function lmul!(s::Number, X::AbstractArray) diff --git a/stdlib/LinearAlgebra/test/generic.jl b/stdlib/LinearAlgebra/test/generic.jl index 8facc9a94142b..40f8e201ec288 100644 --- a/stdlib/LinearAlgebra/test/generic.jl +++ b/stdlib/LinearAlgebra/test/generic.jl @@ -389,4 +389,16 @@ end @test LinearAlgebra.peakflops() > 0 end +@testset "NaN handling: Issue 28972" begin + @test all(isnan, rmul!([NaN], 0.0)) + @test all(isnan, rmul!(Any[NaN], 0.0)) + @test all(isnan, lmul!(0.0, [NaN])) + @test all(isnan, lmul!(0.0, Any[NaN])) + + @test all(!isnan, rmul!([NaN], false)) + @test all(!isnan, rmul!(Any[NaN], false)) + @test all(!isnan, lmul!(false, [NaN])) + @test all(!isnan, lmul!(false, Any[NaN])) +end + end # module TestGeneric From a2dcfe6a6bde28214dc0488a67b1101e9d835511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Besan=C3=A7on?= Date: Wed, 12 Dec 2018 20:06:25 +0100 Subject: [PATCH 22/65] added doc for AbstractChannel (#30347) (cherry picked from commit dda64505b083704f190040333135807d96fe1743) --- base/channels.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/channels.jl b/base/channels.jl index 090fad3ad877f..e8cf5a977dfbe 100644 --- a/base/channels.jl +++ b/base/channels.jl @@ -1,5 +1,10 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +""" + AbstractChannel{T} + +Representation of a channel passing objects of type `T`. +""" abstract type AbstractChannel{T} end """ From a9c886a1603e2a49b6ccf7f56ae1453754ab675c Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Wed, 12 Dec 2018 20:10:42 +0000 Subject: [PATCH 23/65] Update references to Base.SparseArrays (#30057) (cherry picked from commit a5f23c0dce6dd9fed6c0ec5eae8256eeda7406d9) --- stdlib/SparseArrays/src/sparsematrix.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/SparseArrays/src/sparsematrix.jl b/stdlib/SparseArrays/src/sparsematrix.jl index fe73825db4d18..1832edfea1c22 100644 --- a/stdlib/SparseArrays/src/sparsematrix.jl +++ b/stdlib/SparseArrays/src/sparsematrix.jl @@ -517,7 +517,7 @@ supplied, `combine` defaults to `+` unless the elements of `V` are Booleans in w elements of `J` must satisfy `1 <= J[k] <= n`. Numerical zeros in (`I`, `J`, `V`) are retained as structural nonzeros; to drop numerical zeros, use [`dropzeros!`](@ref). -For additional documentation and an expert driver, see `Base.SparseArrays.sparse!`. +For additional documentation and an expert driver, see `SparseArrays.sparse!`. # Examples ```jldoctest @@ -903,7 +903,7 @@ to generate intermediate result `(AQ)^T` (`transpose(A[:,q])`) in `C`. (2) Colum The first step is a call to `halfperm!`, and the second is a variant on `halfperm!` that avoids an unnecessary length-`nnz(A)` array-sweep and associated recomputation of column -pointers. See [`halfperm!`](:func:Base.SparseArrays.halfperm!) for additional algorithmic +pointers. See [`halfperm!`](:func:SparseArrays.halfperm!) for additional algorithmic information. See also: `unchecked_aliasing_permute!` @@ -1215,7 +1215,7 @@ julia> A = sparse(Diagonal([1, 2, 3, 4])) [3, 3] = 3 [4, 4] = 4 -julia> Base.SparseArrays.fkeep!(A, (i, j, v) -> isodd(v)) +julia> SparseArrays.fkeep!(A, (i, j, v) -> isodd(v)) 4×4 SparseMatrixCSC{Int64,Int64} with 2 stored entries: [1, 1] = 1 [3, 3] = 3 @@ -2924,7 +2924,7 @@ julia> A = sparse([1 2; 0 0]) [1, 1] = 1 [1, 2] = 2 -julia> Base.SparseArrays.dropstored!(A, 1, 2); A +julia> SparseArrays.dropstored!(A, 1, 2); A 2×2 SparseMatrixCSC{Int64,Int64} with 1 stored entry: [1, 1] = 1 ``` @@ -2964,7 +2964,7 @@ julia> A = sparse(Diagonal([1, 2, 3, 4])) [3, 3] = 3 [4, 4] = 4 -julia> Base.SparseArrays.dropstored!(A, [1, 2], [1, 1]) +julia> SparseArrays.dropstored!(A, [1, 2], [1, 1]) 4×4 SparseMatrixCSC{Int64,Int64} with 3 stored entries: [2, 2] = 2 [3, 3] = 3 From 28d9ec2725e594161d9851108396a5afc1b60ad1 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 12 Dec 2018 17:34:10 -0500 Subject: [PATCH 24/65] codegen: disable Bool optimization for maybe-undef fields (#30350) We don't have a way to mark that the slot may contain invalid data, so just eagerly load it so we can sanitize the value immediately in case it is garbage. fix #30344 (cherry picked from commit 897df7220f032f1451bf39778a79b9d2523c893c) --- base/boot.jl | 4 ++-- src/cgutils.cpp | 8 ++++---- src/runtime_intrinsics.c | 2 -- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/base/boot.jl b/base/boot.jl index 0f0d0b6d0851e..63c7f4b5b4821 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -624,7 +624,7 @@ toInt8(x::UInt16) = checked_trunc_sint(Int8, check_top_bit(x)) toInt8(x::UInt32) = checked_trunc_sint(Int8, check_top_bit(x)) toInt8(x::UInt64) = checked_trunc_sint(Int8, check_top_bit(x)) toInt8(x::UInt128) = checked_trunc_sint(Int8, check_top_bit(x)) -toInt8(x::Bool) = and_int(zext_int(Int8, x), Int8(1)) +toInt8(x::Bool) = and_int(bitcast(Int8, x), Int8(1)) toInt16(x::Int8) = sext_int(Int16, x) toInt16(x::Int16) = x toInt16(x::Int32) = checked_trunc_sint(Int16, x) @@ -679,7 +679,7 @@ toUInt8(x::UInt16) = checked_trunc_uint(UInt8, x) toUInt8(x::UInt32) = checked_trunc_uint(UInt8, x) toUInt8(x::UInt64) = checked_trunc_uint(UInt8, x) toUInt8(x::UInt128) = checked_trunc_uint(UInt8, x) -toUInt8(x::Bool) = and_int(zext_int(UInt8, x), UInt8(1)) +toUInt8(x::Bool) = and_int(bitcast(UInt8, x), UInt8(1)) toUInt16(x::Int8) = sext_int(UInt16, check_top_bit(x)) toUInt16(x::Int16) = bitcast(UInt16, check_top_bit(x)) toUInt16(x::Int32) = checked_trunc_uint(UInt16, x) diff --git a/src/cgutils.cpp b/src/cgutils.cpp index 946065c7e6273..33373416d7ebc 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -1425,10 +1425,10 @@ static bool emit_getfield_unknownidx(jl_codectx_t &ctx, Value *idx, jl_datatype_t *stt, jl_value_t *inbounds) { size_t nfields = jl_datatype_nfields(stt); + bool maybe_null = (unsigned)stt->ninitialized != nfields; if (strct.ispointer()) { // boxed or stack if (is_datatype_all_pointers(stt)) { idx = emit_bounds_check(ctx, strct, (jl_value_t*)stt, idx, ConstantInt::get(T_size, nfields), inbounds); - bool maybe_null = (unsigned)stt->ninitialized != nfields; size_t minimum_field_size = std::numeric_limits::max(); size_t minimum_align = JL_HEAP_ALIGNMENT; for (size_t i = 0; i < nfields; ++i) { @@ -1458,7 +1458,7 @@ static bool emit_getfield_unknownidx(jl_codectx_t &ctx, jl_value_t *jt = jl_field_type(stt, 0); idx = emit_bounds_check(ctx, strct, (jl_value_t*)stt, idx, ConstantInt::get(T_size, nfields), inbounds); Value *ptr = maybe_decay_tracked(data_pointer(ctx, strct)); - if (!stt->mutabl) { + if (!stt->mutabl && !(maybe_null && jt == (jl_value_t*)jl_bool_type)) { // just compute the pointer and let user load it when necessary Type *fty = julia_type_to_llvm(jt); Value *addr = ctx.builder.CreateInBoundsGEP(fty, emit_bitcast(ctx, ptr, PointerType::get(fty, 0)), idx); @@ -1512,6 +1512,7 @@ static jl_cgval_t emit_getfield_knownidx(jl_codectx_t &ctx, const jl_cgval_t &st if (type_is_ghost(elty)) return ghostValue(jfty); Value *fldv = NULL; + bool maybe_null = idx >= (unsigned)jt->ninitialized; if (strct.ispointer()) { Value *staddr = maybe_decay_tracked(data_pointer(ctx, strct)); bool isboxed; @@ -1553,7 +1554,6 @@ static jl_cgval_t emit_getfield_knownidx(jl_codectx_t &ctx, const jl_cgval_t &st } unsigned align = jl_field_align(jt, idx); if (jl_field_isptr(jt, idx)) { - bool maybe_null = idx >= (unsigned)jt->ninitialized; Instruction *Load = maybe_mark_load_dereferenceable( ctx.builder.CreateLoad(T_prjlvalue, emit_bitcast(ctx, addr, T_pprjlvalue)), maybe_null, jl_field_type(jt, idx)); @@ -1586,7 +1586,7 @@ static jl_cgval_t emit_getfield_knownidx(jl_codectx_t &ctx, const jl_cgval_t &st } return mark_julia_slot(addr, jfty, tindex, strct.tbaa); } - else if (!jt->mutabl) { + else if (!jt->mutabl && !(maybe_null && jfty == (jl_value_t*)jl_bool_type)) { // just compute the pointer and let user load it when necessary return mark_julia_slot(addr, jfty, NULL, strct.tbaa); } diff --git a/src/runtime_intrinsics.c b/src/runtime_intrinsics.c index 22f8866f143a5..d43ae3d5ff9af 100644 --- a/src/runtime_intrinsics.c +++ b/src/runtime_intrinsics.c @@ -400,8 +400,6 @@ static inline jl_value_t *jl_intrinsic_cvt(jl_value_t *ty, jl_value_t *a, const void *pr = alloca(osize); unsigned isize_bits = isize * host_char_bit; unsigned osize_bits = osize * host_char_bit; - if (aty == (jl_value_t*)jl_bool_type) - isize_bits = 1; op(isize_bits, pa, osize_bits, pr); return jl_new_bits(ty, pr); } From f4d8ce1e73acd2f88c613abb4c98650528a92a38 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 12 Dec 2018 17:35:09 -0500 Subject: [PATCH 25/65] fix #30346, specificity issue with DynamicPolynomials (#30360) (cherry picked from commit e4aa541ee66282aefe49ba3aa751b170b463d4f6) --- src/subtype.c | 25 +++---------------------- test/specificity.jl | 12 ++++++++++-- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/subtype.c b/src/subtype.c index 56ce9ee96258c..6e4e3729ad437 100644 --- a/src/subtype.c +++ b/src/subtype.c @@ -322,26 +322,6 @@ static int obviously_disjoint(jl_value_t *a, jl_value_t *b, int specificity) for(i=0; i < np; i++) { jl_value_t *ai = jl_tparam(ad,i); jl_value_t *bi = jl_tparam(bd,i); - if (!istuple && specificity && jl_has_free_typevars(ai)) { - // X{<:SomeDataType} and X{Union{Y,Z,...}} need to be disjoint to - // avoid this transitivity problem: - // A = Tuple{Type{LinearIndices{N,R}}, LinearIndices{N}} where {N,R} - // B = Tuple{Type{T},T} where T<:AbstractArray - // C = Tuple{Type{Union{Nothing, T}}, Union{Nothing, T}} where T - // A is more specific than B. It would be easy to think B is more specific - // than C, but we can't have that since A should not be more specific than C. - jl_value_t *aub = jl_is_typevar(ai) ? ((jl_tvar_t*)ai)->ub : ai; - jl_value_t *bub = jl_is_typevar(bi) ? ((jl_tvar_t*)bi)->ub : bi; - aub = jl_unwrap_unionall(aub); - bub = jl_unwrap_unionall(bub); - if ((jl_is_typevar(ai) + jl_is_typevar(bi) < 2) && - aub != (jl_value_t*)jl_any_type && bub != (jl_value_t*)jl_any_type && - ((jl_is_uniontype(aub) && jl_is_datatype(bub) && !in_union(aub, bub) && - (jl_is_typevar(bi) || !jl_is_typevar(ai))) || - (jl_is_uniontype(bub) && jl_is_datatype(aub) && !in_union(bub, aub) && - (jl_is_typevar(ai) || !jl_is_typevar(bi))))) - return 1; - } if (jl_is_typevar(ai) || jl_is_typevar(bi)) continue; if (jl_is_type(ai)) { @@ -2883,8 +2863,9 @@ static int type_morespecific_(jl_value_t *a, jl_value_t *b, int invariant, jl_ty if (((jl_tvar_t*)b)->ub == jl_bottom_type) return 0; if (jl_has_free_typevars(a)) { - if (type_morespecific_(a, ((jl_tvar_t*)b)->ub, 0, env) || - eq_msp(a, ((jl_tvar_t*)b)->ub, env)) + if (type_morespecific_(a, ((jl_tvar_t*)b)->ub, 0, env)) + return 1; + if (eq_msp(a, ((jl_tvar_t*)b)->ub, env)) return num_occurs((jl_tvar_t*)b, env) < 2; return 0; } diff --git a/test/specificity.jl b/test/specificity.jl index 95c01b288b74b..a34ed8a15eccb 100644 --- a/test/specificity.jl +++ b/test/specificity.jl @@ -230,8 +230,8 @@ let N = Tuple{Type{Union{Nothing, T}}, Union{Nothing, T}} where T, LI = Tuple{Type{LinearIndices{N,R}}, LinearIndices{N}} where {N,R}, A = Tuple{Type{T},T} where T<:AbstractArray @test args_morespecific(LI, A) - @test !args_morespecific(A, N) - @test !args_morespecific(LI, N) + @test args_morespecific(A, N) + @test args_morespecific(LI, N) end # issue #29528 @@ -298,3 +298,11 @@ end @test args_morespecific(Tuple{Type{Missing},Any}, Tuple{Type{Union{Nothing, T}},Any} where T) + +let A = Tuple{Type{SubString{S}},AbstractString} where S<:AbstractString, + B = Tuple{Type{T},AbstractString} where T<:AbstractString, + C = Tuple{Type{Union{Missing, Nothing, T}},Union{Missing, Nothing, T}} where T + @test args_morespecific(A, B) + @test args_morespecific(B, C) + @test args_morespecific(A, C) +end From 9cb1b0e28bcb044ef357b0bae8c1c7f5b0e8e412 Mon Sep 17 00:00:00 2001 From: Don March Date: Wed, 12 Dec 2018 18:41:56 -0500 Subject: [PATCH 26/65] Copy editing in "Environment variables" docs (#30330) (cherry picked from commit 99b7b75ed08c71aa4be0a64111909cc5d2032e33) --- doc/src/manual/environment-variables.md | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/src/manual/environment-variables.md b/doc/src/manual/environment-variables.md index d92260dd376ff..7bc47ba43ed2a 100644 --- a/doc/src/manual/environment-variables.md +++ b/doc/src/manual/environment-variables.md @@ -1,25 +1,26 @@ # Environment Variables -Julia may be configured with a number of environment variables, either in the -usual way of the operating system, or in a portable way from within Julia. -Suppose you want to set the environment variable `JULIA_EDITOR` to -`vim`, then either type `ENV["JULIA_EDITOR"] = "vim"` for instance in the REPL -to make this change on a case by case basis, or add the same to the user -configuration file `~/.julia/config/startup.jl` in the user's home directory to have -a permanent effect. The current value of the same environment variable is +Julia can be configured with a number of environment variables, set either in +the usual way for each operating system, or in a portable way from within Julia. +Supposing that you want to set the environment variable `JULIA_EDITOR` to `vim`, +you can type `ENV["JULIA_EDITOR"] = "vim"` (for instance, in the REPL) to make +this change on a case by case basis, or add the same to the user configuration +file `~/.julia/config/startup.jl` in the user's home directory to have a +permanent effect. The current value of the same environment variable can be determined by evaluating `ENV["JULIA_EDITOR"]`. The environment variables that Julia uses generally start with `JULIA`. If -[`InteractiveUtils.versioninfo`](@ref) is called with `verbose` equal to `true`, then the +[`InteractiveUtils.versioninfo`](@ref) is called with the keyword `verbose=true`, then the output will list defined environment variables relevant for Julia, including those for which `JULIA` appears in the name. !!! note - Some variables, such as `JULIA_NUM_THREADS` and `JULIA_PROJECT` need to be set before Julia + Some variables, such as `JULIA_NUM_THREADS` and `JULIA_PROJECT`, need to be set before Julia starts, therefore adding these to `~/.julia/config/startup.jl` is too late in the startup process. - These must either be set manually before launching Julia through bash with - `export JULIA_NUM_THREADS=4` etc. or added to `-/.bashrc` and/or `~/.bash_profile` to achieve persistence. + In Bash, environment variables can either be set manually by running, e.g., + `export JULIA_NUM_THREADS=4` before starting Julia, or by adding the same command to + `-/.bashrc` or `~/.bash_profile` to set the variable each time Bash is started. ## File locations @@ -76,7 +77,7 @@ and a global configuration search path of A directory path that points to the current Julia project. Setting this environment variable has the same effect as specifying the `--project` start-up -option, but `--project` has higher precedence. If the variable is set to `@.`, +option, but `--project` has higher precedence. If the variable is set to `@.` then Julia tries to find a project directory that contains `Project.toml` or `JuliaProject.toml` file from the current directory and its parents. See also the chapter on [Code Loading](@ref). @@ -88,8 +89,8 @@ the chapter on [Code Loading](@ref). ### `JULIA_LOAD_PATH` A separated list of absolute paths that are to be appended to the variable -[`LOAD_PATH`](@ref). (In Unix-like systems, the path separator is `:`; in -Windows systems, the path separator is `;`.) The `LOAD_PATH` variable is where +[`LOAD_PATH`](@ref). (In Unix-like systems, `:` is the path separator; in +Windows systems, `;` is the path separator.) The `LOAD_PATH` variable is where [`Base.require`](@ref) and `Base.load_in_path()` look for code; it defaults to the absolute path `$JULIA_HOME/../share/julia/stdlib/v$(VERSION.major).$(VERSION.minor)` so that, @@ -185,7 +186,7 @@ affinitized. Otherwise, Julia lets the operating system handle thread policy. Environment variables that determine how REPL output should be formatted at the terminal. Generally, these variables should be set to [ANSI terminal escape sequences](http://ascii-table.com/ansi-escape-sequences.php). Julia provides -a high-level interface with much of the same functionality: see the section on +a high-level interface with much of the same functionality; see the section on [The Julia REPL](@ref). ### `JULIA_ERROR_COLOR` @@ -283,11 +284,10 @@ event listener for just-in-time (JIT) profiling. This environment variable only has an effect if Julia was compiled with JIT profiling support, using either - -* Intel's [VTune™ Amplifier](https://software.intel.com/en-us/intel-vtune-amplifier-xe) - (`USE_INTEL_JITEVENTS` set to `1` in the build configuration), or -* [OProfile](http://oprofile.sourceforge.net/news/) (`USE_OPROFILE_JITEVENTS` set to `1` - in the build configuration). + * Intel's [VTune™ Amplifier](https://software.intel.com/en-us/intel-vtune-amplifier-xe) + (`USE_INTEL_JITEVENTS` set to `1` in the build configuration), or + * [OProfile](http://oprofile.sourceforge.net/news/) (`USE_OPROFILE_JITEVENTS` set to `1` + in the build configuration). ### `JULIA_LLVM_ARGS` From 98e83f65b16e36eaf29467aff4bf65d0edbb706a Mon Sep 17 00:00:00 2001 From: Samikshya Chand Date: Thu, 13 Dec 2018 19:59:37 +0530 Subject: [PATCH 27/65] Add Float16 comparisons (#29916) * Add Float16 comparisons * Add @eval * Add union * Add != to tests (cherry picked from commit 1d3c371636e159cb47e68783e8d6ac90feaaace0) --- base/float.jl | 17 ++++++++++------- test/numbers.jl | 10 ++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/base/float.jl b/base/float.jl index 81eb6a29b9c77..28254437c8c08 100644 --- a/base/float.jl +++ b/base/float.jl @@ -503,15 +503,18 @@ for Ti in (Int64,UInt64,Int128,UInt128) end end end +for op in (:(==), :<, :<=) + @eval begin + ($op)(x::Float16, y::Union{Int128,UInt128,Int64,UInt64}) = ($op)(Float64(x), Float64(y)) + ($op)(x::Union{Int128,UInt128,Int64,UInt64}, y::Float16) = ($op)(Float64(x), Float64(y)) -==(x::Float32, y::Union{Int32,UInt32}) = Float64(x)==Float64(y) -==(x::Union{Int32,UInt32}, y::Float32) = Float64(x)==Float64(y) - -<(x::Float32, y::Union{Int32,UInt32}) = Float64(x)= 1) From 7cbac0716a9f532247639c8fc87421935a52be94 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 13 Dec 2018 15:40:16 -0500 Subject: [PATCH 28/65] improve printf performance by passing digit buffer around (#30373) mostly fixes the regression identified in #30218 (cherry picked from commit e83693749032d28e9f5f0f75695fad46729ea2b4) --- base/printf.jl | 169 ++++++++++++++++++++++++------------------------- 1 file changed, 81 insertions(+), 88 deletions(-) diff --git a/base/printf.jl b/base/printf.jl index d3c714efb8444..b6b98187d495a 100644 --- a/base/printf.jl +++ b/base/printf.jl @@ -10,7 +10,8 @@ const SmallNumber = Union{SmallFloatingPoint,Base.BitInteger} function gen(s::AbstractString) args = [] - blk = Expr(:block, :(local neg, pt, len, exp, do_out, args)) + blk = Expr(:block, :(local neg, pt, len, exp, do_out, args, buf)) + gotbuf = false for x in parse(s) if isa(x,AbstractString) push!(blk.args, :(print(out, $(length(x)==1 ? x[1] : x)))) @@ -24,6 +25,10 @@ function gen(s::AbstractString) c=='s' ? gen_s : c=='p' ? gen_p : gen_d + if !gotbuf && c != 'c' && c != 's' && c != 'p' + push!(blk.args, :(buf = $Grisu.getbuf())) + gotbuf = true + end arg, ex = f(x...) push!(args, arg) push!(blk.args, ex) @@ -212,8 +217,8 @@ function print_fixed_width(precision, pt, ndigits, trailingzeros=true) end # note: if print_fixed is changed, print_fixed_width should be changed accordingly -function print_fixed(out, precision, pt, ndigits, trailingzeros=true) - pdigits = pointer(Grisu.getbuf()) +function print_fixed(out, precision, pt, ndigits, trailingzeros=true, buf = Grisu.getbuf()) + pdigits = pointer(buf) if pt <= 0 # 0.0dddd0 print(out, '0') @@ -302,7 +307,7 @@ function gen_d(flags::String, width::Int, precision::Int, c::Char) else fn = :decode_dec end - push!(blk.args, :((do_out, args) = $fn(out, $x, $flags, $width, $precision, $c))) + push!(blk.args, :((do_out, args) = $fn(out, $x, $flags, $width, $precision, $c, buf))) ifblk = Expr(:if, :do_out, Expr(:block)) push!(blk.args, ifblk) blk = ifblk.args[2] @@ -346,7 +351,7 @@ function gen_d(flags::String, width::Int, precision::Int, c::Char) push!(blk.args, pad(width-1, zeros, '0')) end # print integer - push!(blk.args, :(unsafe_write(out, pointer($Grisu.getbuf()), pt))) + push!(blk.args, :(unsafe_write(out, pointer(buf), pt))) # print padding if padding !== nothing && '-' in flags push!(blk.args, pad(width-precision, padding, ' ')) @@ -369,7 +374,7 @@ function gen_f(flags::String, width::Int, precision::Int, c::Char) x, ex, blk = special_handler(flags,width) # interpret the number if precision < 0; precision = 6; end - push!(blk.args, :((do_out, args) = fix_dec(out, $x, $flags, $width, $precision, $c))) + push!(blk.args, :((do_out, args) = fix_dec(out, $x, $flags, $width, $precision, $c, buf))) ifblk = Expr(:if, :do_out, Expr(:block)) push!(blk.args, ifblk) blk = ifblk.args[2] @@ -403,9 +408,9 @@ function gen_f(flags::String, width::Int, precision::Int, c::Char) end # print digits if precision > 0 - push!(blk.args, :(print_fixed(out,$precision,pt,len))) + push!(blk.args, :(print_fixed(out,$precision,pt,len,true,buf))) else - push!(blk.args, :(unsafe_write(out, pointer($Grisu.getbuf()), len))) + push!(blk.args, :(unsafe_write(out, pointer(buf), len))) push!(blk.args, :(while pt >= (len+=1) print(out,'0') end)) '#' in flags && push!(blk.args, :(print(out, '.'))) end @@ -439,8 +444,8 @@ function gen_e(flags::String, width::Int, precision::Int, c::Char, inside_g::Boo # interpret the number if precision < 0; precision = 6; end ndigits = min(precision+1,length(Grisu.getbuf())-1) - push!(blk.args, :((do_out, args) = ini_dec(out,$x,$ndigits, $flags, $width, $precision, $c))) - push!(blk.args, :(digits = $Grisu.getbuf())) + push!(blk.args, :((do_out, args) = ini_dec(out,$x,$ndigits, $flags, $width, $precision, $c, buf))) + push!(blk.args, :(digits = buf)) ifblk = Expr(:if, :do_out, Expr(:block)) push!(blk.args, ifblk) blk = ifblk.args[2] @@ -552,12 +557,12 @@ function gen_a(flags::String, width::Int, precision::Int, c::Char) end # if no precision, print max non-zero if precision < 0 - push!(blk.args, :((do_out, args) = $fn(out,$x, $flags, $width, $precision, $c))) + push!(blk.args, :((do_out, args) = $fn(out,$x, $flags, $width, $precision, $c, buf))) else ndigits = min(precision+1,length(Grisu.getbuf())-1) - push!(blk.args, :((do_out, args) = $fn(out,$x,$ndigits, $flags, $width, $precision, $c))) + push!(blk.args, :((do_out, args) = $fn(out,$x,$ndigits, $flags, $width, $precision, $c, buf))) end - push!(blk.args, :(digits = $Grisu.getbuf())) + push!(blk.args, :(digits = buf)) ifblk = Expr(:if, :do_out, Expr(:block)) push!(blk.args, ifblk) blk = ifblk.args[2] @@ -752,7 +757,7 @@ function gen_g(flags::String, width::Int, precision::Int, c::Char) if precision < 0; precision = 6; end ndigits = min(precision+1,length(Grisu.getbuf())-1) # See if anyone else wants to handle it - push!(blk.args, :((do_out, args) = ini_dec(out,$x,$ndigits, $flags, $width, $precision, $c))) + push!(blk.args, :((do_out, args) = ini_dec(out,$x,$ndigits, $flags, $width, $precision, $c, buf))) ifblk = Expr(:if, :do_out, Expr(:block)) push!(blk.args, ifblk) blk = ifblk.args[2] @@ -768,7 +773,7 @@ function gen_g(flags::String, width::Int, precision::Int, c::Char) # Follow the same logic as gen_f() but more work has to be deferred until runtime # because precision is unknown until then. push!(fblk.args, :(fprec = $precision - (exp+1))) - push!(fblk.args, :((do_out, args) = fix_dec(out, $x, $flags, $width, fprec, $c - 1))) + push!(fblk.args, :((do_out, args) = fix_dec(out, $x, $flags, $width, fprec, $c - 1, buf))) fifblk = Expr(:if, :do_out, Expr(:block)) push!(fblk.args, fifblk) blk = fifblk.args[2] @@ -800,7 +805,7 @@ function gen_g(flags::String, width::Int, precision::Int, c::Char) $padexpr; end)) end # finally print value - push!(blk.args, :(print_fixed(out,fprec,pt,len,$('#' in flags)))) + push!(blk.args, :(print_fixed(out,fprec,pt,len,$('#' in flags),buf))) # print space padding if '-' in flags padexpr = dynamic_pad(:width, :padding, ' ') @@ -828,25 +833,25 @@ macro handle_zero(ex, digits) end end -decode_oct(out, d, flags::String, width::Int, precision::Int, c::Char) = (true, decode_oct(d)) -decode_0ct(out, d, flags::String, width::Int, precision::Int, c::Char) = (true, decode_0ct(d)) -decode_dec(out, d, flags::String, width::Int, precision::Int, c::Char) = (true, decode_dec(d)) -decode_hex(out, d, flags::String, width::Int, precision::Int, c::Char) = (true, decode_hex(d)) -decode_HEX(out, d, flags::String, width::Int, precision::Int, c::Char) = (true, decode_HEX(d)) -fix_dec(out, d, flags::String, width::Int, precision::Int, c::Char) = (true, fix_dec(d, precision)) -ini_dec(out, d, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = (true, ini_dec(d, ndigits)) -ini_hex(out, d, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = (true, ini_hex(d, ndigits)) -ini_HEX(out, d, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = (true, ini_HEX(d, ndigits)) -ini_hex(out, d, flags::String, width::Int, precision::Int, c::Char) = (true, ini_hex(d)) -ini_HEX(out, d, flags::String, width::Int, precision::Int, c::Char) = (true, ini_HEX(d)) +decode_oct(out, d, flags::String, width::Int, precision::Int, c::Char, digits) = (true, decode_oct(d, digits)) +decode_0ct(out, d, flags::String, width::Int, precision::Int, c::Char, digits) = (true, decode_0ct(d, digits)) +decode_dec(out, d, flags::String, width::Int, precision::Int, c::Char, digits) = (true, decode_dec(d, digits)) +decode_hex(out, d, flags::String, width::Int, precision::Int, c::Char, digits) = (true, decode_hex(d, digits)) +decode_HEX(out, d, flags::String, width::Int, precision::Int, c::Char, digits) = (true, decode_HEX(d, digits)) +fix_dec(out, d, flags::String, width::Int, precision::Int, c::Char, digits) = (true, fix_dec(d, precision, digits)) +ini_dec(out, d, ndigits::Int, flags::String, width::Int, precision::Int, c::Char, digits) = (true, ini_dec(d, ndigits, digits)) +ini_hex(out, d, ndigits::Int, flags::String, width::Int, precision::Int, c::Char, digits) = (true, ini_hex(d, ndigits, digits)) +ini_HEX(out, d, ndigits::Int, flags::String, width::Int, precision::Int, c::Char, digits) = (true, ini_HEX(d, ndigits, digits)) +ini_hex(out, d, flags::String, width::Int, precision::Int, c::Char, digits) = (true, ini_hex(d, digits)) +ini_HEX(out, d, flags::String, width::Int, precision::Int, c::Char, digits) = (true, ini_HEX(d, digits)) # fallbacks for Real types without explicit decode_* implementation -decode_oct(d::Real) = decode_oct(Integer(d)) -decode_0ct(d::Real) = decode_0ct(Integer(d)) -decode_dec(d::Real) = decode_dec(Integer(d)) -decode_hex(d::Real) = decode_hex(Integer(d)) -decode_HEX(d::Real) = decode_HEX(Integer(d)) +decode_oct(d::Real, digits) = decode_oct(Integer(d), digits) +decode_0ct(d::Real, digits) = decode_0ct(Integer(d), digits) +decode_dec(d::Real, digits) = decode_dec(Integer(d), digits) +decode_hex(d::Real, digits) = decode_hex(Integer(d), digits) +decode_HEX(d::Real, digits) = decode_HEX(Integer(d), digits) handlenegative(d::Unsigned) = (false, d) function handlenegative(d::Integer) @@ -857,9 +862,8 @@ function handlenegative(d::Integer) end end -function decode_oct(d::Integer) +function decode_oct(d::Integer, digits) neg, x = handlenegative(d) - digits = Grisu.getbuf() @handle_zero x digits pt = i = div((sizeof(x)<<3)-leading_zeros(x)+2,3) while i > 0 @@ -870,11 +874,10 @@ function decode_oct(d::Integer) return Int32(pt), Int32(pt), neg end -function decode_0ct(d::Integer) +function decode_0ct(d::Integer, digits) neg, x = handlenegative(d) # doesn't need special handling for zero pt = i = div((sizeof(x)<<3)-leading_zeros(x)+5,3) - digits = Grisu.getbuf() while i > 0 digits[i] = 48+(x&0x7) x >>= 3 @@ -883,9 +886,8 @@ function decode_0ct(d::Integer) return Int32(pt), Int32(pt), neg end -function decode_dec(d::Integer) +function decode_dec(d::Integer, digits) neg, x = handlenegative(d) - digits = Grisu.getbuf() @handle_zero x digits pt = i = Base.ndigits0z(x) while i > 0 @@ -896,9 +898,8 @@ function decode_dec(d::Integer) return Int32(pt), Int32(pt), neg end -function decode_hex(d::Integer, symbols::AbstractArray{UInt8,1}) +function decode_hex(d::Integer, symbols::AbstractArray{UInt8,1}, digits) neg, x = handlenegative(d) - digits = Grisu.getbuf() @handle_zero x digits pt = i = (sizeof(x)<<1)-(leading_zeros(x)>>2) while i > 0 @@ -912,27 +913,25 @@ end const hex_symbols = b"0123456789abcdef" const HEX_symbols = b"0123456789ABCDEF" -decode_hex(x::Integer) = decode_hex(x,hex_symbols) -decode_HEX(x::Integer) = decode_hex(x,HEX_symbols) +decode_hex(x::Integer, digits) = decode_hex(x,hex_symbols,digits) +decode_HEX(x::Integer, digits) = decode_hex(x,HEX_symbols,digits) -function decode(b::Int, x::BigInt) +function decode(b::Int, x::BigInt, digits) neg = x.size < 0 pt = Base.ndigits(x, base=abs(b)) - digits = Grisu.getbuf() length(digits) < pt+1 && resize!(digits, pt+1) neg && (x.size = -x.size) GMP.MPZ.get_str!(digits, b, x) neg && (x.size = -x.size) return Int32(pt), Int32(pt), neg end -decode_oct(x::BigInt) = decode(8, x) -decode_dec(x::BigInt) = decode(10, x) -decode_hex(x::BigInt) = decode(16, x) -decode_HEX(x::BigInt) = decode(-16, x) +decode_oct(x::BigInt, digits) = decode(8, x, digits) +decode_dec(x::BigInt, digits) = decode(10, x, digits) +decode_hex(x::BigInt, digits) = decode(16, x, digits) +decode_HEX(x::BigInt, digits) = decode(-16, x, digits) -function decode_0ct(x::BigInt) +function decode_0ct(x::BigInt, digits) neg = x.size < 0 - digits = Grisu.getbuf() digits[1] = '0' if x.size == 0 return Int32(1), Int32(1), neg @@ -960,8 +959,7 @@ end # - implies len = point # -function decode_dec(x::SmallFloatingPoint) - digits = Grisu.getbuf() +function decode_dec(x::SmallFloatingPoint, digits) if x == 0.0 digits[1] = '0' return (Int32(1), Int32(1), false) @@ -986,12 +984,11 @@ end # # fallback for Real types without explicit fix_dec implementation -fix_dec(x::Real, n::Int) = fix_dec(float(x),n) +fix_dec(x::Real, n::Int, digits) = fix_dec(float(x),n,digits) -fix_dec(x::Integer, n::Int) = decode_dec(x) +fix_dec(x::Integer, n::Int, digits) = decode_dec(x, digits) -function fix_dec(x::SmallFloatingPoint, n::Int) - digits = Grisu.getbuf() +function fix_dec(x::SmallFloatingPoint, n::Int, digits) if n > length(digits)-1; n = length(digits)-1; end len,pt,neg = grisu(x,Grisu.FIXED,n,digits) if len == 0 @@ -1008,12 +1005,11 @@ end # # fallback for Real types without explicit fix_dec implementation -ini_dec(x::Real, n::Int) = ini_dec(float(x),n) +ini_dec(x::Real, n::Int, digits) = ini_dec(float(x),n,digits) -function ini_dec(d::Integer, n::Int) +function ini_dec(d::Integer, n::Int, digits) neg, x = handlenegative(d) k = ndigits(x) - digits = Grisu.getbuf() if k <= n pt = k for i = k:-1:1 @@ -1043,26 +1039,26 @@ function ini_dec(d::Integer, n::Int) return n, pt, neg end -function ini_dec(x::SmallFloatingPoint, n::Int) +function ini_dec(x::SmallFloatingPoint, n::Int, digits) if x == 0.0 - ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), Grisu.getbuf(), '0', n) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), digits, '0', n) return Int32(1), Int32(1), signbit(x) else - len,pt,neg = grisu(x,Grisu.PRECISION,n,Grisu.getbuf()) + len,pt,neg = grisu(x,Grisu.PRECISION,n,digits) end return Int32(len), Int32(pt), neg end -function ini_dec(x::BigInt, n::Int) +function ini_dec(x::BigInt, n::Int, digits) if x.size == 0 - ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), Grisu.getbuf(), '0', n) + ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), digits, '0', n) return Int32(1), Int32(1), false end d = Base.ndigits0z(x) if d <= n info = decode_dec(x) d == n && return info - p = convert(Ptr{Cvoid}, Grisu.getbuf()) + info[2] + p = convert(Ptr{Cvoid}, digits) + info[2] ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), p, '0', n - info[2]) return info end @@ -1070,18 +1066,17 @@ function ini_dec(x::BigInt, n::Int) end -ini_hex(x::Real, n::Int) = ini_hex(x,n,hex_symbols) -ini_HEX(x::Real, n::Int) = ini_hex(x,n,HEX_symbols) +ini_hex(x::Real, n::Int, digits) = ini_hex(x,n,hex_symbols,digits) +ini_HEX(x::Real, n::Int, digits) = ini_hex(x,n,HEX_symbols,digits) -ini_hex(x::Real) = ini_hex(x,hex_symbols) -ini_HEX(x::Real) = ini_hex(x,HEX_symbols) +ini_hex(x::Real, digits) = ini_hex(x,hex_symbols,digits) +ini_HEX(x::Real, digits) = ini_hex(x,HEX_symbols,digits) -ini_hex(x::Real, n::Int, symbols::AbstractArray{UInt8,1}) = ini_hex(float(x), n, symbols) -ini_hex(x::Real, symbols::AbstractArray{UInt8,1}) = ini_hex(float(x), symbols) +ini_hex(x::Real, n::Int, symbols::AbstractArray{UInt8,1}, digits) = ini_hex(float(x), n, symbols, digits) +ini_hex(x::Real, symbols::AbstractArray{UInt8,1}, digits) = ini_hex(float(x), symbols, digits) -function ini_hex(x::SmallFloatingPoint, n::Int, symbols::AbstractArray{UInt8,1}) +function ini_hex(x::SmallFloatingPoint, n::Int, symbols::AbstractArray{UInt8,1}, digits) x = Float64(x) - digits = Grisu.getbuf() if x == 0.0 ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), digits, '0', n) return Int32(1), Int32(0), signbit(x) @@ -1105,9 +1100,8 @@ function ini_hex(x::SmallFloatingPoint, n::Int, symbols::AbstractArray{UInt8,1}) end end -function ini_hex(x::SmallFloatingPoint, symbols::AbstractArray{UInt8,1}) +function ini_hex(x::SmallFloatingPoint, symbols::AbstractArray{UInt8,1}, digits) x = Float64(x) - digits = Grisu.getbuf() if x == 0.0 ccall(:memset, Ptr{Cvoid}, (Ptr{Cvoid}, Cint, Csize_t), digits, '0', 1) return Int32(1), Int32(0), signbit(x) @@ -1127,28 +1121,28 @@ function ini_hex(x::SmallFloatingPoint, symbols::AbstractArray{UInt8,1}) end end -function ini_hex(x::Integer) - len,pt,neg = decode_hex(x) +function ini_hex(x::Integer, digits) + len,pt,neg = decode_hex(x, digits) pt = (len-1)<<2 len,pt,neg end -function ini_HEX(x::Integer) - len,pt,neg = decode_HEX(x) +function ini_HEX(x::Integer, digits) + len,pt,neg = decode_HEX(x, digits) pt = (len-1)<<2 len,pt,neg end # not implemented -ini_hex(x::Integer,ndigits::Int) = throw(MethodError(ini_hex,(x,ndigits))) +ini_hex(x::Integer,ndigits::Int,digits) = throw(MethodError(ini_hex,(x,ndigits,digits))) #BigFloat -fix_dec(out, d::BigFloat, flags::String, width::Int, precision::Int, c::Char) = bigfloat_printf(out, d, flags, width, precision, c) -ini_dec(out, d::BigFloat, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = bigfloat_printf(out, d, flags, width, precision, c) -ini_hex(out, d::BigFloat, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = bigfloat_printf(out, d, flags, width, precision, c) -ini_HEX(out, d::BigFloat, ndigits::Int, flags::String, width::Int, precision::Int, c::Char) = bigfloat_printf(out, d, flags, width, precision, c) -ini_hex(out, d::BigFloat, flags::String, width::Int, precision::Int, c::Char) = bigfloat_printf(out, d, flags, width, precision, c) -ini_HEX(out, d::BigFloat, flags::String, width::Int, precision::Int, c::Char) = bigfloat_printf(out, d, flags, width, precision, c) -function bigfloat_printf(out, d::BigFloat, flags::String, width::Int, precision::Int, c::Char) +fix_dec(out, d::BigFloat, flags::String, width::Int, precision::Int, c::Char, digits) = bigfloat_printf(out, d, flags, width, precision, c, digits) +ini_dec(out, d::BigFloat, ndigits::Int, flags::String, width::Int, precision::Int, c::Char, digits) = bigfloat_printf(out, d, flags, width, precision, c, digits) +ini_hex(out, d::BigFloat, ndigits::Int, flags::String, width::Int, precision::Int, c::Char, digits) = bigfloat_printf(out, d, flags, width, precision, c, digits) +ini_HEX(out, d::BigFloat, ndigits::Int, flags::String, width::Int, precision::Int, c::Char, digits) = bigfloat_printf(out, d, flags, width, precision, c, digits) +ini_hex(out, d::BigFloat, flags::String, width::Int, precision::Int, c::Char, digits) = bigfloat_printf(out, d, flags, width, precision, c, digits) +ini_HEX(out, d::BigFloat, flags::String, width::Int, precision::Int, c::Char, digits) = bigfloat_printf(out, d, flags, width, precision, c, digits) +function bigfloat_printf(out, d::BigFloat, flags::String, width::Int, precision::Int, c::Char, digits) fmt_len = sizeof(flags)+4 if width > 0 fmt_len += ndigits(width) @@ -1174,7 +1168,6 @@ function bigfloat_printf(out, d::BigFloat, flags::String, width::Int, precision: write(fmt, UInt8(0)) printf_fmt = take!(fmt) @assert length(printf_fmt) == fmt_len - digits = Grisu.getbuf() bufsiz = length(digits) lng = ccall((:mpfr_snprintf,:libmpfr), Int32, (Ptr{UInt8}, Culong, Ptr{UInt8}, Ref{BigFloat}...), From e8c818f627d4e30c2a06161fd4cbfae6c623649f Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 13 Dec 2018 22:20:28 +0100 Subject: [PATCH 29/65] Upgrade to Pkg 1.1.1. (#30378) (cherry picked from commit 77a7d92e91769146435fe92548d253fa18740840) --- .../Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 | 1 + .../Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 | 1 + .../Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 | 1 - .../Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 | 1 - stdlib/Pkg.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 create mode 100644 deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 delete mode 100644 deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 diff --git a/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 b/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 new file mode 100644 index 0000000000000..daa7b9af3a540 --- /dev/null +++ b/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 @@ -0,0 +1 @@ +fea01869cb03a990c4c727a2e9fbe4ee diff --git a/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 b/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 new file mode 100644 index 0000000000000..5801d512f017f --- /dev/null +++ b/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 @@ -0,0 +1 @@ +89b093269a61b7f7b6c43a2dad8989b5305b4fbb844fff71acd4e30d19267c7c437caa1987aaaa1177ed3efbe4bd8eca4235140e817eb917df0b236d102f5a09 diff --git a/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 b/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 deleted file mode 100644 index b5ede4b4e00c4..0000000000000 --- a/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -2ef64823cc872c423a575a8425819154 diff --git a/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 b/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 deleted file mode 100644 index f8afd463f201c..0000000000000 --- a/deps/checksums/Pkg-dacd88b50aca09406c98aa9d418ee2716940d9c4.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -fd2c929d076761c2deebd76aac4fbc8777d43ebdb58ff3024104b671bed4895e2a5d92aeeaae27b785667e0793b99b328829f2bbc737cc8e2634f2fe80d3b55f diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index 695b02f828c62..ac6cbf6062665 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,2 +1,2 @@ PKG_BRANCH = master -PKG_SHA1 = dacd88b50aca09406c98aa9d418ee2716940d9c4 +PKG_SHA1 = cfbe0479e609aabcf5ae5422f7772b742922a0da From 47bd2ba6f23141c807aceb22340e5ace31818359 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 13 Dec 2018 16:18:40 -0500 Subject: [PATCH 30/65] fix #30335, regression in intersection of unions of typevars (#30353) (cherry picked from commit 8893aeccc3709b864e7e1b9c98502222e7c90eb6) --- src/subtype.c | 15 +++++++++++++-- test/subtype.jl | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/subtype.c b/src/subtype.c index 6e4e3729ad437..a6e7605fc25d5 100644 --- a/src/subtype.c +++ b/src/subtype.c @@ -1313,12 +1313,17 @@ static jl_value_t *intersect_all(jl_value_t *x, jl_value_t *y, jl_stenv_t *e); // intersect in nested union environment, similar to subtype_ccheck static jl_value_t *intersect_aside(jl_value_t *x, jl_value_t *y, jl_stenv_t *e, int depth) { - jl_value_t *res; + // band-aid for #30335 + if (x == (jl_value_t*)jl_any_type && !jl_is_typevar(y)) + return y; + if (y == (jl_value_t*)jl_any_type && !jl_is_typevar(x)) + return x; + int savedepth = e->invdepth; jl_unionstate_t oldRunions = e->Runions; e->invdepth = depth; - res = intersect_all(x, y, e); + jl_value_t *res = intersect_all(x, y, e); e->Runions = oldRunions; e->invdepth = savedepth; @@ -1446,6 +1451,8 @@ static jl_value_t *intersect_var(jl_tvar_t *b, jl_value_t *a, jl_stenv_t *e, int return (jl_value_t*)b; } else if (bb->constraintkind == 2) { + // TODO: removing this case fixes many test_brokens in test/subtype.jl + // but breaks other tests. if (!subtype_in_env(a, bb->ub, e)) return jl_bottom_type; jl_value_t *lb = simple_join(bb->lb, a); @@ -1604,6 +1611,10 @@ static jl_value_t *finish_unionall(jl_value_t *res JL_MAYBE_UNROOTED, jl_varbind // you can construct `T{x} where x` even if T's parameter is actually // limited. in that case we might get an invalid instantiation here. res = jl_substitute_var(res, vb->var, varval); + // simplify chains of UnionAlls where bounds become equal + while (jl_is_unionall(res) && obviously_egal(((jl_unionall_t*)res)->var->lb, + ((jl_unionall_t*)res)->var->ub)) + res = jl_instantiate_unionall((jl_unionall_t*)res, ((jl_unionall_t*)res)->var->lb); } JL_CATCH { res = jl_bottom_type; diff --git a/test/subtype.jl b/test/subtype.jl index aa9ddc7a9ca7a..4bda72de57126 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -1399,3 +1399,24 @@ end @testintersect(Tuple{Pair{Int64,2}, NTuple}, Tuple{Pair{F,N},Tuple{Vararg{F,N}}} where N where F, Tuple{Pair{Int64,2}, Tuple{Int64,Int64}}) + +# issue #30335 +@testintersect(Tuple{Any,Rational{Int},Int}, + Tuple{LT,R,I} where LT<:Union{I, R} where R<:Rational{I} where I<:Integer, + Tuple{LT,Rational{Int},Int} where LT<:Union{Rational{Int},Int}) + +#@testintersect(Tuple{Any,Tuple{Int},Int}, +# Tuple{LT,R,I} where LT<:Union{I, R} where R<:Tuple{I} where I<:Integer, +# Tuple{LT,Tuple{Int},Int} where LT<:Union{Tuple{Int},Int}) +# fails due to this: +let U = Tuple{Union{LT, LT1},Union{R, R1},Int} where LT1<:R1 where R1<:Tuple{Int} where LT<:Int where R<:Tuple{Int}, + U2 = Union{Tuple{LT,R,Int} where LT<:Int where R<:Tuple{Int}, Tuple{LT,R,Int} where LT<:R where R<:Tuple{Int}}, + V = Tuple{Union{Tuple{Int},Int},Tuple{Int},Int}, + V2 = Tuple{L,Tuple{Int},Int} where L<:Union{Tuple{Int},Int} + @test U == U2 + @test U == V + @test U == V2 + @test V == V2 + @test U2 == V + @test_broken U2 == V2 +end From 0d9fee88b5f61d1eabcc9dce566233c27d0b7663 Mon Sep 17 00:00:00 2001 From: Fabian Gans Date: Fri, 14 Dec 2018 10:41:51 +0100 Subject: [PATCH 31/65] fix reinterpret for 0-dimensional arrays (#30376) (cherry picked from commit c3799003d769c434a2507ec472aa3f80f6c39317) --- base/reinterpretarray.jl | 4 +++- test/reinterpretarray.jl | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/base/reinterpretarray.jl b/base/reinterpretarray.jl index 2ea21ec981b56..8d7a175d8252d 100644 --- a/base/reinterpretarray.jl +++ b/base/reinterpretarray.jl @@ -33,8 +33,8 @@ struct ReinterpretArray{T,N,S,A<:AbstractArray{S, N}} <: AbstractArray{T, N} isbitstype(T) || throwbits(S, T, T) isbitstype(S) || throwbits(S, T, S) (N != 0 || sizeof(T) == sizeof(S)) || throwsize0(S, T) - ax1 = axes(a)[1] if N != 0 && sizeof(S) != sizeof(T) + ax1 = axes(a)[1] dim = length(ax1) rem(dim*sizeof(S),sizeof(T)) == 0 || thrownonint(S, T, dim) first(ax1) == 1 || throwaxes1(S, T, ax1) @@ -74,6 +74,7 @@ function size(a::ReinterpretArray{T,N,S} where {N}) where {T,S} size1 = div(psize[1]*sizeof(S), sizeof(T)) tuple(size1, tail(psize)...) end +size(a::ReinterpretArray{T,0}) where {T} = () function axes(a::ReinterpretArray{T,N,S} where {N}) where {T,S} paxs = axes(a.parent) @@ -81,6 +82,7 @@ function axes(a::ReinterpretArray{T,N,S} where {N}) where {T,S} size1 = div(l*sizeof(S), sizeof(T)) tuple(oftype(paxs[1], f:f+size1-1), tail(paxs)...) end +axes(a::ReinterpretArray{T,0}) where {T} = () elsize(::Type{<:ReinterpretArray{T}}) where {T} = sizeof(T) unsafe_convert(::Type{Ptr{T}}, a::ReinterpretArray{T,N,S} where N) where {T,S} = Ptr{T}(unsafe_convert(Ptr{S},a.parent)) diff --git a/test/reinterpretarray.jl b/test/reinterpretarray.jl index c053bb5ef13ca..70899c8b6ee53 100644 --- a/test/reinterpretarray.jl +++ b/test/reinterpretarray.jl @@ -160,3 +160,12 @@ let a = [0.1 0.2; 0.3 0.4], at = reshape([(i,i+1) for i = 1:2:8], 2, 2) r = reinterpret(Int, vt) @test r == OffsetArray(reshape(1:8, 2, 2, 2), (0, offsetvt...)) end + +# Test 0-dimensional Arrays +A = zeros(UInt32) +B = reinterpret(Int32,A) +@test size(B) == () +@test axes(B) == () +B[] = Int32(5) +@test B[] === Int32(5) +@test A[] === UInt32(5) From c045cbea973ea4aeab0cfbb41dac1d54b0c176c9 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Sun, 16 Dec 2018 21:09:56 -0500 Subject: [PATCH 32/65] stacktrace: prevent OOB-error in sysimage lookup (#30369) Previously, with a multi-versioned system image, there might be additional entries at the end of the clone list that do not correspond to an actual method (such as jlplt thunks). Also some code cleanup for clarity. fix #28648 (cherry picked from commit e51a7075d74e86274d694b9b9f5e475b57c05439) --- src/debuginfo.cpp | 3 ++- src/staticdata.c | 1 + stdlib/Profile/src/Profile.jl | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/debuginfo.cpp b/src/debuginfo.cpp index 737508301776a..c092bbf458a93 100644 --- a/src/debuginfo.cpp +++ b/src/debuginfo.cpp @@ -1087,7 +1087,8 @@ static int jl_getDylibFunctionInfo(jl_frame_t **frames, size_t pointer, int skip for (size_t i = 0; i < sysimg_fptrs.nclones; i++) { if (diff == sysimg_fptrs.clone_offsets[i]) { uint32_t idx = sysimg_fptrs.clone_idxs[i] & jl_sysimg_val_mask; - frame0->linfo = sysimg_fvars_linfo[idx]; + if (idx < sysimg_fvars_n) // items after this were cloned but not referenced directly by a method (such as our ccall PLT thunks) + frame0->linfo = sysimg_fvars_linfo[idx]; break; } } diff --git a/src/staticdata.c b/src/staticdata.c index 921abb4b770be..363e0d716c3bb 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -1016,6 +1016,7 @@ static void jl_update_all_fptrs(jl_serializer_state *s) for (i = 0; i < sysimg_fvars_max; i++) { uintptr_t val = (uintptr_t)&linfos[i]; uint32_t offset = load_uint32(&val); + linfos[i] = NULL; if (offset != 0) { int specfunc = 1; if (offset & ((uintptr_t)1 << (8 * sizeof(uint32_t) - 1))) { diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 5cb34e132942f..8ae9542c2c2f4 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -514,6 +514,7 @@ function tree!(root::StackFrameTree{T}, all::Vector{UInt64}, lidict::Union{LineI # jump forward to the end of the inlining chain # avoiding an extra (slow) lookup of `ip` in `lidict` # and an extra chain of them in `down` + # note that we may even have this === parent (if we're ignoring this frame ip) this = builder_value[fastkey] let this = this while this !== parent @@ -532,8 +533,7 @@ function tree!(root::StackFrameTree{T}, all::Vector{UInt64}, lidict::Union{LineI frame = (frames isa Vector ? frames[i] : frames) !C && frame.from_c && continue key = (T === UInt64 ? ip : frame) - down = parent.down - this = get!(down, key) do + this = get!(parent.down, key) do return StackFrameTree{T}() end this.frame = frame From 2348c7b26b6288d1de7a21b99047fd1c298fbf9d Mon Sep 17 00:00:00 2001 From: Raghvendra Gupta Date: Mon, 17 Dec 2018 20:20:13 +0530 Subject: [PATCH 33/65] Fix #30006, getindex accessing fields that might not exist (#30405) * Fix #30006, range getindex accessing fields that might not exist * Add tests for #30006 (cherry picked from commit 64133f68a68a2bb52a8908bab25c32150a7e84fd) --- base/range.jl | 4 ++-- stdlib/SparseArrays/test/sparse.jl | 4 ++++ test/ranges.jl | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/base/range.jl b/base/range.jl index 785ade602f6bf..edf616d4d171f 100644 --- a/base/range.jl +++ b/base/range.jl @@ -627,8 +627,8 @@ function getindex(v::AbstractRange{T}, i::Integer) where T @_inline_meta ret = convert(T, first(v) + (i - 1)*step_hp(v)) ok = ifelse(step(v) > zero(step(v)), - (ret <= v.stop) & (ret >= v.start), - (ret <= v.start) & (ret >= v.stop)) + (ret <= last(v)) & (ret >= first(v)), + (ret <= first(v)) & (ret >= last(v))) @boundscheck ((i > 0) & ok) || throw_boundserror(v, i) ret end diff --git a/stdlib/SparseArrays/test/sparse.jl b/stdlib/SparseArrays/test/sparse.jl index 4328d59592ce9..b998f58a4303d 100644 --- a/stdlib/SparseArrays/test/sparse.jl +++ b/stdlib/SparseArrays/test/sparse.jl @@ -93,6 +93,10 @@ do33 = fill(1.,3) end end +@testset "Issue #30006" begin + SparseMatrixCSC{Float64,Int32}(spzeros(3,3))[:, 1] == [1, 2, 3] +end + @testset "concatenation tests" begin sp33 = sparse(1.0I, 3, 3) diff --git a/test/ranges.jl b/test/ranges.jl index f699eca7a1d98..55ef8dded94e5 100644 --- a/test/ranges.jl +++ b/test/ranges.jl @@ -1412,6 +1412,13 @@ end @test getindex((typemax(UInt64)//one(UInt64):typemax(UInt64)//one(UInt64)), 1) == typemax(UInt64)//one(UInt64) end +@testset "Issue #30006" begin + @test Base.Slice(Base.OneTo(5))[Int32(1)] == Int32(1) + @test Base.Slice(Base.OneTo(3))[Int8(2)] == Int8(2) + @test Base.Slice(1:10)[Int32(2)] == Int32(2) + @test Base.Slice(1:10)[Int8(2)] == Int8(2) +end + @testset "allocation of TwicePrecision call" begin 0:286.493442:360 0:286:360 From 7b9b3e3fe903ed75228d8886b4580f56ebbfeec4 Mon Sep 17 00:00:00 2001 From: Raghvendra Gupta Date: Mon, 17 Dec 2018 20:22:59 +0530 Subject: [PATCH 34/65] Fix sparse cholesky to return Vector when the RHS is a Vector (#30416) Fixes #28985 (cherry picked from commit b45100126d9f41f37dcb22e42d67f4cfa3ee9944) --- stdlib/SuiteSparse/src/cholmod.jl | 10 +++++++++- stdlib/SuiteSparse/test/cholmod.jl | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/stdlib/SuiteSparse/src/cholmod.jl b/stdlib/SuiteSparse/src/cholmod.jl index 9260b648f83a2..c8dc6e83532cf 100644 --- a/stdlib/SuiteSparse/src/cholmod.jl +++ b/stdlib/SuiteSparse/src/cholmod.jl @@ -1686,10 +1686,18 @@ end (\)(L::Factor, B::SparseVecOrMat) = sparse(spsolve(CHOLMOD_A, L, Sparse(B, 0))) \(adjL::Adjoint{<:Any,<:Factor}, B::Dense) = (L = adjL.parent; solve(CHOLMOD_A, L, B)) -\(adjL::Adjoint{<:Any,<:Factor}, B::VecOrMat) = (L = adjL.parent; Matrix(solve(CHOLMOD_A, L, Dense(B)))) \(adjL::Adjoint{<:Any,<:Factor}, B::Sparse) = (L = adjL.parent; spsolve(CHOLMOD_A, L, B)) \(adjL::Adjoint{<:Any,<:Factor}, B::SparseVecOrMat) = (L = adjL.parent; \(adjoint(L), Sparse(B))) +function \(adjL::Adjoint{<:Any,<:Factor}, b::StridedVector) + L = adjL.parent + return Vector(solve(CHOLMOD_A, L, Dense(b))) +end +function \(adjL::Adjoint{<:Any,<:Factor}, B::StridedMatrix) + L = adjL.parent + return Matrix(solve(CHOLMOD_A, L, Dense(B))) +end + const RealHermSymComplexHermF64SSL = Union{ Symmetric{Float64,SparseMatrixCSC{Float64,SuiteSparse_long}}, Hermitian{Float64,SparseMatrixCSC{Float64,SuiteSparse_long}}, diff --git a/stdlib/SuiteSparse/test/cholmod.jl b/stdlib/SuiteSparse/test/cholmod.jl index f7e46ec3d4106..7c220267a1d59 100644 --- a/stdlib/SuiteSparse/test/cholmod.jl +++ b/stdlib/SuiteSparse/test/cholmod.jl @@ -676,6 +676,11 @@ end @test_throws ArgumentError logdet(Fnew) end +@testset "Issue #28985" begin + @test typeof(cholesky(sparse(I, 4, 4))'\rand(4)) == Array{Float64, 1} + @test typeof(cholesky(sparse(I, 4, 4))'\rand(4,1)) == Array{Float64, 2} +end + @testset "Issue with promotion during conversion to CHOLMOD.Dense" begin @test CHOLMOD.Dense(fill(1, 5)) == fill(1, 5, 1) @test CHOLMOD.Dense(fill(1f0, 5)) == fill(1, 5, 1) From 3d8942d9c492e336cf31f76238691dae6c4726ac Mon Sep 17 00:00:00 2001 From: Klaus Crusius Date: Mon, 17 Dec 2018 16:58:35 +0100 Subject: [PATCH 35/65] spmatmul sparse matrix multiplication - performance improvements (#30372) * General performance improvements for sparse matmul Details for the polyalgorithm are in: https://github.com/JuliaLang/julia/pull/30372 (cherry picked from commit fae262c86111ae584d84d2bcf090a8026dbe95e3) --- stdlib/SparseArrays/src/linalg.jl | 97 +++++++++++++++++++++--------- stdlib/SparseArrays/test/sparse.jl | 3 +- 2 files changed, 70 insertions(+), 30 deletions(-) diff --git a/stdlib/SparseArrays/src/linalg.jl b/stdlib/SparseArrays/src/linalg.jl index 4350a2d922fc9..d8446d705d465 100644 --- a/stdlib/SparseArrays/src/linalg.jl +++ b/stdlib/SparseArrays/src/linalg.jl @@ -147,63 +147,104 @@ end *(A::Adjoint{<:Any,<:SparseMatrixCSC{Tv,Ti}}, B::Adjoint{<:Any,<:SparseMatrixCSC{Tv,Ti}}) where {Tv,Ti} = spmatmul(copy(A), copy(B)) *(A::Transpose{<:Any,<:SparseMatrixCSC{Tv,Ti}}, B::Transpose{<:Any,<:SparseMatrixCSC{Tv,Ti}}) where {Tv,Ti} = spmatmul(copy(A), copy(B)) -function spmatmul(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}; - sortindices::Symbol = :sortcols) where {Tv,Ti} +# Gustavsen's matrix multiplication algorithm revisited. +# The result rowval vector is already sorted by construction. +# The auxiliary Vector{Ti} xb is replaced by a Vector{Bool} of same length. +# The optional argument controlling a sorting algorithm is obsolete. +# depending on expected execution speed the sorting of the result column is +# done by a quicksort of the row indices or by a full scan of the dense result vector. +# The last is faster, if more than ≈ 1/32 of the result column is nonzero. +# TODO: extend to SparseMatrixCSCUnion to allow for SubArrays (view(X, :, r)). +function spmatmul(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}) where {Tv,Ti} mA, nA = size(A) - mB, nB = size(B) - nA==mB || throw(DimensionMismatch()) + nB = size(B, 2) + nA == size(B, 1) || throw(DimensionMismatch()) - colptrA = A.colptr; rowvalA = A.rowval; nzvalA = A.nzval - colptrB = B.colptr; rowvalB = B.rowval; nzvalB = B.nzval - # TODO: Need better estimation of result space - nnzC = min(mA*nB, length(nzvalA) + length(nzvalB)) + rowvalA = rowvals(A); nzvalA = nonzeros(A) + rowvalB = rowvals(B); nzvalB = nonzeros(B) + nnzC = max(estimate_mulsize(mA, nnz(A), nA, nnz(B), nB) * 11 ÷ 10, mA) colptrC = Vector{Ti}(undef, nB+1) rowvalC = Vector{Ti}(undef, nnzC) nzvalC = Vector{Tv}(undef, nnzC) + nzpercol = nnzC ÷ max(nB, 1) @inbounds begin ip = 1 - xb = zeros(Ti, mA) - x = zeros(Tv, mA) + xb = fill(false, mA) for i in 1:nB if ip + mA - 1 > nnzC - resize!(rowvalC, nnzC + max(nnzC,mA)) - resize!(nzvalC, nnzC + max(nnzC,mA)) - nnzC = length(nzvalC) + nnzC += max(mA, nnzC>>2) + resize!(rowvalC, nnzC) + resize!(nzvalC, nnzC) end - colptrC[i] = ip - for jp in colptrB[i]:(colptrB[i+1] - 1) + colptrC[i] = ip0 = ip + k0 = ip - 1 + for jp in nzrange(B, i) nzB = nzvalB[jp] j = rowvalB[jp] - for kp in colptrA[j]:(colptrA[j+1] - 1) + for kp in nzrange(A, j) nzC = nzvalA[kp] * nzB k = rowvalA[kp] - if xb[k] != i + if xb[k] + nzvalC[k+k0] += nzC + else + nzvalC[k+k0] = nzC + xb[k] = true rowvalC[ip] = k ip += 1 - xb[k] = i - x[k] = nzC - else - x[k] += nzC end end end - for vp in colptrC[i]:(ip - 1) - nzvalC[vp] = x[rowvalC[vp]] + if ip > ip0 + if prefer_sort(ip-k0, mA) + # in-place sort of indices. Effort: O(nnz*ln(nnz)). + sort!(rowvalC, ip0, ip-1, QuickSort, Base.Order.Forward) + for vp = ip0:ip-1 + k = rowvalC[vp] + xb[k] = false + nzvalC[vp] = nzvalC[k+k0] + end + else + # scan result vector (effort O(mA)) + for k = 1:mA + if xb[k] + xb[k] = false + rowvalC[ip0] = k + nzvalC[ip0] = nzvalC[k+k0] + ip0 += 1 + end + end + end end end colptrC[nB+1] = ip end - deleteat!(rowvalC, colptrC[end]:length(rowvalC)) - deleteat!(nzvalC, colptrC[end]:length(nzvalC)) + resize!(rowvalC, ip - 1) + resize!(nzvalC, ip - 1) - # The Gustavson algorithm does not guarantee the product to have sorted row indices. - Cunsorted = SparseMatrixCSC(mA, nB, colptrC, rowvalC, nzvalC) - C = SparseArrays.sortSparseMatrixCSC!(Cunsorted, sortindices=sortindices) + # This modification of Gustavson algorithm has sorted row indices + C = SparseMatrixCSC(mA, nB, colptrC, rowvalC, nzvalC) return C end +# estimated number of non-zeros in matrix product +# it is assumed, that the non-zero indices are distributed independently and uniformly +# in both matrices. Over-estimation is possible if that is not the case. +function estimate_mulsize(m::Integer, nnzA::Integer, n::Integer, nnzB::Integer, k::Integer) + p = (nnzA / (m * n)) * (nnzB / (n * k)) + p >= 1 ? m*k : p > 0 ? Int(ceil(-expm1(log1p(-p) * n)*m*k)) : 0 # (1-(1-p)^n)*m*k +end + +# determine if sort! shall be used or the whole column be scanned +# based on empirical data on i7-3610QM CPU +# measuring runtimes of the scanning and sorting loops of the algorithm. +# The parameters 6 and 3 might be modified for different architectures. +prefer_sort(nz::Integer, m::Integer) = m > 6 && 3 * ilog2(nz) * nz < m + +# minimal number of bits required to represent integer; ilog2(n) >= log2(n) +ilog2(n::Integer) = sizeof(n)<<3 - leading_zeros(n) + # Frobenius dot/inner product: trace(A'B) function dot(A::SparseMatrixCSC{T1,S1},B::SparseMatrixCSC{T2,S2}) where {T1,T2,S1,S2} m, n = size(A) diff --git a/stdlib/SparseArrays/test/sparse.jl b/stdlib/SparseArrays/test/sparse.jl index b998f58a4303d..c4f5e00fd28de 100644 --- a/stdlib/SparseArrays/test/sparse.jl +++ b/stdlib/SparseArrays/test/sparse.jl @@ -322,8 +322,7 @@ end a = sprand(10, 5, 0.7) b = sprand(5, 15, 0.3) @test maximum(abs.(a*b - Array(a)*Array(b))) < 100*eps() - @test maximum(abs.(SparseArrays.spmatmul(a,b,sortindices=:sortcols) - Array(a)*Array(b))) < 100*eps() - @test maximum(abs.(SparseArrays.spmatmul(a,b,sortindices=:doubletranspose) - Array(a)*Array(b))) < 100*eps() + @test maximum(abs.(SparseArrays.spmatmul(a,b) - Array(a)*Array(b))) < 100*eps() f = Diagonal(rand(5)) @test Array(a*f) == Array(a)*f @test Array(f*b) == f*Array(b) From 5b766bb9f47ebfdd360f518233cc21b7d5c83c30 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Mon, 17 Dec 2018 11:39:38 -0500 Subject: [PATCH 36/65] fix #30394, an unsoundness in ml_matches (#30396) This fixes a corner case where a bug is caused, counter-intuitively, by an over-estimated intersection. We have method signatures A and B, with Amax_valid = ml->max_world; } } + // In some corner cases type intersection is conservative and returns something + // for intersect(A, B) even though A is a dispatch tuple and !(A <: B). + // For dispatch purposes in such a case we know there's no match. This check + // fixes issue #30394. + if (jl_is_dispatch_tupletype(closure->match.type) && !closure->match.issubty) + return 1; // a method is shadowed if type <: S <: m->sig where S is the // signature of another applicable method /* diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index a3066f99b939d..c6e59dc51412e 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -2151,3 +2151,24 @@ g30098() = (h30098(:f30098); 4) h30098(f) = getfield(@__MODULE__, f)() @test @inferred(g30098()) == 4 # make sure that this @test @inferred(f30098()) == 3 # doesn't pollute the inference cache of this + +# issue #30394 +mutable struct Base30394 + a::Int +end + +mutable struct Foo30394 + foo_inner::Base30394 + Foo30394() = new(Base30394(1)) +end + +mutable struct Foo30394_2 + foo_inner::Foo30394 + Foo30394_2() = new(Foo30394()) +end + +f30394(foo::T1, ::Type{T2}) where {T2, T1 <: T2} = foo + +f30394(foo, T2) = f30394(foo.foo_inner, T2) + +@test Base.return_types(f30394, (Foo30394_2, Type{Base30394})) == Any[Base30394] From 64db937433fb853a3ce2854be5a3fec72d334efd Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Mon, 17 Dec 2018 15:51:46 -0500 Subject: [PATCH 37/65] Try implementing N-dimensional indexing for fast linear SubArrays (#30266) (cherry picked from commit 433ba13e22270ad7751449af4d84c8494bd04cc4) --- base/subarray.jl | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/base/subarray.jl b/base/subarray.jl index 5e593b95bcf99..2d6f8a709a642 100644 --- a/base/subarray.jl +++ b/base/subarray.jl @@ -222,13 +222,14 @@ end # In general, we simply re-index the parent indices by the provided ones SlowSubArray{T,N,P,I} = SubArray{T,N,P,I,false} -function getindex(V::SlowSubArray{T,N}, I::Vararg{Int,N}) where {T,N} +function getindex(V::SubArray{T,N}, I::Vararg{Int,N}) where {T,N} @_inline_meta @boundscheck checkbounds(V, I...) @inbounds r = V.parent[reindex(V, V.indices, I)...] r end +# But SubArrays with fast linear indexing pre-compute a stride and offset FastSubArray{T,N,P,I} = SubArray{T,N,P,I,true} function getindex(V::FastSubArray, i::Int) @_inline_meta @@ -246,8 +247,23 @@ function getindex(V::FastContiguousSubArray, i::Int) @inbounds r = V.parent[V.offset1 + i] r end +# For vector views with linear indexing, we disambiguate to favor the stride/offset +# computation as that'll generally be faster than (or just as fast as) re-indexing into a range. +function getindex(V::FastSubArray{<:Any, 1}, i::Int) + @_inline_meta + @boundscheck checkbounds(V, i) + @inbounds r = V.parent[V.offset1 + V.stride1*i] + r +end +function getindex(V::FastContiguousSubArray{<:Any, 1}, i::Int) + @_inline_meta + @boundscheck checkbounds(V, i) + @inbounds r = V.parent[V.offset1 + i] + r +end -function setindex!(V::SlowSubArray{T,N}, x, I::Vararg{Int,N}) where {T,N} +# Indexed assignment follows the same pattern as `getindex` above +function setindex!(V::SubArray{T,N}, x, I::Vararg{Int,N}) where {T,N} @_inline_meta @boundscheck checkbounds(V, I...) @inbounds V.parent[reindex(V, V.indices, I)...] = x @@ -265,6 +281,18 @@ function setindex!(V::FastContiguousSubArray, x, i::Int) @inbounds V.parent[V.offset1 + i] = x V end +function setindex!(V::FastSubArray{<:Any, 1}, x, i::Int) + @_inline_meta + @boundscheck checkbounds(V, i) + @inbounds V.parent[V.offset1 + V.stride1*i] = x + V +end +function setindex!(V::FastContiguousSubArray{<:Any, 1}, x, i::Int) + @_inline_meta + @boundscheck checkbounds(V, i) + @inbounds V.parent[V.offset1 + i] = x + V +end IndexStyle(::Type{<:FastSubArray}) = IndexLinear() IndexStyle(::Type{<:SubArray}) = IndexCartesian() From c379fb0cf707ef10cc8487b1bcf886936070b6d6 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 17 Dec 2018 16:22:09 -0500 Subject: [PATCH 38/65] loading: work on simplifications (and some corrections) of docs (#29946) (cherry picked from commit 8b35e8424e10dfef94ad2c548ef6c5f600d22069) --- base/initdefs.jl | 2 +- doc/src/manual/code-loading.md | 161 +++++++++++++++++++-------------- 2 files changed, 93 insertions(+), 70 deletions(-) diff --git a/base/initdefs.jl b/base/initdefs.jl index 60b6a07580fc1..2952b27e37920 100644 --- a/base/initdefs.jl +++ b/base/initdefs.jl @@ -76,7 +76,7 @@ const DEFAULT_LOAD_PATH = ["@", "@v#.#", "@stdlib"] LOAD_PATH An array of paths for `using` and `import` statements to consider as project -environments or package directories when loading code. See Code Loading. +environments or package directories when loading code. See [Code Loading](@ref Code-Loading). """ const LOAD_PATH = copy(DEFAULT_LOAD_PATH) const HOME_PROJECT = Ref{Union{String,Nothing}}(nothing) diff --git a/doc/src/manual/code-loading.md b/doc/src/manual/code-loading.md index e88dbdc5bda2e..7e2652aa90a82 100644 --- a/doc/src/manual/code-loading.md +++ b/doc/src/manual/code-loading.md @@ -1,66 +1,71 @@ # Code Loading -Julia has two mechanisms for loading code: +!!! note + This chapter covers the technical details of package loading. To install packages, use [`Pkg`](@ref Pkg), Julia's built-in package manager, to add packages to your active environment. To use packages already in your active environment, write `import X` or `using X`, as described in the [Modules documentation](@ref modules). -1. **Code inclusion:** e.g. `include("source.jl")`. Inclusion allows you to split a single program across multiple source files. The expression `include("source.jl")` causes the contents of the file `source.jl` to be evaluated in the global scope of the module where the `include` call occurs. If `include("source.jl")` is called multiple times, `source.jl` is evaluated multiple times. The included path, `source.jl`, is interpreted relative to the file where the `include` call occurs. This makes it simple to relocate a subtree of source files. In the REPL, included paths are interpreted relative to the current working directory, `pwd()`. -2. **Package loading:** e.g. `import X` or `using X`. The import mechanism allows you to load a package—i.e. an independent, reusable collection of Julia code, wrapped in a module—and makes the resulting module available by the name `X` inside of the importing module. If the same `X` package is imported multiple times in the same Julia session, it is only loaded the first time—on subsequent imports, the importing module gets a reference to the same module. Note though, that `import X` can load different packages in different contexts: `X` can refer to one package named `X` in the main project but potentially different packages named `X` in each dependency. More on this below. +## Definitions -Code inclusion is quite straightforward: it simply parses and evaluates a source file in the context of the caller. Package loading is built on top of code inclusion and is a lot more complex. Therefore, the rest of this chapter focuses on the behavior and mechanics of package loading. +Julia has two mechanisms for loading code: -!!! note - You only need to read this chapter if you want to understand the technical details of package loading. If you just want to install and use packages, simply use Julia's built-in package manager to add packages to your environment and write `import X` or `using X` in your code to load packages that you've added. +1. **Code inclusion:** e.g. `include("source.jl")`. Inclusion allows you to split a single program across multiple source files. The expression `include("source.jl")` causes the contents of the file `source.jl` to be evaluated in the global scope of the module where the `include` call occurs. If `include("source.jl")` is called multiple times, `source.jl` is evaluated multiple times. The included path, `source.jl`, is interpreted relative to the file where the `include` call occurs. This makes it simple to relocate a subtree of source files. In the REPL, included paths are interpreted relative to the current working directory, [`pwd()`](@ref). +2. **Package loading:** e.g. `import X` or `using X`. The import mechanism allows you to load a package—i.e. an independent, reusable collection of Julia code, wrapped in a module—and makes the resulting module available by the name `X` inside of the importing module. If the same `X` package is imported multiple times in the same Julia session, it is only loaded the first time—on subsequent imports, the importing module gets a reference to the same module. Note though, that `import X` can load different packages in different contexts: `X` can refer to one package named `X` in the main project but potentially to different packages also named `X` in each dependency. More on this below. -A *package* is a source tree with a standard layout providing functionality that can be reused by other Julia projects. A package is loaded by `import X` or `using X` statements. These statements also make the module named `X`, which results from loading the package code, available within the module where the import statement occurs. The meaning of `X` in `import X` is context-dependent: which `X` package is loaded depends on what code the statement occurs in. The effect of `import X` depends on two questions: +Code inclusion is quite straightforward and simple: it evaluates the given source file in the context of the caller. Package loading is built on top of code inclusion and serves a [different purpose](@ref modules). The rest of this chapter focuses on the behavior and mechanics of package loading. -1. **What** package is `X` in this context? -2. **Where** can that `X` package be found? +A *package* is a source tree with a standard layout providing functionality that can be reused by other Julia projects. A package is loaded by `import X` or `using X` statements. These statements also make the module named `X`—which results from loading the package code—available within the module where the import statement occurs. The meaning of `X` in `import X` is context-dependent: which `X` package is loaded depends on what code the statement occurs in. Thus, handling of `import X` happens in two stages: first, it determines **what** package is defined to be `X` in this context; second, it determines **where** that particular `X` package is found. + +These questions are answered by searching through the project environments listed in [`LOAD_PATH`](@ref) for project files (`Project.toml` or `JuliaProject.toml`), manifest files (`Manifest.toml` or `JuliaManifest.toml`), or folders of source files. -Understanding how Julia answers these questions is key to understanding package loading. ## Federation of packages -Julia supports federated management of packages. This means that multiple independent parties can maintain both public and private packages and registries of them, and that projects can depend on a mix of public and private packages from different registries. Packages from various registries are installed and managed using a common set of tools and workflows. The `Pkg` package manager ships with Julia 0.7/1.0 and lets you install and manage your projects' dependencies. It does this by creating and manipulating project files that describe what your project depends on, and manifest files that snapshot exact versions of your project's complete dependency graph. +Most of the time, a package is uniquely identifiable simply from its name. However, sometimes a project might encounter a situation where it needs to use two different packages that share the same name. While you might be able fix this by renaming one of the packages, being forced to do so can be highly disruptive in a large, shared code base. Instead, Julia's code loading mechanism allows the same package name to refer to different packages in different components of an application. + +Julia supports federated package management, which means that multiple independent parties can maintain both public and private packages and registries of packages, and that projects can depend on a mix of public and private packages from different registries. Packages from various registries are installed and managed using a common set of tools and workflows. The `Pkg` package manager that ships with Julia lets you install and manage your projects' dependencies. It assists in creating and manipulating project files (which describe what other projects that your project depends on), and manifest files (which snapshot exact versions of your project's complete dependency graph). -One consequence of federation is that there cannot be a central authority for package naming. Different entities may use the same name to refer to unrelated packages. This possibility is unavoidable since these entities do not coordinate and may not even know about each other. Because of the lack of a central naming authority, a single project can quite possibly end up depending on different packages that have the same name. Julia's package loading mechanism handles this by not requiring package names to be globally unique, even within the dependency graph of a single project. Instead, packages are identified by [universally unique identifiers](https://en.wikipedia.org/wiki/Universally_unique_identifier) (UUIDs) which are assigned to them before they are registered. The question *"what is `X`?"* is answered by determining the UUID of `X`. +One consequence of federation is that there cannot be a central authority for package naming. Different entities may use the same name to refer to unrelated packages. This possibility is unavoidable since these entities do not coordinate and may not even know about each other. Because of the lack of a central naming authority, a single project may end up depending on different packages that have the same name. Julia's package loading mechanism does not require package names to be globally unique, even within the dependency graph of a single project. Instead, packages are identified by [universally unique identifiers](https://en.wikipedia.org/wiki/Universally_unique_identifier) (UUIDs), which get assigned when each package is created. Usually you won't have to work directly with these somewhat cumbersome 128-bit identifiers since `Pkg` will take care of generating and tracking them for you. However, these UUIDs provide the definitive answer to the question of *"what package does `X` refer to?"* -Since the decentralized naming problem is somewhat abstract, it may help to walk through a concrete scenario to understand the issue. Suppose you're developing an application called `App`, which uses two packages: `Pub` and `Priv`. `Priv` is a private package that you created, whereas `Pub` is a public package that you use but don't control. When you created `Priv`, there was no public package by that name. Subsequently, however, an unrelated package also named `Priv` has been published and become popular. In fact, the `Pub` package has started to use it. Therefore, when you next upgrade `Pub` to get the latest bug fixes and features, `App` will end up—through no action of yours other than upgrading—depending on two different packages named `Priv`. `App` has a direct dependency on your private `Priv` package, and an indirect dependency, through `Pub`, on the new public `Priv` package. Since these two `Priv` packages are different but both required for `App` to continue working correctly, the expression `import Priv` must refer to different `Priv` packages depending on whether it occurs in `App`'s code or in `Pub`'s code. Julia's package loading mechanism allows this by distinguishing the two `Priv` packages by context and UUID. How this distinction works is determined by environments, as explained in the following sections. +Since the decentralized naming problem is somewhat abstract, it may help to walk through a concrete scenario to understand the issue. Suppose you're developing an application called `App`, which uses two packages: `Pub` and `Priv`. `Priv` is a private package that you created, whereas `Pub` is a public package that you use but don't control. When you created `Priv`, there was no public package by the name `Priv`. Subsequently, however, an unrelated package also named `Priv` has been published and become popular. In fact, the `Pub` package has started to use it. Therefore, when you next upgrade `Pub` to get the latest bug fixes and features, `App` will end up depending on two different packages named `Priv`—through no action of yours other than upgrading. `App` has a direct dependency on your private `Priv` package, and an indirect dependency, through `Pub`, on the new public `Priv` package. Since these two `Priv` packages are different but are both required for `App` to continue working correctly, the expression `import Priv` must refer to different `Priv` packages depending on whether it occurs in `App`'s code or in `Pub`'s code. To handle this, Julia's package loading mechanism distinguishes the two `Priv` packages by their UUID and picks the correct one based on its context (the module that called `import`). How this distinction works is determined by environments, as explained in the following sections. ## Environments -An *environment* determines what `import X` and `using X` mean in various code contexts and what files these statements cause to be loaded. Julia understands three kinds of environments: +An *environment* determines what `import X` and `using X` mean in various code contexts and what files these statements cause to be loaded. Julia understands two kinds of environments: + +1. **A project environment** is a directory with a project file and an optional manifest file, and forms an *explicit environement*. The project file determines what the names and identities of the direct dependencies of a project are. The manifest file, if present, gives a complete dependency graph, including all direct and indirect dependencies, exact versions of each dependency, and sufficient information to locate and load the correct version. +2. **A package directory** is a directory containing the source trees of a set of packages as subdirectories, and forms an *implicit environment*. If `X` is a subdirectory of a package directory and `X/src/X.jl` exists, then the package `X` is available in the package directory environment and `X/src/X.jl` is the source file by which it is loaded. -1. **A project environment** is a directory with a project file and an optional manifest file. The project file determines what the names and identities of the direct dependencies of a project are. The manifest file, if present, gives a complete dependency graph, including all direct and indirect dependencies, exact versions of each dependency, and sufficient information to locate and load the correct version. -2. **A package directory** is a directory containing the source trees of a set of packages as subdirectories. This kind of environment was the only kind that existed in Julia 0.6 and earlier. If `X` is a subdirectory of a package directory and `X/src/X.jl` exists, then the package `X` is available in the package directory environment and `X/src/X.jl` is the source file by which it is loaded. -3. **A stacked environment** is an ordered set of project environments and package directories, overlaid to make a single composite environment in which all the packages available in its constituent environments are available. Julia's load path is a stacked environment, for example. +These can be intermixed to create **a stacked environment**: an ordered set of project environments and package directories, overlaid to make a single composite environment. The precedence and visibility rules then combine to determine which packages are available and where they get loaded from. Julia's load path forms a stacked environment, for example. -These three kinds of environment each serve a different purpose: +These environment each serve a different purpose: -* Project environments provide **reproducibility.** By checking a project environment into version control—e.g. a git repository—along with the rest of the project's source code, you can reproduce the exact state of the project _and_ all of its dependencies since the manifest file captures the exact version of every dependency. -* Package directories provide low-overhead **convenience** when a project environment isn't needed. Package directories are handy when you have a set of packages that you just want to put somewhere and use them as they are, without having to create and maintain a project environment for them. -* Stacked environments allow for **augmentation** of the primary environment with additional tools. You can push an environment including development tools onto the stack and they will be available from the REPL and scripts but not from inside packages. +* Project environments provide **reproducibility**. By checking a project environment into version control—e.g. a git repository—along with the rest of the project's source code, you can reproduce the exact state of the project and all of its dependencies. The manifest file, in particular, captures the exact version of every dependency, identified by a cryptographic hash of its source tree, which makes it possible for `Pkg` to retrieve the correct versions and be sure that you are running the exact code that was recorded for all dependencies. +* Package directories provide **convenience** when a full carefully-tracked project environment is unnecessary. They are useful when you want to put a set of packages somewhere and be able to directly use them, without needing to create a project environment for them. +* Stacked environments allow for **adding** tools to the primary environment. You can push an environment of development tools onto the end of the stack to make them available from the REPL and scripts, but not from inside packages. -As an abstraction, an environment provides three maps: `roots`, `graph` and `paths`. When resolving the meaning of `import X`, `roots` and `graph` are used to determine the identity of `X` and answer the question *"what is `X`?"*, while the `paths` map is used to locate the source code of `X` and answer the question *"where is `X`?"* The specific roles of the three maps are: +At a high-level, each environment conceptually defines three maps: roots, graph and paths. When resolving the meaning of `import X`, the roots and graph maps are used to determine the identity of `X`, while the paths map is used to locate the source code of `X`. The specific roles of the three maps are: - **roots:** `name::Symbol` ⟶ `uuid::UUID` - An environment's `roots` map assigns package names to UUIDs for all the top-level dependencies that the environment makes available to the main project (i.e. the ones that can be loaded in `Main`). When Julia encounters `import X` in the main project, it looks up the identity of `X` as `roots[:X]`. + An environment's roots map assigns package names to UUIDs for all the top-level dependencies that the environment makes available to the main project (i.e. the ones that can be loaded in `Main`). When Julia encounters `import X` in the main project, it looks up the identity of `X` as `roots[:X]`. - **graph:** `context::UUID` ⟶ `name::Symbol` ⟶ `uuid::UUID` - An environment's `graph` is a multilevel map which assigns, for each `context` UUID, a map from names to UUIDs, similar to the `roots` map but specific to that `context`. When Julia sees `import X` in the code of the package whose UUID is `context`, it looks up the identity of `X` as `graph[context][:X]`. In particular, this means that `import X` can refer to different packages depending on `context`. + An environment's graph is a multilevel map which assigns, for each `context` UUID, a map from names to UUIDs, similar to the roots map but specific to that `context`. When Julia sees `import X` in the code of the package whose UUID is `context`, it looks up the identity of `X` as `graph[context][:X]`. In particular, this means that `import X` can refer to different packages depending on `context`. - **paths:** `uuid::UUID` × `name::Symbol` ⟶ `path::String` - The `paths` map assigns to each package UUID-name pair, the location of that package's entry-point source file. After the identity of `X` in `import X` has been resolved to a UUID via `roots` or `graph` (depending on whether it is loaded from the main project or a dependency), Julia determines what file to load to acquire `X` by looking up `paths[uuid,:X]` in the environment. Including this file should create a module named `X`. Once this package is loaded, i.e. after its first import, any subsequent import resolving to the same `uuid` will simply create a new binding to the original already-loaded package module. + The paths map assigns to each package UUID-name pair, the location of that package's entry-point source file. After the identity of `X` in `import X` has been resolved to a UUID via roots or graph (depending on whether it is loaded from the main project or a dependency), Julia determines what file to load to acquire `X` by looking up `paths[uuid,:X]` in the environment. Including this file should define a module named `X`. Once this package is loaded, any subsequent import resolving to the same `uuid` will create a new binding to the already-loaded package module. Each kind of environment defines these three maps differently, as detailed in the following sections. !!! note - For ease of understanding, the examples throughout this chapter show full data structures for `roots`, `graph` and `paths`. However, for efficiency, Julia's package loading code does not actually create them. Instead, it queries them through internal APIs and lazily computes only as much of each structure as it needs to load a given package. + For ease of understanding, the examples throughout this chapter show full data structures for roots, graph and paths. However, Julia's package loading code does not explicitly create these. Instead, it lazily computes only as much of each structure as it needs to load a given package. ### Project environments -A project environment is determined by a directory containing a project file called `Project.toml`, and optionally a manifest file called `Manifest.toml`. These files may also be called `JuliaProject.toml` and `JuliaManifest.toml`, in which case `Project.toml` and `Manifest.toml` are ignored. (This allows for coexistence with other tools that might consider files called `Project.toml` and `Manifest.toml` significant.) For pure Julia projects, however, the names `Project.toml` and `Manifest.toml` are preferred. The `roots`, `graph` and `paths` maps of a project environment are defined as follows. +A project environment is determined by a directory containing a project file called `Project.toml`, and optionally a manifest file called `Manifest.toml`. These files may also be called `JuliaProject.toml` and `JuliaManifest.toml`, in which case `Project.toml` and `Manifest.toml` are ignored. This allows for coexistence with other tools that might consider files called `Project.toml` and `Manifest.toml` significant. For pure Julia projects, however, the names `Project.toml` and `Manifest.toml` are preferred. + +The roots, graph and paths maps of a project environment are defined as follows: **The roots map** of the environment is determined by the contents of the project file, specifically, its top-level `name` and `uuid` entries and its `[deps]` section (all optional). Consider the following example project file for the hypothetical application, `App`, as described earlier: @@ -73,7 +78,7 @@ Priv = "ba13f791-ae1d-465a-978b-69c3ad90f72b" Pub = "c07ecb7d-0dc9-4db7-8803-fadaaeaf08e1" ``` -This project file implies the following `roots` map, if it was represented by a Julia dictionary: +This project file implies the following roots map, if it was represented by a Julia dictionary: ```julia roots = Dict( @@ -83,9 +88,9 @@ roots = Dict( ) ``` -Given this `roots` map, in `App`'s code the statement `import Priv` will cause Julia to look up `roots[:Priv]`, which yields `ba13f791-ae1d-465a-978b-69c3ad90f72b`, the UUID of the `Priv` package that is to be loaded in that context. This UUID identifies which `Priv` package to load and use when the main application evaluates `import Priv`. +Given this roots map, in `App`'s code the statement `import Priv` will cause Julia to look up `roots[:Priv]`, which yields `ba13f791-ae1d-465a-978b-69c3ad90f72b`, the UUID of the `Priv` package that is to be loaded in that context. This UUID identifies which `Priv` package to load and use when the main application evaluates `import Priv`. -**The dependency graph** of a project environment is determined by the contents of the manifest file, if present. If there is no manifest file, `graph` is empty. A manifest file contains a stanza for each of a project's direct or indirect dependencies, including for each one, its UUID and a source tree hash or an explicit path to the source code. Consider the following example manifest file for `App`: +**The dependency graph** of a project environment is determined by the contents of the manifest file, if present. If there is no manifest file, graph is empty. A manifest file contains a stanza for each of a project's direct or indirect dependencies. For each dependency, the file lists the package's UUID and a source tree hash or an explicit path to the source code. Consider the following example manifest file for `App`: ```toml [[Priv]] # the private one @@ -115,29 +120,30 @@ version = "3.4.2" This manifest file describes a possible complete dependency graph for the `App` project: -- There are two different `Priv` packages that the application needs—a private one which is a direct dependency and a public one which is an indirect dependency through `Pub`: +- There are two different packages named `Priv` that the application uses. It uses a private package, which is a root dependency, and a public one, which is an indirect dependency through `Pub`. These are differentiated by their distinct UUIDs, and they have different deps: * The private `Priv` depends on the `Pub` and `Zebra` packages. * The public `Priv` has no dependencies. -- The application also depends on the `Pub` package, which in turn depends on the public `Priv ` and the same `Zebra` package which the private `Priv` package depends on. +- The application also depends on the `Pub` package, which in turn depends on the public `Priv ` and the same `Zebra` package that the private `Priv` package depends on. + -This dependency `graph` represented as a dictionary, looks like this: +This dependency graph represented as a dictionary, looks like this: ```julia -graph = Dict{UUID,Dict{Symbol,UUID}}( +graph = Dict( # Priv – the private one: - UUID("ba13f791-ae1d-465a-978b-69c3ad90f72b") => Dict{Symbol,UUID}( + UUID("ba13f791-ae1d-465a-978b-69c3ad90f72b") => Dict( :Pub => UUID("c07ecb7d-0dc9-4db7-8803-fadaaeaf08e1"), :Zebra => UUID("f7a24cb4-21fc-4002-ac70-f0e3a0dd3f62"), ), # Priv – the public one: - UUID("2d15fe94-a1f7-436c-a4d8-07a9a496e01c") => Dict{Symbol,UUID}(), + UUID("2d15fe94-a1f7-436c-a4d8-07a9a496e01c") => Dict(), # Pub: - UUID("c07ecb7d-0dc9-4db7-8803-fadaaeaf08e1") => Dict{Symbol,UUID}( + UUID("c07ecb7d-0dc9-4db7-8803-fadaaeaf08e1") => Dict( :Priv => UUID("2d15fe94-a1f7-436c-a4d8-07a9a496e01c"), :Zebra => UUID("f7a24cb4-21fc-4002-ac70-f0e3a0dd3f62"), ), # Zebra: - UUID("f7a24cb4-21fc-4002-ac70-f0e3a0dd3f62") => Dict{Symbol,UUID}(), + UUID("f7a24cb4-21fc-4002-ac70-f0e3a0dd3f62") => Dict(), ) ``` @@ -151,26 +157,32 @@ and gets `2d15fe94-a1f7-436c-a4d8-07a9a496e01c`, which indicates that in the con What happens if `import Zebra` is evaluated in the main `App` code base? Since `Zebra` does not appear in the project file, the import will fail even though `Zebra` *does* appear in the manifest file. Moreover, if `import Zebra` occurs in the public `Priv` package—the one with UUID `2d15fe94-a1f7-436c-a4d8-07a9a496e01c`—then that would also fail since that `Priv` package has no declared dependencies in the manifest file and therefore cannot load any packages. The `Zebra` package can only be loaded by packages for which it appear as an explicit dependency in the manifest file: the `Pub` package and one of the `Priv` packages. -**The paths map** of a project environment is also determined by the manifest file if present and is empty if there is no manifest. The path of a package `uuid` named `X` is determined by these two rules: +**The paths map** of a project environment is extracted from the manifest file. The path of a package `uuid` named `X` is determined by these rules (in order): -1. If the manifest stanza matching `uuid` has a `path` entry, use that path relative to the manifest file. -2. Otherwise, if the manifest stanza matching `uuid` has a `git-tree-sha1` entry, compute a deterministic hash function of `uuid` and `git-tree-sha1`—call it `slug`—and look for `packages/X/$slug` in each directory in the Julia `DEPOT_PATH` global array. Use the first such directory that exists. +1. If the project file in the directory matches `uuid` and name `X`, then either: + - It has a toplevel `path` entry, then `uuid` will be mapped to that path, interpreted relative to the directory containing the project file. + - Otherwise, `uuid` is mapped to `src/X.jl` relative to the directory containing the project file. +2. If the above is not the case and the project file has a corresponding manifest file and the manifest contains a stanza matching `uuid` then: + - If it has a `path` entry, use that path (relative to the directory containing the manifest file). + - If it has a `git-tree-sha1` entry, compute a deterministic hash function of `uuid` and `git-tree-sha1`—call it `slug`—and look for a directory named `packages/X/$slug` in each directory in the Julia `DEPOT_PATH` global array. Use the first such directory that exists. -If applying these rules doesn't find a loadable path, the package should be considered not installed and the system should raise an error or prompt the user to install the appropriate package version. +If any of these result in success, the path to the source code entry point will be either that result, the relative path from that result plus `src/X.jl`; otherwise, there is no path mapping for `uuid`. When loading `X`, if no source code path is found, the lookup will fail, and the user may be prompted to install the appropriate package version or to take other corrective action (e.g. declaring `X` as a dependency). In the example manifest file above, to find the path of the first `Priv` package—the one with UUID `ba13f791-ae1d-465a-978b-69c3ad90f72b`—Julia looks for its stanza in the manifest file, sees that it has a `path` entry, looks at `deps/Priv` relative to the `App` project directory—let's suppose the `App` code lives in `/home/me/projects/App`—sees that `/home/me/projects/App/deps/Priv` exists and therefore loads `Priv` from there. -If, on the other hand, Julia was loading the *other* `Priv` package—the one with UUID `2d15fe94-a1f7-436c-a4d8-07a9a496e01c`—it finds its stanza in the manifest, see that it does *not* have a `path` entry, but that it does have a `git-tree-sha1` entry. It then computes the `slug` for this UUID/SHA-1 pair, which is `HDkr` (the exact details of this computation aren't important, but it is consistent and deterministic). This means that the path to this `Priv` package will be `packages/Priv/HDkr/src/Priv.jl` in one of the package depots. Suppose the contents of `DEPOT_PATH` is `["/home/me/.julia", "/usr/local/julia"]`; then Julia will look at the following paths to see if they exist: +If, on the other hand, Julia was loading the *other* `Priv` package—the one with UUID `2d15fe94-a1f7-436c-a4d8-07a9a496e01c`—it finds its stanza in the manifest, see that it does *not* have a `path` entry, but that it does have a `git-tree-sha1` entry. It then computes the `slug` for this UUID/SHA-1 pair, which is `HDkrT` (the exact details of this computation aren't important, but it is consistent and deterministic). This means that the path to this `Priv` package will be `packages/Priv/HDkrT/src/Priv.jl` in one of the package depots. Suppose the contents of `DEPOT_PATH` is `["/home/me/.julia", "/usr/local/julia"]`, then Julia will look at the following paths to see if they exist: -1. `/home/me/.julia/packages/Priv/HDkr/src/Priv.jl` -2. `/usr/local/julia/packages/Priv/HDkr/src/Priv.jl` +1. `/home/me/.julia/packages/Priv/HDkrT` +2. `/usr/local/julia/packages/Priv/HDkrT` -Julia uses the first of these that exists to load the public `Priv` package. +Julia uses the first of these that exists to try to load the public `Priv` package from the file `packages/Priv/HDKrT/src/Priv.jl` in the depot where it was found. -Here is a representation of the `paths` map for the `App` project environment: +Here is a representation of a possible paths map for our example `App` project environment, +as provided in the Manifest given above for the dependency graph, +after searching the local file system: ```julia -paths = Dict{Tuple{UUID,Symbol},String}( +paths = Dict( # Priv – the private one: (UUID("ba13f791-ae1d-465a-978b-69c3ad90f72b"), :Priv) => # relative entry-point inside `App` repo: @@ -190,26 +202,37 @@ paths = Dict{Tuple{UUID,Symbol},String}( ) ``` -This example map includes three different kinds of package locations: +This example map includes three different kinds of package locations (the first and third are part of the default load path): 1. The private `Priv` package is "[vendored](https://stackoverflow.com/a/35109534/659248)" inside the `App` repository. 2. The public `Priv` and `Zebra` packages are in the system depot, where packages installed and managed by the system administrator live. These are available to all users on the system. 3. The `Pub` package is in the user depot, where packages installed by the user live. These are only available to the user who installed them. + ### Package directories -Package directories provide a kind of environment that approximates package loading in Julia 0.6 and earlier, and which resembles package loading in many other dynamic languages. The set of packages available in a package directory corresponds to the set of subdirectories it contains that look like packages: if `X/src/X.jl` is a file in a package directory, then `X` is considered to be a package and `X/src/X.jl` is the file Julia loads to get `X`. Which packages can "see" each other as dependencies depends on whether they contain project files, and if they do, on what appears in those project files' `[deps]` sections. +Package directories provide a simpler kind of environment without the ability to handle name collisions. In a package directory, the set of top-level packages is the set of subdirectories that "look like" packages. A package `X` is exists in a package directory if the directory contains one of the following "entry point" files: + +- `X.jl` +- `X/src/X.jl` +- `X.jl/src/X.jl` -**The roots map** is determined by the subdirectories `X` of a package directory for which `X/src/X.jl` exists and whether `X/Project.toml` exists and has a top-level `uuid` entry. Specifically `:X => uuid` goes in `roots` for each such `X` where `uuid` is defined as: +Which dependencies a package in a package directory can import depends on whether the package contains a project file: + +* If it has a project file, it can only import those packages which are identified in the `[deps]` section of the project file. +* If it does not have a project file, it can import any top-level package—i.e. the same packages that can be loaded in `Main` or the REPL. + +**The roots map** is determined by examining the contents of the package directory to generate a list of all packages that exist. +Additionally, a UUID will be assigned to each entry as follows: For a given package found inside the folder `X`... 1. If `X/Project.toml` exists and has a `uuid` entry, then `uuid` is that value. -2. If `X/Project.toml` exists and but does *not* have a top-level UUID entry, `uuid` is a dummy UUID generated by hashing the canonical path of `X/Project.toml`. -3. If `X/Project.toml` does not exist, then `uuid` is the all-zero [nil UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Nil_UUID). +2. If `X/Project.toml` exists and but does *not* have a top-level UUID entry, `uuid` is a dummy UUID generated by hashing the canonical (real) path to `X/Project.toml`. +3. Otherwise (if `Project.toml` does not exist), then `uuid` is the all-zero [nil UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Nil_UUID). **The dependency graph** of a project directory is determined by the presence and contents of project files in the subdirectory of each package. The rules are: -- If a package subdirectory has no project file, then it is omitted from `graph` and import statements in its code are treated as top-level, the same as the main project and REPL. -- If a package subdirectory has a project file, then the `graph` entry for its UUID is the `[deps]` map of the project file, which is considered to be empty if the section is absent. +- If a package subdirectory has no project file, then it is omitted from graph and import statements in its code are treated as top-level, the same as the main project and REPL. +- If a package subdirectory has a project file, then the graph entry for its UUID is the `[deps]` map of the project file, which is considered to be empty if the section is absent. As an example, suppose a package directory has the following structure and content: @@ -246,10 +269,10 @@ Dingo/ # no imports ``` -Here is a corresponding `roots` structure, represented as a dictionary: +Here is a corresponding roots structure, represented as a dictionary: ```julia -roots = Dict{Symbol,UUID}( +roots = Dict( :Aardvark => UUID("00000000-0000-0000-0000-000000000000"), # no project file, nil UUID :Bobcat => UUID("85ad11c7-31f6-5d08-84db-0a4914d4cadf"), # dummy UUID based on path :Cobra => UUID("4725e24d-f727-424b-bca0-c4307a3456fa"), # UUID from project file @@ -257,21 +280,21 @@ roots = Dict{Symbol,UUID}( ) ``` -Here is the corresponding `graph` structure, represented as a dictionary: +Here is the corresponding graph structure, represented as a dictionary: ```julia -graph = Dict{UUID,Dict{Symbol,UUID}}( +graph = Dict( # Bobcat: - UUID("85ad11c7-31f6-5d08-84db-0a4914d4cadf") => Dict{Symbol,UUID}( + UUID("85ad11c7-31f6-5d08-84db-0a4914d4cadf") => Dict( :Cobra => UUID("4725e24d-f727-424b-bca0-c4307a3456fa"), :Dingo => UUID("7a7925be-828c-4418-bbeb-bac8dfc843bc"), ), # Cobra: - UUID("4725e24d-f727-424b-bca0-c4307a3456fa") => Dict{Symbol,UUID}( + UUID("4725e24d-f727-424b-bca0-c4307a3456fa") => Dict( :Dingo => UUID("7a7925be-828c-4418-bbeb-bac8dfc843bc"), ), # Dingo: - UUID("7a7925be-828c-4418-bbeb-bac8dfc843bc") => Dict{Symbol,UUID}(), + UUID("7a7925be-828c-4418-bbeb-bac8dfc843bc") => Dict(), ) ``` @@ -293,7 +316,7 @@ Observe the following specific instances of these rules in our example: **The paths map** in a package directory is simple: it maps subdirectory names to their corresponding entry-point paths. In other words, if the path to our example project directory is `/home/me/animals` then the `paths` map could be represented by this dictionary: ```julia -paths = Dict{Tuple{UUID,Symbol},String}( +paths = Dict( (UUID("00000000-0000-0000-0000-000000000000"), :Aardvark) => "/home/me/AnimalPackages/Aardvark/src/Aardvark.jl", (UUID("85ad11c7-31f6-5d08-84db-0a4914d4cadf"), :Bobcat) => @@ -309,9 +332,9 @@ Since all packages in a package directory environment are, by definition, subdir ### Environment stacks -The third and final kind of environment is one that combines other environments by overlaying several of them, making the packages in each available in a single composite environment. These composite environments are called *environment stacks*. The Julia `LOAD_PATH` global defines an environment stack—the environment in which the Julia process operates. If you want your Julia process to have access only to the packages in one project or package directory, make it the only entry in `LOAD_PATH`. It is often quite useful, however, to have access to some of your favorite tools—standard libraries, profilers, debuggers, personal utilities, etc.—even if they are not dependencies of the project you're working on. By pushing an environment containing these tools onto the load path, you immediately have access to them in top-level code without needing to add them to your project. +The third and final kind of environment is one that combines other environments by overlaying several of them, making the packages in each available in a single composite environment. These composite environments are called *environment stacks*. The Julia `LOAD_PATH` global defines an environment stack—the environment in which the Julia process operates. If you want your Julia process to have access only to the packages in one project or package directory, make it the only entry in `LOAD_PATH`. It is often quite useful, however, to have access to some of your favorite tools—standard libraries, profilers, debuggers, personal utilities, etc.—even if they are not dependencies of the project you're working on. By adding an environment containing these tools to the load path, you immediately have access to them in top-level code without needing to add them to your project. -The mechanism for combining the `roots`, `graph` and `paths` data structures of the components of an environment stack is simple: they are simply merged as dictionaries, favoring earlier entries over later ones in the case of key collisions. In other words, if we have `stack = [env₁, env₂, …]` then we have: +The mechanism for combining the roots, graph and paths data structures of the components of an environment stack is simple: they are merged as dictionaries, favoring earlier entries over later ones in the case of key collisions. In other words, if we have `stack = [env₁, env₂, …]` then we have: ```julia roots = reduce(merge, reverse([roots₁, roots₂, …])) @@ -319,13 +342,13 @@ graph = reduce(merge, reverse([graph₁, graph₂, …])) paths = reduce(merge, reverse([paths₁, paths₂, …])) ``` -The subscripted `rootsᵢ`, `graphᵢ` and `pathsᵢ` variables correspond to the subscripted environments, `envᵢ`, contained `stack`. The `reverse` is present because `merge` favors the last argument rather than first when there are collisions between keys in its argument dictionaries. That's all there is to stacked environments. There are a couple of noteworthy features of this design: +The subscripted `rootsᵢ`, `graphᵢ` and `pathsᵢ` variables correspond to the subscripted environments, `envᵢ`, contained in `stack`. The `reverse` is present because `merge` favors the last argument rather than first when there are collisions between keys in its argument dictionaries. There are a couple of noteworthy features of this design: 1. The *primary environment*—i.e. the first environment in a stack—is faithfully embedded in a stacked environment. The full dependency graph of the first environment in a stack is guaranteed to be included intact in the stacked environment including the same versions of all dependencies. -2. Packages in non-primary environments can end up using incompatible versions of their dependencies even if their own environments are entirely compatible. This can happen when one of their dependencies is shadowed by a version in an earlier environment in the stack. +2. Packages in non-primary environments can end up using incompatible versions of their dependencies even if their own environments are entirely compatible. This can happen when one of their dependencies is shadowed by a version in an earlier environment in the stack (either by graph or path, or both). -Since the primary environment is typically the environment of a project you're working on, while environments later in the stack contain additional tools, this is the right tradeoff: it's better to break your dev tools but keep the project working. When such incompatibilities occur, you'll typically want to upgrade your dev tools to versions that are compatible with the main project. +Since the primary environment is typically the environment of a project you're working on, while environments later in the stack contain additional tools, this is the right trade-off: it's better to break your development tools but keep the project working. When such incompatibilities occur, you'll typically want to upgrade your dev tools to versions that are compatible with the main project. ## Conclusion -Federated package management and precise software reproducibility are difficult but worthy goals in a package system. In combination, these goals lead to a more complex package loading mechanism than most dynamic languages have, but it also yields scalability and reproducibility that is more commonly associated with static languages. Fortunately, most Julia users can remain oblivious to the technical details of code loading and simply use the built-in package manager to add a package `X` to the appropriate project and manifest files and then write `import X` to load `X` without a further thought. +Federated package management and precise software reproducibility are difficult but worthy goals in a package system. In combination, these goals lead to a more complex package loading mechanism than most dynamic languages have, but it also yields scalability and reproducibility that is more commonly associated with static languages. Typically, Julia users should be able to use the built-in package manager to manage their projects without needing a precise understanding of these interactions. A call to `Pkg.add("X")` will add to the appropriate project and manifest files, selected via `Pkg.activate("Y")`, so that a future call to `import X` will load `X` without further thought. From 898bf8f00f9286d34016b804d358a830aea54b9e Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Tue, 18 Dec 2018 12:26:19 -0500 Subject: [PATCH 39/65] fix #30124, broadcast regression due to removed pure annotation (#30420) (cherry picked from commit e6938a052ab6a4c41414a5ff0febfff48e761dce) --- base/broadcast.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/broadcast.jl b/base/broadcast.jl index b7e49c376b6a5..4ebc1cfcd9f22 100644 --- a/base/broadcast.jl +++ b/base/broadcast.jl @@ -137,7 +137,7 @@ BroadcastStyle(a::AbstractArrayStyle, ::Style{Tuple}) = a BroadcastStyle(::A, ::A) where A<:ArrayStyle = A() BroadcastStyle(::ArrayStyle, ::ArrayStyle) = Unknown() BroadcastStyle(::A, ::A) where A<:AbstractArrayStyle = A() -function BroadcastStyle(a::A, b::B) where {A<:AbstractArrayStyle{M},B<:AbstractArrayStyle{N}} where {M,N} +Base.@pure function BroadcastStyle(a::A, b::B) where {A<:AbstractArrayStyle{M},B<:AbstractArrayStyle{N}} where {M,N} if Base.typename(A) === Base.typename(B) return A(Val(max(M, N))) end From 9a40122f42fae7e510980a5301dd5223bf0548ee Mon Sep 17 00:00:00 2001 From: Jarrett Revels Date: Thu, 13 Dec 2018 20:08:29 -0500 Subject: [PATCH 40/65] attempt to refine return type when it could be improved via PartialTuple (cherry picked from commit 92ac90e5d7334aa15fe71051e951afcdf13bc6a7) --- base/compiler/abstractinterpretation.jl | 8 ++++---- base/compiler/ssair/inlining.jl | 6 +++--- base/compiler/typeinfer.jl | 8 ++++++-- base/compiler/typeutils.jl | 9 +++++++++ test/compiler/inference.jl | 12 ++++++++++++ 5 files changed, 34 insertions(+), 9 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index c4043ab15a161..b1fab2f0f4e69 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -104,7 +104,7 @@ function abstract_call_gf_by_type(@nospecialize(f), argtypes::Vector{Any}, @nosp # if there's a possibility we could constant-propagate a better result # (hopefully without doing too much work), try to do that now # TODO: it feels like this could be better integrated into abstract_call_method / typeinf_edge - const_rettype = abstract_call_method_with_const_args(f, argtypes, applicable[nonbot]::SimpleVector, sv) + const_rettype = abstract_call_method_with_const_args(rettype, f, argtypes, applicable[nonbot]::SimpleVector, sv) if const_rettype ⊑ rettype # use the better result, if it's a refinement of rettype rettype = const_rettype @@ -142,7 +142,7 @@ function abstract_call_gf_by_type(@nospecialize(f), argtypes::Vector{Any}, @nosp return rettype end -function abstract_call_method_with_const_args(@nospecialize(f), argtypes::Vector{Any}, match::SimpleVector, sv::InferenceState) +function abstract_call_method_with_const_args(@nospecialize(rettype), @nospecialize(f), argtypes::Vector{Any}, match::SimpleVector, sv::InferenceState) method = match[3]::Method nargs::Int = method.nargs method.isva && (nargs -= 1) @@ -159,7 +159,7 @@ function abstract_call_method_with_const_args(@nospecialize(f), argtypes::Vector end end end - haveconst || return Any + haveconst || improvable_via_constant_propagation(rettype) || return Any sig = match[1] sparams = match[2]::SimpleVector code = code_for_method(method, sig, sparams, sv.params.world) @@ -1060,7 +1060,7 @@ function typeinf_local(frame::InferenceState) elseif hd === :return pc´ = n + 1 rt = widenconditional(abstract_eval(stmt.args[1], s[pc], frame)) - if !isa(rt, Const) && !isa(rt, Type) && (!isa(rt, PartialTuple) || frame.cached) + if !isa(rt, Const) && !isa(rt, Type) && !isa(rt, PartialTuple) # only propagate information we know we can store # and is valid inter-procedurally rt = widenconst(rt) diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index bbebe610ea49b..418afe10fcb46 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -671,7 +671,7 @@ function analyze_method!(idx::Int, @nospecialize(f), @nospecialize(ft), @nospeci return ConstantCase(quoted(linfo.inferred_const), method, Any[methsp...], metharg) end - isconst, inferred = find_inferred(linfo, atypes, sv) + isconst, inferred = find_inferred(linfo, atypes, sv, stmttyp) if isconst return ConstantCase(inferred, method, Any[methsp...], metharg) end @@ -1152,7 +1152,7 @@ function ssa_substitute_op!(@nospecialize(val), arg_replacements::Vector{Any}, return urs[] end -function find_inferred(linfo::MethodInstance, @nospecialize(atypes), sv::OptimizationState) +function find_inferred(linfo::MethodInstance, @nospecialize(atypes), sv::OptimizationState, @nospecialize(rettype)) # see if the method has a InferenceResult in the current cache # or an existing inferred code info store in `.inferred` haveconst = false @@ -1163,7 +1163,7 @@ function find_inferred(linfo::MethodInstance, @nospecialize(atypes), sv::Optimiz break end end - if haveconst + if haveconst || improvable_via_constant_propagation(rettype) inf_result = cache_lookup(linfo, atypes, sv.params.cache) # Union{Nothing, InferenceResult} else inf_result = nothing diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index d9c7b7c415ce0..ff9273de3cfd5 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -495,15 +495,19 @@ function typeinf_edge(method::Method, @nospecialize(atypes), sparams::SimpleVect frame.parent = caller end typeinf(frame) - return frame.bestguess, frame.inferred ? frame.linfo : nothing + return widenconst_bestguess(frame.bestguess), frame.inferred ? frame.linfo : nothing elseif frame === true # unresolvable cycle return Any, nothing end frame = frame::InferenceState - return frame.bestguess, nothing + return widenconst_bestguess(frame.bestguess), nothing end +function widenconst_bestguess(bestguess) + !isa(bestguess, Const) && !isa(bestguess, Type) && return widenconst(bestguess) + return bestguess +end #### entry points for inferring a MethodInstance given a type signature #### diff --git a/base/compiler/typeutils.jl b/base/compiler/typeutils.jl index 9b60dd2971fe3..c77f329ef2341 100644 --- a/base/compiler/typeutils.jl +++ b/base/compiler/typeutils.jl @@ -160,3 +160,12 @@ function unioncomplexity(t::DataType) end unioncomplexity(u::UnionAll) = max(unioncomplexity(u.body), unioncomplexity(u.var.ub)) unioncomplexity(@nospecialize(x)) = 0 + +function improvable_via_constant_propagation(@nospecialize(t)) + if isconcretetype(t) && t <: Tuple + for p in t.parameters + p === DataType && return true + end + end + return false +end diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index c6e59dc51412e..b89c4feb3a437 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -2172,3 +2172,15 @@ f30394(foo::T1, ::Type{T2}) where {T2, T1 <: T2} = foo f30394(foo, T2) = f30394(foo.foo_inner, T2) @test Base.return_types(f30394, (Foo30394_2, Type{Base30394})) == Any[Base30394] + +# PR #30385 + +g30385(args...) = h30385(args...) +h30385(f, args...) = f(args...) +f30385(T, y) = g30385(getfield, g30385(tuple, T, y), 1) +k30385(::Type{AbstractFloat}) = 1 +k30385(x) = "dummy" +j30385(T, y) = k30385(f30385(T, y)) + +@test @inferred(j30385(AbstractFloat, 1)) == 1 +@test @inferred(j30385(:dummy, 1)) == "dummy" From 3c086d61c45c3b83b1a25227069e45852d0114c6 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 19 Dec 2018 11:48:13 -0500 Subject: [PATCH 41/65] make `ndigits` more generic (#30384) (cherry picked from commit 2c714888b413c503590fd953196f7dcc2c3a32e3) --- base/intfuncs.jl | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 0be43a37b8635..8da0845258d13 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -445,15 +445,18 @@ ndigits0znb(x::Unsigned, b::Integer) = ndigits0znb(-signed(fld(x, -b)), b) + (x ndigits0znb(x::Bool, b::Integer) = x % Int # The suffix "pb" stands for "positive base" -# TODO: allow b::Integer -function ndigits0zpb(x::Base.BitUnsigned, b::Int) +function ndigits0zpb(x::Integer, b::Integer) # precondition: b > 1 x == 0 && return 0 - b < 0 && return ndigits0znb(signed(x), b) - b == 2 && return sizeof(x)<<3 - leading_zeros(x) - b == 8 && return (sizeof(x)<<3 - leading_zeros(x) + 2) ÷ 3 - b == 16 && return sizeof(x)<<1 - leading_zeros(x)>>2 - b == 10 && return ndigits0z(x) + b = Int(b) + x = abs(x) + if x isa Base.BitInteger + x = unsigned(x) + b == 2 && return sizeof(x)<<3 - leading_zeros(x) + b == 8 && return (sizeof(x)<<3 - leading_zeros(x) + 2) ÷ 3 + b == 16 && return sizeof(x)<<1 - leading_zeros(x)>>2 + b == 10 && return ndigits0z(x) + end d = 0 while x > typemax(Int) @@ -471,8 +474,6 @@ function ndigits0zpb(x::Base.BitUnsigned, b::Int) return d end -ndigits0zpb(x::Base.BitSigned, b::Integer) = ndigits0zpb(unsigned(abs(x)), Int(b)) -ndigits0zpb(x::Base.BitUnsigned, b::Integer) = ndigits0zpb(x, Int(b)) ndigits0zpb(x::Bool, b::Integer) = x % Int # The suffix "0z" means that the output is 0 on input zero (cf. #16841) From 235bdc7e330871d3252eeca33f773eba28246f2d Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Wed, 19 Dec 2018 22:39:11 +0100 Subject: [PATCH 42/65] Add link to the pdf version of the documentation to the html pages, fix #28604. (#30449) (cherry picked from commit 21f7a1ea4c154d501fcd11750bd789d570f057d6) --- doc/src/index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/src/index.md b/doc/src/index.md index b8fe2dc820fe3..ba11d6a3133c1 100644 --- a/doc/src/index.md +++ b/doc/src/index.md @@ -20,6 +20,18 @@ Markdown.parse(String(take!(io))) ``` Please read the [release notes](NEWS.md) to see what has changed since the last release. +```@eval +release = isempty(VERSION.prerelease) +file = release ? "julia-$(VERSION).pdf" : + "julia-$(VERSION.major).$(VERSION.minor).$(VERSION.patch)-$(first(VERSION.prerelease)).pdf" +url = "https://raw.githubusercontent.com/JuliaLang/docs.julialang.org/assets/$(file)" +import Markdown +Markdown.parse(""" +!!! note + The documentation is also available in PDF format: [$file]($url). +""") +``` + ### [Introduction](@id man-introduction) Scientific computing has traditionally required the highest performance, yet domain experts have From 5125952483612999c96be81e8efc7351d22c2a92 Mon Sep 17 00:00:00 2001 From: Dominique Date: Wed, 19 Dec 2018 20:42:28 -0500 Subject: [PATCH 43/65] generalize sparse matrix slicing to integer types (#30319) (cherry picked from commit 072ad7db4a0bdfa141713ae59dbf6b0706302481) --- stdlib/SparseArrays/src/sparsematrix.jl | 4 ++-- stdlib/SparseArrays/test/sparse.jl | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stdlib/SparseArrays/src/sparsematrix.jl b/stdlib/SparseArrays/src/sparsematrix.jl index 1832edfea1c22..1ce5b41ce5356 100644 --- a/stdlib/SparseArrays/src/sparsematrix.jl +++ b/stdlib/SparseArrays/src/sparsematrix.jl @@ -1974,8 +1974,8 @@ function getindex_cols(A::SparseMatrixCSC{Tv,Ti}, J::AbstractVector) where {Tv,T return SparseMatrixCSC(m, nJ, colptrS, rowvalS, nzvalS) end -getindex_traverse_col(::AbstractUnitRange, lo::Int, hi::Int) = lo:hi -getindex_traverse_col(I::StepRange, lo::Int, hi::Int) = step(I) > 0 ? (lo:1:hi) : (hi:-1:lo) +getindex_traverse_col(::AbstractUnitRange, lo::Integer, hi::Integer) = lo:hi +getindex_traverse_col(I::StepRange, lo::Integer, hi::Integer) = step(I) > 0 ? (lo:1:hi) : (hi:-1:lo) function getindex(A::SparseMatrixCSC{Tv,Ti}, I::AbstractRange, J::AbstractVector) where {Tv,Ti<:Integer} @assert !has_offset_axes(A, I, J) diff --git a/stdlib/SparseArrays/test/sparse.jl b/stdlib/SparseArrays/test/sparse.jl index c4f5e00fd28de..c46ab90c349b7 100644 --- a/stdlib/SparseArrays/test/sparse.jl +++ b/stdlib/SparseArrays/test/sparse.jl @@ -713,6 +713,8 @@ end @test ss116[:,:] == copy(ss116) + @test convert(SparseMatrixCSC{Float32,Int32}, sd116)[2:5,:] == convert(SparseMatrixCSC{Float32,Int32}, sd116[2:5,:]) + # range indexing @test Array(ss116[i,:]) == aa116[i,:] @test Array(ss116[:,j]) == aa116[:,j] From 6329be9aab7c59cc6550e19ae11e32a31fe7ced2 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 19 Dec 2018 23:39:34 -0500 Subject: [PATCH 44/65] coverage: support output in LCOV tracefile format (#30453) Also ensure that `julia_cmd` is forwarding all desirable options, and provide a general framework for specifying formatted filenames for similar such options. --- NEWS.md | 2 + base/options.jl | 1 + base/util.jl | 87 ++++++++++++++++++++--------- src/codegen.cpp | 70 +++++++++++++++++++---- src/init.c | 56 +++++++++++++++++-- src/jloptions.c | 16 +++++- src/julia.h | 2 + src/processor.cpp | 8 +-- src/processor.h | 1 + src/runtime_ccall.cpp | 81 +++++++++++++++++++++++++++ test/cmdlineargs.jl | 87 +++++++++++++++++++++++------ test/spawn.jl | 6 +- test/testenv.jl | 16 +++--- test/testhelpers/coverage_file.info | 10 ++++ test/testhelpers/coverage_file.jl | 17 ++++++ 15 files changed, 383 insertions(+), 77 deletions(-) create mode 100644 test/testhelpers/coverage_file.info create mode 100644 test/testhelpers/coverage_file.jl diff --git a/NEWS.md b/NEWS.md index 82eabe62f81b2..852ecc7902871 100644 --- a/NEWS.md +++ b/NEWS.md @@ -39,6 +39,8 @@ Command-line option changes * When a script run in interactive mode (`-i`) throws an error, the REPL now starts after the error is displayed. Previously the REPL only started if the script completed without error ([#21233]). + * The code-coverage option now supports output in the LCOV tracefile format and + gets propagated to child processes, such as precompile steps and test workers ([#30381]). New library functions --------------------- diff --git a/base/options.jl b/base/options.jl index 0706b1c07d72f..f7dec64f9b41d 100644 --- a/base/options.jl +++ b/base/options.jl @@ -39,6 +39,7 @@ struct JLOptions outputjitbc::Ptr{UInt8} outputo::Ptr{UInt8} outputji::Ptr{UInt8} + output_code_coverage::Ptr{UInt8} incremental::Int8 end diff --git a/base/util.jl b/base/util.jl index 479062c058161..77ff86070ce82 100644 --- a/base/util.jl +++ b/base/util.jl @@ -399,42 +399,79 @@ printstyled(io::IO, msg...; bold::Bool=false, color::Union{Int,Symbol}=:normal) with_output_color(print, color, io, msg...; bold=bold) printstyled(msg...; bold::Bool=false, color::Union{Int,Symbol}=:normal) = printstyled(stdout, msg...; bold=bold, color=color) + """ Base.julia_cmd(juliapath=joinpath(Sys.BINDIR::String, julia_exename())) Return a julia command similar to the one of the running process. -Propagates the `--cpu-target`, `--sysimage`, --compile `, `--depwarn` -and `--inline` command line arguments. +Propagates any of the `--cpu-target`, `--sysimage`, `--compile`, `--sysimage-native-code`, +`--compiled-modules`, `--inline`, `--check-bounds`, `--optimize`, `-g`, +`--code-coverage`, and `--depwarn` +command line arguments that are not at their default values. + +Among others, `--math-mode`, `--warn-overwrite`, and `--trace-compile` are notably not propagated currently. !!! compat "Julia 1.1" - The `--inline` flag is only propagated in Julia 1.1 and later. + Only the `--cpu-target`, `--sysimage`, `--depwarn`, `--compile` and `--check-bounds` flags were propagated before Julia 1.1. """ function julia_cmd(julia=joinpath(Sys.BINDIR::String, julia_exename())) opts = JLOptions() cpu_target = unsafe_string(opts.cpu_target) image_file = unsafe_string(opts.image_file) - compile = if opts.compile_enabled == 0 - "no" - elseif opts.compile_enabled == 2 - "all" - elseif opts.compile_enabled == 3 - "min" - else - "yes" - end - depwarn = if opts.depwarn == 0 - "no" - elseif opts.depwarn == 2 - "error" - else - "yes" - end - inline = if opts.can_inline == 0 - "no" - else - "yes" - end - `$julia -C$cpu_target -J$image_file --compile=$compile --depwarn=$depwarn --inline=$inline` + addflags = String[] + let compile = if opts.compile_enabled == 0 + "no" + elseif opts.compile_enabled == 2 + "all" + elseif opts.compile_enabled == 3 + "min" + else + "" # default = "yes" + end + isempty(compile) || push!(addflags, "--compile=$compile") + end + let depwarn = if opts.depwarn == 0 + "no" + elseif opts.depwarn == 2 + "error" + else + "" # default = "yes" + end + isempty(depwarn) || push!(addflags, "--depwarn=$depwarn") + end + let check_bounds = if opts.check_bounds == 1 + "yes" # on + elseif opts.check_bounds == 2 + "no" # off + else + "" # "default" + end + isempty(check_bounds) || push!(addflags, "--check-bounds=$check_bounds") + end + opts.can_inline == 0 && push!(addflags, "--inline=no") + opts.use_compiled_modules == 0 && push!(addflags, "--compiled-modules=no") + opts.opt_level == 2 || push!(addflags, "-O$(opts.opt_level)") + push!(addflags, "-g$(opts.debug_level)") + if opts.code_coverage != 0 + # Forward the code-coverage flag only if applicable (if the filename is pid-dependent) + coverage_file = (opts.output_code_coverage != C_NULL) ? unsafe_string(opts.output_code_coverage) : "" + if isempty(coverage_file) || occursin("%p", coverage_file) + if opts.code_coverage == 1 + push!(addflags, "--code-coverage=user") + elseif opts.code_coverage == 2 + push!(addflags, "--code-coverage=all") + end + isempty(coverage_file) || push!(addflags, "--code-coverage=$coverage_file") + end + end + if opts.malloc_log != 0 + if opts.malloc_log == 1 + push!(addflags, "--track-allocation=user") + elseif opts.malloc_log == 2 + push!(addflags, "--track-allocation=all") + end + end + return `$julia -C$cpu_target -J$image_file $addflags` end function julia_exename() diff --git a/src/codegen.cpp b/src/codegen.cpp index 9a8da73e388ac..d4f0abb748522 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1696,7 +1696,7 @@ static void write_log_data(logdata_t &logData, const char *extension) std::ifstream inf(filename.c_str()); if (inf.is_open()) { std::string outfile = filename + extension; - std::ofstream outf(outfile.c_str(), std::ofstream::trunc | std::ofstream::out); + std::ofstream outf(outfile.c_str(), std::ofstream::trunc | std::ofstream::out | std::ofstream::binary); char line[1024]; int l = 1; unsigned block = 0; @@ -1722,7 +1722,7 @@ static void write_log_data(logdata_t &logData, const char *extension) else outf << (value - 1); outf.width(0); - outf << " " << line << std::endl; + outf << " " << line << '\n'; } outf.close(); inf.close(); @@ -1732,20 +1732,68 @@ static void write_log_data(logdata_t &logData, const char *extension) } extern "C" int jl_getpid(); -extern "C" void jl_write_coverage_data(void) + +static void write_lcov_data(logdata_t &logData, const std::string &outfile) { - std::ostringstream stm; - stm << jl_getpid(); - std::string outf = "." + stm.str() + ".cov"; - write_log_data(coverageData, outf.c_str()); + std::ofstream outf(outfile.c_str(), std::ofstream::ate | std::ofstream::out | std::ofstream::binary); + //std::string base = std::string(jl_options.julia_bindir); + //base = base + "/../share/julia/base/"; + logdata_t::iterator it = logData.begin(); + for (; it != logData.end(); it++) { + const std::string &filename = it->first(); + const std::vector &values = it->second; + if (!values.empty()) { + //if (!isabspath(filename.c_str())) + // filename = base + filename; + outf << "SF:" << filename << '\n'; + size_t n_covered = 0; + size_t n_instrumented = 0; + size_t lno = 0; + for (auto &itv : values) { + if (itv) { + logdata_block &data = *itv; + for (int i = 0; i < logdata_blocksize; i++) { + auto cov = data[i]; + if (cov > 0) { + n_instrumented++; + if (cov > 1) + n_covered++; + outf << "DA:" << lno << ',' << (cov - 1) << '\n'; + } + lno++; + } + } + else { + lno += logdata_blocksize; + } + } + outf << "LH:" << n_covered << '\n'; + outf << "LF:" << n_instrumented << '\n'; + outf << "end_of_record\n"; + } + } + outf.close(); +} + +extern "C" void jl_write_coverage_data(const char *output) +{ + if (output) { + StringRef output_pattern(output); + if (output_pattern.endswith(".info")) + write_lcov_data(coverageData, jl_format_filename(output_pattern)); + } + else { + std::ostringstream stm; + stm << "." << jl_getpid() << ".cov"; + write_log_data(coverageData, stm.str().c_str()); + } } extern "C" void jl_write_malloc_log(void) { std::ostringstream stm; - stm << jl_getpid(); - std::string outf = "." + stm.str() + ".mem"; - write_log_data(mallocData, outf.c_str()); + stm << "." << jl_getpid() << ".mem"; + write_log_data(mallocData, stm.str().c_str()); } // --- constant determination --- @@ -7368,7 +7416,7 @@ extern "C" void *jl_init_llvm(void) cl::ParseEnvironmentOptions("Julia", "JULIA_LLVM_ARGS"); jl_page_size = jl_getpagesize(); - imaging_mode = jl_generating_output(); + imaging_mode = jl_generating_output() && !jl_options.incremental; jl_init_debuginfo(); #ifdef USE_POLLY diff --git a/src/init.c b/src/init.c index c3e4ede715b56..50f590c54bba7 100644 --- a/src/init.c +++ b/src/init.c @@ -163,7 +163,7 @@ static void jl_uv_exitcleanup_walk(uv_handle_t *handle, void *arg) jl_uv_exitcleanup_add(handle, (struct uv_shutdown_queue*)arg); } -void jl_write_coverage_data(void); +void jl_write_coverage_data(const char*); void jl_write_malloc_log(void); void jl_write_compiler_output(void); @@ -222,7 +222,7 @@ JL_DLLEXPORT void jl_atexit_hook(int exitcode) jl_write_compiler_output(); jl_print_gc_stats(JL_STDERR); if (jl_options.code_coverage) - jl_write_coverage_data(); + jl_write_coverage_data(jl_options.output_code_coverage); if (jl_options.malloc_log) jl_write_malloc_log(); if (jl_base_module) { @@ -462,7 +462,7 @@ int isabspath(const char *in) } static char *abspath(const char *in, int nprefix) -{ // compute an absolute path location, so that chdir doesn't change the file reference +{ // compute an absolute realpath location, so that chdir doesn't change the file reference // ignores (copies directly over) nprefix characters at the start of abspath #ifndef _OS_WINDOWS_ char *out = realpath(in + nprefix, NULL); @@ -495,6 +495,8 @@ static char *abspath(const char *in, int nprefix) jl_error("fatal error: unexpected error while retrieving current working directory"); } out = (char*)malloc(path_size + 1 + sz + nprefix); + if (!out) + jl_errorf("fatal error: failed to allocate memory: %s", strerror(errno)); memcpy(out, in, nprefix); memcpy(out + nprefix, path, path_size); out[nprefix + path_size] = PATHSEPSTRING[0]; @@ -508,6 +510,8 @@ static char *abspath(const char *in, int nprefix) jl_error("fatal error: jl_options.image_file path too long or GetFullPathName failed"); } char *out = (char*)malloc(n + nprefix); + if (!out) + jl_errorf("fatal error: failed to allocate memory: %s", strerror(errno)); DWORD m = GetFullPathName(in + nprefix, n, out + nprefix, NULL); if (n != m + 1) { jl_error("fatal error: jl_options.image_file path too long or GetFullPathName failed"); @@ -517,6 +521,38 @@ static char *abspath(const char *in, int nprefix) return out; } +// create an absolute-path copy of the input path format string +// formed as `joinpath(replace(pwd(), "%" => "%%"), in)` +// unless `in` starts with `%` +static const char *absformat(const char *in) +{ + if (in[0] == '%' || isabspath(in)) + return in; + // get an escaped copy of cwd + size_t path_size = PATH_MAX; + char path[PATH_MAX]; + if (uv_cwd(path, &path_size)) { + jl_error("fatal error: unexpected error while retrieving current working directory"); + } + size_t sz = strlen(in) + 1; + size_t i, fmt_size = 0; + for (i = 0; i < path_size; i++) + fmt_size += (path[i] == '%' ? 2 : 1); + char *out = (char*)malloc(fmt_size + 1 + sz); + if (!out) + jl_errorf("fatal error: failed to allocate memory: %s", strerror(errno)); + fmt_size = 0; + for (i = 0; i < path_size; i++) { // copy-replace pwd portion + char c = path[i]; + out[fmt_size++] = c; + if (c == '%') + out[fmt_size++] = '%'; + } + out[fmt_size++] = PATHSEPSTRING[0]; // path sep + memcpy(out + fmt_size, in, sz); // copy over format, including nul + return out; +} + static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel) { // this function resolves the paths in jl_options to absolute file locations as needed // and it replaces the pointers to `julia_bindir`, `julia_bin`, `image_file`, and output file paths @@ -527,6 +563,8 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel) // calling `julia_init()` char *free_path = (char*)malloc(PATH_MAX); size_t path_size = PATH_MAX; + if (!free_path) + jl_errorf("fatal error: failed to allocate memory: %s", strerror(errno)); if (uv_exepath(free_path, &path_size)) { jl_error("fatal error: unexpected error while retrieving exepath"); } @@ -534,6 +572,8 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel) jl_error("fatal error: jl_options.julia_bin path too long"); } jl_options.julia_bin = (char*)malloc(path_size+1); + if (!jl_options.julia_bin) + jl_errorf("fatal error: failed to allocate memory: %s", strerror(errno)); memcpy((char*)jl_options.julia_bin, free_path, path_size); ((char*)jl_options.julia_bin)[path_size] = '\0'; if (!jl_options.julia_bindir) { @@ -550,6 +590,8 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel) if (rel == JL_IMAGE_JULIA_HOME && !isabspath(jl_options.image_file)) { // build time path, relative to JULIA_BINDIR free_path = (char*)malloc(PATH_MAX); + if (!free_path) + jl_errorf("fatal error: failed to allocate memory: %s", strerror(errno)); int n = snprintf(free_path, PATH_MAX, "%s" PATHSEPSTRING "%s", jl_options.julia_bindir, jl_options.image_file); if (n >= PATH_MAX || n < 0) { @@ -572,8 +614,13 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel) jl_options.outputbc = abspath(jl_options.outputbc, 0); if (jl_options.machine_file) jl_options.machine_file = abspath(jl_options.machine_file, 0); - if (jl_options.project && strncmp(jl_options.project, "@.", strlen(jl_options.project)) != 0) + if (jl_options.project + && strcmp(jl_options.project, "@.") != 0 + && strcmp(jl_options.project, "@") != 0 + && strcmp(jl_options.project, "") != 0) jl_options.project = abspath(jl_options.project, 0); + if (jl_options.output_code_coverage) + jl_options.output_code_coverage = absformat(jl_options.output_code_coverage); const char **cmdp = jl_options.cmds; if (cmdp) { @@ -600,6 +647,7 @@ void _julia_init(JL_IMAGE_SEARCH rel) jl_get_ptls_states_getter(); #endif jl_ptls_t ptls = jl_get_ptls_states(); + (void)ptls; assert(ptls); // make sure early that we have initialized ptls jl_safepoint_init(); libsupport_init(); htable_new(&jl_current_modules, 0); diff --git a/src/jloptions.c b/src/jloptions.c index 42fdafb9d0dcd..3e5e2f20c096e 100644 --- a/src/jloptions.c +++ b/src/jloptions.c @@ -68,6 +68,7 @@ jl_options_t jl_options = { 0, // quiet NULL, // output-jit-bc NULL, // output-o NULL, // output-ji + NULL, // output-code_coverage 0, // incremental 0 // image_file_specified }; @@ -129,6 +130,9 @@ static const char opts[] = // instrumentation options " --code-coverage={none|user|all}, --code-coverage\n" " Count executions of source lines (omitting setting is equivalent to \"user\")\n" + " --code-coverage=tracefile.info\n" + " Append coverage information to the LCOV tracefile (filename supports format tokens).\n" +// TODO: These TOKENS are defined in `runtime_ccall.cpp`. A more verbose `--help` should include that list here. " --track-allocation={none|user|all}, --track-allocation\n" " Count bytes allocated by each source line\n\n" @@ -437,12 +441,18 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) break; case opt_code_coverage: if (optarg != NULL) { - if (!strcmp(optarg,"user")) + size_t endof = strlen(optarg); + if (!strcmp(optarg, "user")) codecov = JL_LOG_USER; - else if (!strcmp(optarg,"all")) + else if (!strcmp(optarg, "all")) codecov = JL_LOG_ALL; - else if (!strcmp(optarg,"none")) + else if (!strcmp(optarg, "none")) codecov = JL_LOG_NONE; + else if (endof > 5 && !strcmp(optarg + endof - 5, ".info")) { + if (codecov == JL_LOG_NONE) + codecov = JL_LOG_ALL; + jl_options.output_code_coverage = optarg; + } else jl_errorf("julia: invalid argument to --code-coverage (%s)", optarg); break; diff --git a/src/julia.h b/src/julia.h index fbc1eb2461b66..9624abba6acb2 100644 --- a/src/julia.h +++ b/src/julia.h @@ -1810,6 +1810,7 @@ typedef struct { const char *outputjitbc; const char *outputo; const char *outputji; + const char *output_code_coverage; int8_t incremental; int8_t image_file_specified; } jl_options_t; @@ -1820,6 +1821,7 @@ JL_DLLEXPORT ssize_t jl_sizeof_jl_options(void); // Parse an argc/argv pair to extract general julia options, passing back out // any arguments that should be passed on to the script. JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp); +JL_DLLEXPORT char *jl_format_filename(const char *output_pattern); // Set julia-level ARGS array according to the arguments provided in // argc/argv diff --git a/src/processor.cpp b/src/processor.cpp index bcc524f07d7ac..539ff22e7e914 100644 --- a/src/processor.cpp +++ b/src/processor.cpp @@ -2,6 +2,10 @@ // Processor feature detection +#include "llvm-version.h" +#include +#include + #include "processor.h" #include "julia.h" @@ -10,10 +14,6 @@ #include #include -#include "llvm-version.h" -#include -#include - #include "julia_assert.h" // CPU target string is a list of strings separated by `;` each string starts with a CPU diff --git a/src/processor.h b/src/processor.h index 8fc004364c6a5..114e46912c2a9 100644 --- a/src/processor.h +++ b/src/processor.h @@ -208,4 +208,5 @@ struct jl_target_spec_t { std::vector jl_get_llvm_clone_targets(void); std::string jl_get_cpu_name_llvm(void); std::string jl_get_cpu_features_llvm(void); +std::string jl_format_filename(llvm::StringRef output_pattern); #endif diff --git a/src/runtime_ccall.cpp b/src/runtime_ccall.cpp index 60b03adcaa87f..9376fd1b92aae 100644 --- a/src/runtime_ccall.cpp +++ b/src/runtime_ccall.cpp @@ -5,6 +5,8 @@ #include #include #include +#include + #include "julia.h" #include "julia_internal.h" #include "processor.h" @@ -107,6 +109,85 @@ jl_value_t *jl_get_JIT(void) return jl_pchar_to_string(HostJITName.data(), HostJITName.size()); } +#ifndef MAXHOSTNAMELEN +# define MAXHOSTNAMELEN 256 +#endif + +extern "C" int jl_getpid(); + +// Form a file name from a pattern made by replacing tokens, +// similar to many of those provided by ssh_config TOKENS: +// +// %% A literal `%'. +// %p The process PID +// %d Local user's home directory. +// %i The local user ID. +// %L The local hostname. +// %l The local hostname, including the domain name. +// %u The local username. +std::string jl_format_filename(StringRef output_pattern) +{ + std::string buf; + llvm::raw_string_ostream outfile(buf); + bool special = false; + char hostname[MAXHOSTNAMELEN + 1]; + uv_passwd_t pwd; + bool got_pwd = false; + for (auto c : output_pattern) { + if (special) { + if (!got_pwd && (c == 'i' || c == 'd' || c == 'u')) { + uv_os_get_passwd(&pwd); + got_pwd = true; + } + switch (c) { + case 'p': + outfile << jl_getpid(); + break; + case 'd': + outfile << pwd.homedir; + break; + case 'i': + outfile << pwd.uid; + break; + case 'l': + case 'L': + if (gethostname(hostname, sizeof(hostname)) == 0) { + hostname[sizeof(hostname) - 1] = '\0'; /* Null terminate, just to be safe. */ + outfile << hostname; + } +#ifndef _OS_WINDOWS_ + if (c == 'l' && getdomainname(hostname, sizeof(hostname)) == 0) { + hostname[sizeof(hostname) - 1] = '\0'; /* Null terminate, just to be safe. */ + outfile << hostname; + } +#endif + break; + case 'u': + outfile << pwd.username; + break; + default: + outfile << c; + break; + } + special = false; + } + else if (c == '%') { + special = true; + } + else { + outfile << c; + } + } + if (got_pwd) + uv_os_free_passwd(&pwd); + return outfile.str(); +} + +extern "C" JL_DLLEXPORT char *jl_format_filename(const char *output_pattern) +{ + return strdup(jl_format_filename(StringRef(output_pattern)).c_str()); +} + static void *trampoline_freelist; diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 473a0452adfeb..1880b497398e5 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -24,8 +24,27 @@ function readchomperrors(exename::Cmd) return (success(p), fetch(o), fetch(e)) end +function format_filename(s) + p = ccall(:jl_format_filename, Cstring, (Cstring,), s) + r = unsafe_string(p) + ccall(:free, Cvoid, (Cstring,), p) + return r +end -let exename = `$(Base.julia_cmd()) --sysimage-native-code=yes --startup-file=no` +let + fn = format_filename("a%d %p %i %L %l %u z") + hd = withenv("HOME" => nothing) do + homedir() + end + @test startswith(fn, "a$hd ") + @test endswith(fn, " z") + @test !occursin('%', fn) + @test occursin(" $(getpid()) ", fn) + @test occursin(" $(Libc.gethostname()) ", fn) + @test format_filename("%a%%b") == "a%b" +end + +let exename = `$(Base.julia_cmd()) --startup-file=no` # tests for handling of ENV errors let v = writereadpipeline("println(\"REPL: \", @which(less), @isdefined(InteractiveUtils))", setenv(`$exename -i -E 'empty!(LOAD_PATH); @isdefined InteractiveUtils'`, @@ -65,7 +84,7 @@ let exename = `$(Base.julia_cmd()) --sysimage-native-code=yes --startup-file=no` end end -let exename = `$(Base.julia_cmd()) --sysimage-native-code=yes --startup-file=no` +let exename = `$(Base.julia_cmd()) --startup-file=no` # --version let v = split(read(`$exename -v`, String), "julia version ")[end] @test Base.VERSION_STRING == chomp(v) @@ -186,14 +205,40 @@ let exename = `$(Base.julia_cmd()) --sysimage-native-code=yes --startup-file=no` @test !success(`$exename --history-file=false`) # --code-coverage - @test readchomp(`$exename -E "Bool(Base.JLOptions().code_coverage)"`) == "false" - @test readchomp(`$exename -E "Bool(Base.JLOptions().code_coverage)" - --code-coverage=none`) == "false" - - @test readchomp(`$exename -E "Bool(Base.JLOptions().code_coverage)" - --code-coverage`) == "true" - @test readchomp(`$exename -E "Bool(Base.JLOptions().code_coverage)" - --code-coverage=user`) == "true" + mktempdir() do dir + helperdir = joinpath(@__DIR__, "testhelpers") + inputfile = joinpath(helperdir, "coverage_file.jl") + expected = replace(read(joinpath(helperdir, "coverage_file.info"), String), + "" => inputfile) + covfile = replace(joinpath(dir, "coverage.info"), "%" => "%%") + @test !isfile(covfile) + defaultcov = readchomp(`$exename -E "Bool(Base.JLOptions().code_coverage)" -L $inputfile`) + opts = Base.JLOptions() + coverage_file = (opts.output_code_coverage != C_NULL) ? unsafe_string(opts.output_code_coverage) : "" + @test !isfile(covfile) + @test defaultcov == string(opts.code_coverage != 0 && (isempty(coverage_file) || occursin("%p", coverage_file))) + @test readchomp(`$exename -E "Base.JLOptions().code_coverage" -L $inputfile + --code-coverage=$covfile --code-coverage=none`) == "0" + @test !isfile(covfile) + @test readchomp(`$exename -E "Base.JLOptions().code_coverage" -L $inputfile + --code-coverage=$covfile --code-coverage`) == "1" + @test isfile(covfile) + got = read(covfile, String) + @test occursin(expected, got) || got + rm(covfile) + @test readchomp(`$exename -E "Base.JLOptions().code_coverage" -L $inputfile + --code-coverage=$covfile --code-coverage=user`) == "1" + @test isfile(covfile) + got = read(covfile, String) + @test occursin(expected, got) || got + rm(covfile) + @test readchomp(`$exename -E "Base.JLOptions().code_coverage" -L $inputfile + --code-coverage=$covfile --code-coverage=all`) == "2" + @test isfile(covfile) + got = read(covfile, String) + @test occursin(expected, got) || got + rm(covfile) + end # --track-allocation @test readchomp(`$exename -E "Bool(Base.JLOptions().malloc_log)"`) == "false" @@ -242,11 +287,13 @@ let exename = `$(Base.julia_cmd()) --sysimage-native-code=yes --startup-file=no` let JL_OPTIONS_CHECK_BOUNDS_DEFAULT = 0, JL_OPTIONS_CHECK_BOUNDS_ON = 1, JL_OPTIONS_CHECK_BOUNDS_OFF = 2 - @test parse(Int,readchomp(`$exename -E "Int(Base.JLOptions().check_bounds)"`)) == + exename_default_checkbounds = `$exename` + filter!(a -> !startswith(a, "--check-bounds="), exename_default_checkbounds.exec) + @test parse(Int, readchomp(`$exename_default_checkbounds -E "Int(Base.JLOptions().check_bounds)"`)) == JL_OPTIONS_CHECK_BOUNDS_DEFAULT - @test parse(Int,readchomp(`$exename -E "Int(Base.JLOptions().check_bounds)" + @test parse(Int, readchomp(`$exename -E "Int(Base.JLOptions().check_bounds)" --check-bounds=yes`)) == JL_OPTIONS_CHECK_BOUNDS_ON - @test parse(Int,readchomp(`$exename -E "Int(Base.JLOptions().check_bounds)" + @test parse(Int, readchomp(`$exename -E "Int(Base.JLOptions().check_bounds)" --check-bounds=no`)) == JL_OPTIONS_CHECK_BOUNDS_OFF end # check-bounds takes yes/no as argument @@ -436,7 +483,7 @@ end libjulia = abspath(Libdl.dlpath((ccall(:jl_is_debugbuild, Cint, ()) != 0) ? "libjulia-debug" : "libjulia")) # test error handling code paths of running --sysimage -let exename = joinpath(Sys.BINDIR, Base.julia_exename()), +let exename = Base.julia_cmd() sysname = unsafe_string(Base.JLOptions().image_file) for nonexist_image in ( joinpath(@__DIR__, "nonexistent"), @@ -467,7 +514,7 @@ let exename = joinpath(Sys.BINDIR, Base.julia_exename()), end end -let exename = `$(Base.julia_cmd()) --sysimage-native-code=yes` +let exename = Base.julia_cmd() # --startup-file let JL_OPTIONS_STARTUPFILE_ON = 1, JL_OPTIONS_STARTUPFILE_OFF = 2 @@ -563,6 +610,12 @@ end # Issue #29855 for yn in ("no", "yes") - exename = `$(Base.julia_cmd()) --startup-file=no --inline=$yn` - @test occursin("--inline=$yn", first(writereadpipeline("Base.julia_cmd()", exename))) + exename = `$(Base.julia_cmd()) --inline=no --startup-file=no --inline=$yn` + v = writereadpipeline("Base.julia_cmd()", exename) + if yn == "no" + @test occursin(r" --inline=no", v[1]) + else + @test !occursin(" --inline", v[1]) + end + @test v[2] end diff --git a/test/spawn.jl b/test/spawn.jl index 2840f5ecea030..3a165d6254a03 100644 --- a/test/spawn.jl +++ b/test/spawn.jl @@ -524,11 +524,7 @@ end # Sys.which() testing psep = if Sys.iswindows() ";" else ":" end withenv("PATH" => "$(Sys.BINDIR)$(psep)$(ENV["PATH"])") do - julia_exe = joinpath(Sys.BINDIR, "julia") - if Sys.iswindows() - julia_exe *= ".exe" - end - + julia_exe = joinpath(Sys.BINDIR, Base.julia_exename()) @test Sys.which("julia") == realpath(julia_exe) @test Sys.which(julia_exe) == realpath(julia_exe) end diff --git a/test/testenv.jl b/test/testenv.jl index fa37efbfc32f2..9094ab66f197e 100644 --- a/test/testenv.jl +++ b/test/testenv.jl @@ -10,20 +10,20 @@ if !@isdefined(testenv_defined) if haskey(ENV, "JULIA_TEST_EXEFLAGS") const test_exeflags = `$(Base.shell_split(ENV["JULIA_TEST_EXEFLAGS"]))` else - inline_flag = Base.JLOptions().can_inline == 1 ? `` : `--inline=no` - cov_flag = `` - if Base.JLOptions().code_coverage == 1 - cov_flag = `--code-coverage=user` - elseif Base.JLOptions().code_coverage == 2 - cov_flag = `--code-coverage=all` + const test_exeflags = Base.julia_cmd() + filter!(test_exeflags.exec) do c + return !(startswith(c, "--depwarn") || startswith(c, "--check-bounds")) end - const test_exeflags = `$cov_flag $inline_flag --check-bounds=yes --startup-file=no --depwarn=error` + push!(test_exeflags.exec, "--check-bounds=yes") + push!(test_exeflags.exec, "--startup-file=no") + push!(test_exeflags.exec, "--depwarn=error") end if haskey(ENV, "JULIA_TEST_EXENAME") + popfirst!(test_exeflags.exec) const test_exename = `$(Base.shell_split(ENV["JULIA_TEST_EXENAME"]))` else - const test_exename = `$(joinpath(Sys.BINDIR, Base.julia_exename()))` + const test_exename = popfirst!(test_exeflags.exec) end addprocs_with_testenv(X; kwargs...) = addprocs(X; exename=test_exename, exeflags=test_exeflags, kwargs...) diff --git a/test/testhelpers/coverage_file.info b/test/testhelpers/coverage_file.info new file mode 100644 index 0000000000000..c6319ab5886eb --- /dev/null +++ b/test/testhelpers/coverage_file.info @@ -0,0 +1,10 @@ +SF: +DA:4,2 +DA:5,0 +DA:7,1 +DA:8,1 +DA:9,5 +DA:11,1 +LH:5 +LF:6 +end_of_record diff --git a/test/testhelpers/coverage_file.jl b/test/testhelpers/coverage_file.jl new file mode 100644 index 0000000000000..87ab5766f6046 --- /dev/null +++ b/test/testhelpers/coverage_file.jl @@ -0,0 +1,17 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license + +function code_coverage_test() + if rand(1:2) == 3 + return "hello" + else + r = Int[] + for i = 1:3 + push!(r, i) + end + return r + end +end + +exit(code_coverage_test() == [1, 2, 3] ? 0 : 1) + +# end of file From 3381093865e8a4e178bb9c963f7544bcf5c200b6 Mon Sep 17 00:00:00 2001 From: Markus Kuhn Date: Thu, 20 Dec 2018 07:34:18 +0000 Subject: [PATCH 45/65] Base.worker_timeout() mention in manual (#30439) The manual mentions at https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_WORKER_TIMEOUT-1 a function Base.worker_timeout() but the implementation has instead only a function Distributed.worker_timeout() (cherry picked from commit 258e08a605a35a34dcc181b74f2b311459ee84c4) --- doc/src/manual/environment-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/manual/environment-variables.md b/doc/src/manual/environment-variables.md index 7bc47ba43ed2a..c410adce6e5dd 100644 --- a/doc/src/manual/environment-variables.md +++ b/doc/src/manual/environment-variables.md @@ -151,7 +151,7 @@ logical CPU cores available. ### `JULIA_WORKER_TIMEOUT` -A [`Float64`](@ref) that sets the value of `Base.worker_timeout()` (default: `60.0`). +A [`Float64`](@ref) that sets the value of `Distributed.worker_timeout()` (default: `60.0`). This function gives the number of seconds a worker process will wait for a master process to establish a connection before dying. From 4e97adfe2437bb31ae24605d224f8a82ed2fc026 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Sat, 22 Dec 2018 00:33:20 +0100 Subject: [PATCH 46/65] Only use llvm-config for library selection when building against system LLVM. (#30459) (cherry picked from commit 7acb991b981e4ccd7e443c8f1fb115ef70a9cffc) --- base/Makefile | 9 ++++++++- src/Makefile | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/base/Makefile b/base/Makefile index b569ed5227ffc..acdd4bb9f82d6 100644 --- a/base/Makefile +++ b/base/Makefile @@ -200,8 +200,15 @@ endif endif # WINNT symlink_libLLVM: $(build_private_libdir)/libLLVM.dylib +ifneq ($(USE_SYSTEM_LLVM),0) +LLVM_CONFIG_HOST_LIBS := $(shell $(LLVM_CONFIG_HOST) --libfiles) +# HACK: llvm-config doesn't correctly point to shared libs on all platforms +# https://github.com/JuliaLang/julia/issues/29981 +else +LLVM_CONFIG_HOST_LIBS := $(shell $(LLVM_CONFIG_HOST) --libdir)/libLLVM.$(SHLIB_EXT) +endif $(build_private_libdir)/libLLVM.dylib: - REALPATH=`$(LLVM_CONFIG_HOST) --libfiles` && \ + REALPATH=$(LLVM_CONFIG_HOST_LIBS) && \ $(call resolve_path,REALPATH) && \ [ -e "$$REALPATH" ] && \ ([ ! -e "$@" ] || rm "$@") && \ diff --git a/src/Makefile b/src/Makefile index d8e1c6a49b115..e4da8c6357e02 100644 --- a/src/Makefile +++ b/src/Makefile @@ -89,7 +89,17 @@ endif PUBLIC_HEADER_TARGETS := $(addprefix $(build_includedir)/julia/,$(notdir $(PUBLIC_HEADERS)) $(UV_HEADERS)) ifeq ($(JULIACODEGEN),LLVM) +ifneq ($(USE_SYSTEM_LLVM),0) LLVMLINK += $(shell $(LLVM_CONFIG_HOST) --ldflags --libs --system-libs) +# HACK: llvm-config doesn't correctly point to shared libs on all platforms +# https://github.com/JuliaLang/julia/issues/29981 +else +ifneq ($(USE_LLVM_SHLIB),1) +LLVMLINK += $(shell $(LLVM_CONFIG_HOST) --ldflags) $(shell $(LLVM_CONFIG_HOST) --libs $(LLVM_LIBS)) $(shell $(LLVM_CONFIG_HOST) --ldflags) $(shell $(LLVM_CONFIG_HOST) --system-libs 2> /dev/null) +else +LLVMLINK += $(shell $(LLVM_CONFIG_HOST) --ldflags) -lLLVM +endif +endif ifeq ($(USE_LLVM_SHLIB),1) FLAGS += -DLLVM_SHLIB endif # USE_LLVM_SHLIB == 1 From 949d8e3cb1c25264f46b945e8282571635d5ba61 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 27 Dec 2018 03:41:38 +0100 Subject: [PATCH 47/65] Add Dates as a test dependency to SparseArrays. (#30519) (cherry picked from commit 573cf74895f6a41f081324996b8d6773ee3ce83c) --- stdlib/SparseArrays/Project.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/SparseArrays/Project.toml b/stdlib/SparseArrays/Project.toml index bffdfc775fdc6..53d4a9f064ad3 100644 --- a/stdlib/SparseArrays/Project.toml +++ b/stdlib/SparseArrays/Project.toml @@ -6,8 +6,9 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test", "InteractiveUtils"] +test = ["Dates", "Test", "InteractiveUtils"] From 7cd0d2052b581b39c0eb44435f2bad2c96dd01db Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 27 Dec 2018 23:27:32 +0100 Subject: [PATCH 48/65] Bump Pkg to 1.1.2. (#30521) (cherry picked from commit 002a9f5d76faa459dd6b9984b97410206aa055a6) --- .../Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/md5 | 1 + .../Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/sha512 | 1 + .../Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 | 1 - .../Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 | 1 - stdlib/Pkg.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 deps/checksums/Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/md5 create mode 100644 deps/checksums/Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/sha512 delete mode 100644 deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 diff --git a/deps/checksums/Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/md5 b/deps/checksums/Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/md5 new file mode 100644 index 0000000000000..aa9fda894b7d1 --- /dev/null +++ b/deps/checksums/Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/md5 @@ -0,0 +1 @@ +b51ae77c52564bcb0e7033b3fdcffba1 diff --git a/deps/checksums/Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/sha512 b/deps/checksums/Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/sha512 new file mode 100644 index 0000000000000..fbe7fcfb9ddf9 --- /dev/null +++ b/deps/checksums/Pkg-853b3f1fd9895db32b402d89e9dee153b66b2316.tar.gz/sha512 @@ -0,0 +1 @@ +f81ef6ec68b190d18a28562c4d2507b393b5f9d09d900fa682ab876564908c7700c282343e568fed66703ddc9a12ab0a425f70e5fe705002b2da6397274b30f8 diff --git a/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 b/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 deleted file mode 100644 index daa7b9af3a540..0000000000000 --- a/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -fea01869cb03a990c4c727a2e9fbe4ee diff --git a/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 b/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 deleted file mode 100644 index 5801d512f017f..0000000000000 --- a/deps/checksums/Pkg-cfbe0479e609aabcf5ae5422f7772b742922a0da.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -89b093269a61b7f7b6c43a2dad8989b5305b4fbb844fff71acd4e30d19267c7c437caa1987aaaa1177ed3efbe4bd8eca4235140e817eb917df0b236d102f5a09 diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index ac6cbf6062665..bbc925802f99e 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,2 +1,2 @@ PKG_BRANCH = master -PKG_SHA1 = cfbe0479e609aabcf5ae5422f7772b742922a0da +PKG_SHA1 = 853b3f1fd9895db32b402d89e9dee153b66b2316 From 1e4e6e49163a93528366a17c6cbaa47bed337d12 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sat, 29 Dec 2018 14:32:01 -0800 Subject: [PATCH 49/65] Update NEWS links --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index c01d568bc3ccd..3a76b454587fd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -198,11 +198,13 @@ Deprecated or removed [#29893]: https://github.com/JuliaLang/julia/issues/29893 [#29907]: https://github.com/JuliaLang/julia/issues/29907 [#29913]: https://github.com/JuliaLang/julia/issues/29913 +[#29926]: https://github.com/JuliaLang/julia/issues/29926 [#29968]: https://github.com/JuliaLang/julia/issues/29968 [#29969]: https://github.com/JuliaLang/julia/issues/29969 [#29978]: https://github.com/JuliaLang/julia/issues/29978 [#29980]: https://github.com/JuliaLang/julia/issues/29980 [#29997]: https://github.com/JuliaLang/julia/issues/29997 +[#29998]: https://github.com/JuliaLang/julia/issues/29998 [#30004]: https://github.com/JuliaLang/julia/issues/30004 [#30022]: https://github.com/JuliaLang/julia/issues/30022 [#30035]: https://github.com/JuliaLang/julia/issues/30035 @@ -215,4 +217,6 @@ Deprecated or removed [#30249]: https://github.com/JuliaLang/julia/issues/30249 [#30270]: https://github.com/JuliaLang/julia/issues/30270 [#30278]: https://github.com/JuliaLang/julia/issues/30278 +[#30341]: https://github.com/JuliaLang/julia/issues/30341 [#30342]: https://github.com/JuliaLang/julia/issues/30342 +[#30381]: https://github.com/JuliaLang/julia/issues/30381 From e1b2c827f84b4b56e39fad4fedd2e5cd51b1602c Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sat, 29 Dec 2018 14:35:37 -0800 Subject: [PATCH 50/65] Add license headers to files --- src/julia_gcext.h | 2 ++ test/exceptions.jl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/julia_gcext.h b/src/julia_gcext.h index 1ea360f40e009..415eda07be705 100644 --- a/src/julia_gcext.h +++ b/src/julia_gcext.h @@ -1,3 +1,5 @@ +// This file is a part of Julia. License is MIT: https://julialang.org/license + #ifndef JL_GCEXT_H #define JL_GCEXT_H diff --git a/test/exceptions.jl b/test/exceptions.jl index e1a415a2c6c0d..0ab052807e947 100644 --- a/test/exceptions.jl +++ b/test/exceptions.jl @@ -1,3 +1,5 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license + using Test using Base: catch_stack From d11b04a6d71e6050f270a5541ee1d404b9f0f1b6 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sat, 29 Dec 2018 15:44:19 -0800 Subject: [PATCH 51/65] Update and fix links in the documentation --- README.md | 2 +- base/version.jl | 4 +- doc/src/base/numbers.md | 2 +- doc/src/devdocs/inference.md | 2 +- doc/src/manual/code-loading.md | 2 +- doc/src/manual/environment-variables.md | 2 +- doc/src/manual/faq.md | 2 +- .../integers-and-floating-point-numbers.md | 4 +- doc/src/manual/networking-and-streams.md | 2 +- doc/src/manual/noteworthy-differences.md | 2 +- doc/src/manual/parallel-computing.md | 9 +-- doc/src/manual/performance-tips.md | 2 +- doc/src/manual/strings.md | 4 +- stdlib/Dates/docs/src/index.md | 2 +- stdlib/LibGit2/docs/src/index.md | 4 +- stdlib/LibGit2/src/LibGit2.jl | 2 +- stdlib/LibGit2/src/callbacks.jl | 2 +- stdlib/LibGit2/src/commit.jl | 2 +- stdlib/LibGit2/src/diff.jl | 6 +- stdlib/LibGit2/src/types.jl | 58 +++++++++---------- 20 files changed, 58 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 7699f5673ad74..f4d08125c1ea8 100644 --- a/README.md +++ b/README.md @@ -345,7 +345,7 @@ Julia uses the following external libraries, which are automatically downloaded [GMP]: http://gmplib.org [MPFR]: http://www.mpfr.org [libuv]: https://github.com/JuliaLang/libuv -[libgit2]: https://libgit2.github.com/ +[libgit2]: https://libgit2.org/ [utf8proc]: https://julialang.org/utf8proc/ [libosxunwind]: https://github.com/JuliaLang/libosxunwind [libunwind]: http://www.nongnu.org/libunwind diff --git a/base/version.jl b/base/version.jl index 0e4c704821031..7959d2c77bc4d 100644 --- a/base/version.jl +++ b/base/version.jl @@ -1,13 +1,13 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -## semantic version numbers (http://semver.org) +## semantic version numbers (https://semver.org/) const VInt = UInt32 """ VersionNumber Version number type which follow the specifications of -[semantic versioning](http://semver.org), composed of major, minor +[semantic versioning](https://semver.org/), composed of major, minor and patch numeric values, followed by pre-release and build alpha-numeric annotations. See also [`@v_str`](@ref). diff --git a/doc/src/base/numbers.md b/doc/src/base/numbers.md index f07f7f586d826..47a33b4447264 100644 --- a/doc/src/base/numbers.md +++ b/doc/src/base/numbers.md @@ -115,7 +115,7 @@ Base.@uint128_str The [`BigFloat`](@ref) and [`BigInt`](@ref) types implements arbitrary-precision floating point and integer arithmetic, respectively. For -[`BigFloat`](@ref) the [GNU MPFR library](http://www.mpfr.org/) is used, +[`BigFloat`](@ref) the [GNU MPFR library](https://www.mpfr.org/) is used, and for [`BigInt`](@ref) the [GNU Multiple Precision Arithmetic Library (GMP)] (https://gmplib.org) is used. diff --git a/doc/src/devdocs/inference.md b/doc/src/devdocs/inference.md index df1f9082eb90e..97f21225f295e 100644 --- a/doc/src/devdocs/inference.md +++ b/doc/src/devdocs/inference.md @@ -75,7 +75,7 @@ in CPU cycles) to each of Julia's intrinsic functions. These costs are based on [standard ranges for common architectures](http://ithare.com/wp-content/uploads/part101_infographics_v08.png) (see -[Agner Fog's analysis](http://www.agner.org/optimize/instruction_tables.pdf) +[Agner Fog's analysis](https://www.agner.org/optimize/instruction_tables.pdf) for more detail). We supplement this low-level lookup table with a number of special diff --git a/doc/src/manual/code-loading.md b/doc/src/manual/code-loading.md index 7e2652aa90a82..8cf646f2d7737 100644 --- a/doc/src/manual/code-loading.md +++ b/doc/src/manual/code-loading.md @@ -204,7 +204,7 @@ paths = Dict( This example map includes three different kinds of package locations (the first and third are part of the default load path): -1. The private `Priv` package is "[vendored](https://stackoverflow.com/a/35109534/659248)" inside the `App` repository. +1. The private `Priv` package is "[vendored](https://stackoverflow.com/a/35109534)" inside the `App` repository. 2. The public `Priv` and `Zebra` packages are in the system depot, where packages installed and managed by the system administrator live. These are available to all users on the system. 3. The `Pub` package is in the user depot, where packages installed by the user live. These are only available to the user who installed them. diff --git a/doc/src/manual/environment-variables.md b/doc/src/manual/environment-variables.md index c410adce6e5dd..a5c1e7746e294 100644 --- a/doc/src/manual/environment-variables.md +++ b/doc/src/manual/environment-variables.md @@ -284,7 +284,7 @@ event listener for just-in-time (JIT) profiling. This environment variable only has an effect if Julia was compiled with JIT profiling support, using either - * Intel's [VTune™ Amplifier](https://software.intel.com/en-us/intel-vtune-amplifier-xe) + * Intel's [VTune™ Amplifier](https://software.intel.com/en-us/vtune) (`USE_INTEL_JITEVENTS` set to `1` in the build configuration), or * [OProfile](http://oprofile.sourceforge.net/news/) (`USE_OPROFILE_JITEVENTS` set to `1` in the build configuration). diff --git a/doc/src/manual/faq.md b/doc/src/manual/faq.md index e6ae749fd1b5a..58a00ed61a4cb 100644 --- a/doc/src/manual/faq.md +++ b/doc/src/manual/faq.md @@ -741,7 +741,7 @@ Because supporting generic programming is deemed more important than potential p that can be achieved by other means (e.g., using explicit loops), operators like `+=` and `*=` work by rebinding new values. -## Asynchronous IO and concurrent synchronous writes +## [Asynchronous IO and concurrent synchronous writes](@id faq-async-io) ### Why do concurrent writes to the same stream result in inter-mixed output? diff --git a/doc/src/manual/integers-and-floating-point-numbers.md b/doc/src/manual/integers-and-floating-point-numbers.md index b4d82c39fe44c..919714ea3de88 100644 --- a/doc/src/manual/integers-and-floating-point-numbers.md +++ b/doc/src/manual/integers-and-floating-point-numbers.md @@ -505,7 +505,7 @@ Floating-point arithmetic entails many subtleties which can be surprising to use with the low-level implementation details. However, these subtleties are described in detail in most books on scientific computation, and also in the following references: - * The definitive guide to floating point arithmetic is the [IEEE 754-2008 Standard](http://standards.ieee.org/findstds/standard/754-2008.html); + * The definitive guide to floating point arithmetic is the [IEEE 754-2008 Standard](https://standards.ieee.org/standard/754-2008.html); however, it is not available for free online. * For a brief but lucid presentation of how floating-point numbers are represented, see John D. Cook's [article](https://www.johndcook.com/blog/2009/04/06/anatomy-of-a-floating-point-number/) @@ -523,7 +523,7 @@ most books on scientific computation, and also in the following references: ## Arbitrary Precision Arithmetic To allow computations with arbitrary-precision integers and floating point numbers, Julia wraps -the [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org) and the [GNU MPFR Library](http://www.mpfr.org), +the [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org) and the [GNU MPFR Library](https://www.mpfr.org), respectively. The [`BigInt`](@ref) and [`BigFloat`](@ref) types are available in Julia for arbitrary precision integer and floating point numbers respectively. diff --git a/doc/src/manual/networking-and-streams.md b/doc/src/manual/networking-and-streams.md index dada5e5d87ffd..34a351bce948a 100644 --- a/doc/src/manual/networking-and-streams.md +++ b/doc/src/manual/networking-and-streams.md @@ -234,7 +234,7 @@ Sockets.PipeServer(active) Note that the return type of the last invocation is different. This is because this server does not listen on TCP, but rather on a named pipe (Windows) or UNIX domain socket. Also note that Windows named pipe format has to be a specific pattern such that the name prefix (`\\.\pipe\`) uniquely -identifies the [file type](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365783(v=vs.85).aspx). +identifies the [file type](https://docs.microsoft.com/en-us/windows/desktop/ipc/pipe-names). The difference between TCP and named pipes or UNIX domain sockets is subtle and has to do with the [`accept`](@ref) and [`connect`](@ref) methods. The [`accept`](@ref) method retrieves a connection to the client that is connecting on diff --git a/doc/src/manual/noteworthy-differences.md b/doc/src/manual/noteworthy-differences.md index fb3d16616838e..bd24907d3cc19 100644 --- a/doc/src/manual/noteworthy-differences.md +++ b/doc/src/manual/noteworthy-differences.md @@ -144,7 +144,7 @@ For users coming to Julia from R, these are some noteworthy differences: For example: * Functions pertaining to probability distributions are provided by the [Distributions package](https://github.com/JuliaStats/Distributions.jl). - * The [DataFrames package](https://github.com/JuliaStats/DataFrames.jl) provides data frames. + * The [DataFrames package](https://github.com/JuliaData/DataFrames.jl) provides data frames. * Generalized linear models are provided by the [GLM package](https://github.com/JuliaStats/GLM.jl). * Julia provides tuples and real hash tables, but not R-style lists. When returning multiple items, you should typically use a tuple or a named tuple: instead of `list(a = 1, b = 2)`, use `(1, 2)` diff --git a/doc/src/manual/parallel-computing.md b/doc/src/manual/parallel-computing.md index ab7052f4d97c5..e0071085f2bc5 100644 --- a/doc/src/manual/parallel-computing.md +++ b/doc/src/manual/parallel-computing.md @@ -627,7 +627,8 @@ block, at which point it surrenders control and waits for all the local tasks to returning from the function. As for v0.7 and beyond, the feeder tasks are able to share state via `nextidx` because they all run on the same process. -Even if `Tasks` are scheduled cooperatively, locking may still be required in some contexts, as in [asynchronous I\O](https://docs.julialang.org/en/stable/manual/faq/#Asynchronous-IO-and-concurrent-synchronous-writes-1). +Even if `Tasks` are scheduled cooperatively, locking may still be required in some contexts, as in +[asynchronous I/O](@ref faq-async-io). This means context switches only occur at well-defined points: in this case, when [`remotecall_fetch`](@ref) is called. This is the current state of implementation and it may change for future Julia versions, as it is intended to make it possible to run up to N `Tasks` on M `Process`, aka @@ -1025,7 +1026,7 @@ on a [`RemoteChannel`](@ref) are proxied onto the backing store on the remote pr [`RemoteChannel`](@ref) can thus be used to refer to user implemented `AbstractChannel` objects. A simple example of this is provided in `dictchannel.jl` in the -[Examples repository](https://github.com/JuliaArchive/Examples), which uses a dictionary as its +[Examples repository](https://github.com/JuliaAttic/Examples), which uses a dictionary as its remote store. @@ -1545,7 +1546,7 @@ transport and Julia's in-built parallel infrastructure. A `BufferStream` is an in-memory [`IOBuffer`](@ref) which behaves like an `IO`--it is a stream which can be handled asynchronously. -The folder `clustermanager/0mq` in the [Examples repository](https://github.com/JuliaArchive/Examples) +The folder `clustermanager/0mq` in the [Examples repository](https://github.com/JuliaAttic/Examples) contains an example of using ZeroMQ to connect Julia workers in a star topology with a 0MQ broker in the middle. Note: The Julia processes are still all *logically* connected to each other--any worker can message any other worker directly without any awareness @@ -1795,7 +1796,7 @@ mpirun -np 4 ./julia example.jl In this context, MPI refers to the MPI-1 standard. Beginning with MPI-2, the MPI standards committee introduced a new set of communication mechanisms, collectively referred to as Remote Memory Access (RMA). The motivation for adding rma to the MPI standard was to facilitate one-sided communication - patterns. For additional information on the latest MPI standard, see [http://mpi-forum.org/docs](http://mpi-forum.org/docs/). + patterns. For additional information on the latest MPI standard, see . [^2]: [Julia GPU man pages](http://juliagpu.github.io/CUDAnative.jl/stable/man/usage.html#Julia-support-1) diff --git a/doc/src/manual/performance-tips.md b/doc/src/manual/performance-tips.md index f962cdd0b8ab4..2dbd75a2c34fe 100644 --- a/doc/src/manual/performance-tips.md +++ b/doc/src/manual/performance-tips.md @@ -1129,7 +1129,7 @@ Sometimes you can enable better optimization by promising certain program proper The common idiom of using 1:n to index into an AbstractArray is not safe if the Array uses unconventional indexing, and may cause a segmentation fault if bounds checking is turned off. Use `LinearIndices(x)` or `eachindex(x)` -instead (see also [offset-arrays](https://docs.julialang.org/en/latest/devdocs/offset-arrays)). +instead (see also [offset-arrays](https://docs.julialang.org/en/latest/devdocs/offset-arrays/)). !!! note While `@simd` needs to be placed directly in front of an innermost `for` loop, both `@inbounds` and `@fastmath` diff --git a/doc/src/manual/strings.md b/doc/src/manual/strings.md index 1fd2a5badedcd..fac4988ac12c6 100644 --- a/doc/src/manual/strings.md +++ b/doc/src/manual/strings.md @@ -397,7 +397,7 @@ character because `|` is not a valid continuation to it. Finally the string `s2` one too high code point. Julia uses the UTF-8 encoding by default, and support for new encodings can be added by packages. -For example, the [LegacyStrings.jl](https://github.com/JuliaArchive/LegacyStrings.jl) package +For example, the [LegacyStrings.jl](https://github.com/JuliaStrings/LegacyStrings.jl) package implements `UTF16String` and `UTF32String` types. Additional discussion of other encodings and how to implement support for them is beyond the scope of this document for the time being. For further discussion of UTF-8 encoding issues, see the section below on [byte array literals](@ref man-byte-array-literals). @@ -1059,7 +1059,7 @@ some confusion regarding the matter. Version numbers can easily be expressed with non-standard string literals of the form [`v"..."`](@ref @v_str). Version number literals create [`VersionNumber`](@ref) objects which follow the -specifications of [semantic versioning](http://semver.org), +specifications of [semantic versioning](https://semver.org/), and therefore are composed of major, minor and patch numeric values, followed by pre-release and build alpha-numeric annotations. For example, `v"0.2.1-rc1+win64"` is broken into major version `0`, minor version `2`, patch version `1`, pre-release `rc1` and build `win64`. When entering diff --git a/stdlib/Dates/docs/src/index.md b/stdlib/Dates/docs/src/index.md index bb0a9f2dabf3c..70c2c4f8ecd37 100644 --- a/stdlib/Dates/docs/src/index.md +++ b/stdlib/Dates/docs/src/index.md @@ -347,7 +347,7 @@ The `Dates` module approach tries to follow the simple principle of trying to ch little as possible when doing [`Period`](@ref) arithmetic. This approach is also often known as *calendrical* arithmetic or what you would probably guess if someone were to ask you the same calculation in a conversation. Why all the fuss about this? Let's take a classic example: add -1 month to January 31st, 2014. What's the answer? Javascript will say [March 3](http://www.markhneedham.com/blog/2009/01/07/javascript-add-a-month-to-a-date/) +1 month to January 31st, 2014. What's the answer? Javascript will say [March 3](https://markhneedham.com/blog/2009/01/07/javascript-add-a-month-to-a-date/) (assumes 31 days). PHP says [March 2](https://stackoverflow.com/questions/5760262/php-adding-months-to-a-date-while-not-exceeding-the-last-day-of-the-month) (assumes 30 days). The fact is, there is no right answer. In the `Dates` module, it gives the result of February 28th. How does it figure that out? I like to think of the classic 7-7-7 diff --git a/stdlib/LibGit2/docs/src/index.md b/stdlib/LibGit2/docs/src/index.md index 421540d825270..2eafb77bc87cc 100644 --- a/stdlib/LibGit2/docs/src/index.md +++ b/stdlib/LibGit2/docs/src/index.md @@ -4,7 +4,7 @@ DocTestSetup = :(using LibGit2) ``` -The LibGit2 module provides bindings to [libgit2](https://libgit2.github.com/), a portable C library that +The LibGit2 module provides bindings to [libgit2](https://libgit2.org/), a portable C library that implements core functionality for the [Git](https://git-scm.com/) version control system. These bindings are currently used to power Julia's package manager. It is expected that this module will eventually be moved into a separate package. @@ -13,7 +13,7 @@ It is expected that this module will eventually be moved into a separate package Some of this documentation assumes some prior knowledge of the libgit2 API. For more information on some of the objects and methods referenced here, consult the upstream -[libgit2 API reference](https://libgit2.github.com/libgit2/#v0.25.1). +[libgit2 API reference](https://libgit2.org/libgit2/#v0.25.1). ```@docs LibGit2.Buffer diff --git a/stdlib/LibGit2/src/LibGit2.jl b/stdlib/LibGit2/src/LibGit2.jl index a8e673e376dd1..b54e9cbb298ee 100644 --- a/stdlib/LibGit2/src/LibGit2.jl +++ b/stdlib/LibGit2/src/LibGit2.jl @@ -1,7 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license """ -Interface to [libgit2](https://libgit2.github.com/). +Interface to [libgit2](https://libgit2.org/). """ module LibGit2 diff --git a/stdlib/LibGit2/src/callbacks.jl b/stdlib/LibGit2/src/callbacks.jl index b07764e0b033a..37b0414c42118 100644 --- a/stdlib/LibGit2/src/callbacks.jl +++ b/stdlib/LibGit2/src/callbacks.jl @@ -262,7 +262,7 @@ authentication was successful or not. To avoid an infinite loop from repeatedly using the same faulty credentials, we will keep track of state using the payload. For addition details see the LibGit2 guide on -[authenticating against a server](https://libgit2.github.com/docs/guides/authentication/). +[authenticating against a server](https://libgit2.org/docs/guides/authentication/). """ function credentials_callback(libgit2credptr::Ptr{Ptr{Cvoid}}, url_ptr::Cstring, username_ptr::Cstring, allowed_types::Cuint, diff --git a/stdlib/LibGit2/src/commit.jl b/stdlib/LibGit2/src/commit.jl index db8cc822f7fc2..b817dc8740553 100644 --- a/stdlib/LibGit2/src/commit.jl +++ b/stdlib/LibGit2/src/commit.jl @@ -87,7 +87,7 @@ end """ commit(repo::GitRepo, msg::AbstractString; kwargs...) -> GitHash -Wrapper around [`git_commit_create`](https://libgit2.github.com/libgit2/#HEAD/group/commit/git_commit_create). +Wrapper around [`git_commit_create`](https://libgit2.org/libgit2/#HEAD/group/commit/git_commit_create). Create a commit in the repository `repo`. `msg` is the commit message. Return the OID of the new commit. The keyword arguments are: diff --git a/stdlib/LibGit2/src/diff.jl b/stdlib/LibGit2/src/diff.jl index 7c3df89e2f5ca..f2aa2feb2c2e9 100644 --- a/stdlib/LibGit2/src/diff.jl +++ b/stdlib/LibGit2/src/diff.jl @@ -16,10 +16,10 @@ end Generate a [`GitDiff`](@ref) between `tree` (which will be used for the "old" side of the [`DiffDelta`](@ref)) and `repo` (which will be used for the "new" side). -If `repo` is `cached`, calls [`git_diff_tree_to_index`](https://libgit2.github.com/libgit2/#HEAD/group/diff/git_diff_tree_to_index). +If `repo` is `cached`, calls [`git_diff_tree_to_index`](https://libgit2.org/libgit2/#HEAD/group/diff/git_diff_tree_to_index). The `cached` version is generally used to examine the diff for staged changes from one commit to the next. If `cached` is `false`, calls -[`git_diff_tree_to_workdir_with_index`](https://libgit2.github.com/libgit2/#HEAD/group/diff/git_diff_tree_to_workdir_with_index). +[`git_diff_tree_to_workdir_with_index`](https://libgit2.org/libgit2/#HEAD/group/diff/git_diff_tree_to_workdir_with_index). This compares the current working directory against the [`GitIndex`](@ref) and can, for example, be used to examine the changes in staged files before a commit. """ @@ -43,7 +43,7 @@ end Generate a [`GitDiff`](@ref) between `oldtree` (which will be used for the "old" side of the [`DiffDelta`](@ref)) and `newtree` (which will be used for the "new" -side of the `DiffDelta`). Equivalent to [`git_diff_tree_to_tree`](https://libgit2.github.com/libgit2/#HEAD/group/diff/git_diff_tree_to_tree). +side of the `DiffDelta`). Equivalent to [`git_diff_tree_to_tree`](https://libgit2.org/libgit2/#HEAD/group/diff/git_diff_tree_to_tree). This can be used to generate a diff between two commits. For instance, it could be used to compare a commit made 2 months ago with the current latest commit, or to compare a commit on another branch with the current latest commit on `master`. diff --git a/stdlib/LibGit2/src/types.jl b/stdlib/LibGit2/src/types.jl index c58b7c3b94073..cfbc37672d044 100644 --- a/stdlib/LibGit2/src/types.jl +++ b/stdlib/LibGit2/src/types.jl @@ -40,7 +40,7 @@ end LibGit2.TimeStruct Time in a signature. -Matches the [`git_time`](https://libgit2.github.com/libgit2/#HEAD/type/git_time) struct. +Matches the [`git_time`](https://libgit2.org/libgit2/#HEAD/type/git_time) struct. """ struct TimeStruct time::Int64 # time in seconds from epoch @@ -54,7 +54,7 @@ end LibGit2.SignatureStruct An action signature (e.g. for committers, taggers, etc). -Matches the [`git_signature`](https://libgit2.github.com/libgit2/#HEAD/type/git_signature) struct. +Matches the [`git_signature`](https://libgit2.org/libgit2/#HEAD/type/git_signature) struct. The fields represent: * `name`: The full name of the committer or author of the commit. @@ -72,7 +72,7 @@ end LibGit2.StrArrayStruct A LibGit2 representation of an array of strings. -Matches the [`git_strarray`](https://libgit2.github.com/libgit2/#HEAD/type/git_strarray) struct. +Matches the [`git_strarray`](https://libgit2.org/libgit2/#HEAD/type/git_strarray) struct. When fetching data from LibGit2, a typical usage would look like: ```julia @@ -106,7 +106,7 @@ end LibGit2.Buffer A data buffer for exporting data from libgit2. -Matches the [`git_buf`](https://libgit2.github.com/libgit2/#HEAD/type/git_buf) struct. +Matches the [`git_buf`](https://libgit2.org/libgit2/#HEAD/type/git_buf) struct. When fetching data from LibGit2, a typical usage would look like: ```julia @@ -132,7 +132,7 @@ end """ LibGit2.CheckoutOptions -Matches the [`git_checkout_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_checkout_options) struct. +Matches the [`git_checkout_options`](https://libgit2.org/libgit2/#HEAD/type/git_checkout_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -197,7 +197,7 @@ end LibGit2.TransferProgress Transfer progress information used by the `transfer_progress` remote callback. -Matches the [`git_transfer_progress`](https://libgit2.github.com/libgit2/#HEAD/type/git_transfer_progress) struct. +Matches the [`git_transfer_progress`](https://libgit2.org/libgit2/#HEAD/type/git_transfer_progress) struct. """ @kwdef struct TransferProgress total_objects::Cuint = Cuint(0) @@ -242,7 +242,7 @@ julia> c = LibGit2.Callbacks(:credentials => (LibGit2.credentials_cb(), LibGit2. julia> LibGit2.clone(url, callbacks=c); ``` -See [`git_remote_callbacks`](https://libgit2.github.com/libgit2/#HEAD/type/git_remote_callbacks) +See [`git_remote_callbacks`](https://libgit2.org/libgit2/#HEAD/type/git_remote_callbacks) for details on supported callbacks. """ const Callbacks = Dict{Symbol, Tuple{Ptr{Cvoid}, Any}} @@ -251,7 +251,7 @@ const Callbacks = Dict{Symbol, Tuple{Ptr{Cvoid}, Any}} LibGit2.RemoteCallbacks Callback settings. -Matches the [`git_remote_callbacks`](https://libgit2.github.com/libgit2/#HEAD/type/git_remote_callbacks) struct. +Matches the [`git_remote_callbacks`](https://libgit2.org/libgit2/#HEAD/type/git_remote_callbacks) struct. """ struct RemoteCallbacks cb::RemoteCallbacksStruct @@ -282,12 +282,12 @@ end Options for connecting through a proxy. -Matches the [`git_proxy_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_proxy_options) struct. +Matches the [`git_proxy_options`](https://libgit2.org/libgit2/#HEAD/type/git_proxy_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. * `proxytype`: an `enum` for the type of proxy to use. - Defined in [`git_proxy_t`](https://libgit2.github.com/libgit2/#HEAD/type/git_proxy_t). + Defined in [`git_proxy_t`](https://libgit2.org/libgit2/#HEAD/type/git_proxy_t). The corresponding Julia enum is `GIT_PROXY` and has values: - `PROXY_NONE`: do not attempt the connection through a proxy. - `PROXY_AUTO`: attempt to figure out the proxy configuration from the git configuration. @@ -336,7 +336,7 @@ end """ LibGit2.FetchOptions -Matches the [`git_fetch_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_fetch_options) struct. +Matches the [`git_fetch_options`](https://libgit2.org/libgit2/#HEAD/type/git_fetch_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -377,7 +377,7 @@ end """ LibGit2.CloneOptions -Matches the [`git_clone_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_clone_options) struct. +Matches the [`git_clone_options`](https://libgit2.org/libgit2/#HEAD/type/git_clone_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -407,7 +407,7 @@ end """ LibGit2.DiffOptionsStruct -Matches the [`git_diff_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_diff_options) struct. +Matches the [`git_diff_options`](https://libgit2.org/libgit2/#HEAD/type/git_diff_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -460,7 +460,7 @@ end """ LibGit2.DescribeOptions -Matches the [`git_describe_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_describe_options) struct. +Matches the [`git_describe_options`](https://libgit2.org/libgit2/#HEAD/type/git_describe_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -489,7 +489,7 @@ end """ LibGit2.DescribeFormatOptions -Matches the [`git_describe_format_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_describe_format_options) struct. +Matches the [`git_describe_format_options`](https://libgit2.org/libgit2/#HEAD/type/git_describe_format_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -508,7 +508,7 @@ end LibGit2.DiffFile Description of one side of a delta. -Matches the [`git_diff_file`](https://libgit2.github.com/libgit2/#HEAD/type/git_diff_file) struct. +Matches the [`git_diff_file`](https://libgit2.org/libgit2/#HEAD/type/git_diff_file) struct. The fields represent: * `id`: the [`GitHash`](@ref) of the item in the diff. If the item is empty on this @@ -516,7 +516,7 @@ The fields represent: be `GitHash(0)`. * `path`: a `NULL` terminated path to the item relative to the working directory of the repository. * `size`: the size of the item in bytes. - * `flags`: a combination of the [`git_diff_flag_t`](https://libgit2.github.com/libgit2/#HEAD/type/git_diff_flag_t) + * `flags`: a combination of the [`git_diff_flag_t`](https://libgit2.org/libgit2/#HEAD/type/git_diff_flag_t) flags. The `i`th bit of this integer sets the `i`th flag. * `mode`: the [`stat`](@ref) mode for the item. * `id_abbrev`: only present in LibGit2 versions newer than or equal to `0.25.0`. @@ -544,7 +544,7 @@ end LibGit2.DiffDelta Description of changes to one entry. -Matches the [`git_diff_delta`](https://libgit2.github.com/libgit2/#HEAD/type/git_diff_delta) struct. +Matches the [`git_diff_delta`](https://libgit2.org/libgit2/#HEAD/type/git_diff_delta) struct. The fields represent: * `status`: One of `Consts.DELTA_STATUS`, indicating whether the file has been added/modified/deleted. @@ -577,7 +577,7 @@ end """ LibGit2.MergeOptions -Matches the [`git_merge_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_merge_options) struct. +Matches the [`git_merge_options`](https://libgit2.org/libgit2/#HEAD/type/git_merge_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -636,7 +636,7 @@ end """ LibGit2.BlameOptions -Matches the [`git_blame_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_blame_options) struct. +Matches the [`git_blame_options`](https://libgit2.org/libgit2/#HEAD/type/git_blame_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -677,7 +677,7 @@ end """ LibGit2.PushOptions -Matches the [`git_push_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_push_options) struct. +Matches the [`git_push_options`](https://libgit2.org/libgit2/#HEAD/type/git_push_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -702,7 +702,7 @@ end """ LibGit2.CherrypickOptions -Matches the [`git_cherrypick_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_cherrypick_options) struct. +Matches the [`git_cherrypick_options`](https://libgit2.org/libgit2/#HEAD/type/git_cherrypick_options) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -724,7 +724,7 @@ end """ LibGit2.IndexTime -Matches the [`git_index_time`](https://libgit2.github.com/libgit2/#HEAD/type/git_index_time) struct. +Matches the [`git_index_time`](https://libgit2.org/libgit2/#HEAD/type/git_index_time) struct. """ struct IndexTime seconds::Int64 @@ -735,7 +735,7 @@ end LibGit2.IndexEntry In-memory representation of a file entry in the index. -Matches the [`git_index_entry`](https://libgit2.github.com/libgit2/#HEAD/type/git_index_entry) struct. +Matches the [`git_index_entry`](https://libgit2.org/libgit2/#HEAD/type/git_index_entry) struct. """ struct IndexEntry ctime::IndexTime @@ -793,7 +793,7 @@ end LibGit2.RebaseOperation Describes a single instruction/operation to be performed during the rebase. -Matches the [`git_rebase_operation`](https://libgit2.github.com/libgit2/#HEAD/type/git_rebase_operation_t) struct. +Matches the [`git_rebase_operation`](https://libgit2.org/libgit2/#HEAD/type/git_rebase_operation_t) struct. The fields represent: * `optype`: the type of rebase operation currently being performed. The options are: @@ -826,7 +826,7 @@ end LibGit2.StatusOptions Options to control how `git_status_foreach_ext()` will issue callbacks. -Matches the [`git_status_opt_t`](https://libgit2.github.com/libgit2/#HEAD/type/git_status_opt_t) struct. +Matches the [`git_status_opt_t`](https://libgit2.org/libgit2/#HEAD/type/git_status_opt_t) struct. The fields represent: * `version`: version of the struct in use, in case this changes later. For now, always `1`. @@ -908,7 +908,7 @@ end """ LibGit2.ConfigEntry -Matches the [`git_config_entry`](https://libgit2.github.com/libgit2/#HEAD/type/git_config_entry) struct. +Matches the [`git_config_entry`](https://libgit2.org/libgit2/#HEAD/type/git_config_entry) struct. """ @kwdef struct ConfigEntry name::Cstring = Cstring(C_NULL) @@ -1050,7 +1050,7 @@ end LibGit2.GitSignature This is a Julia wrapper around a pointer to a -[`git_signature`](https://libgit2.github.com/libgit2/#HEAD/type/git_signature) object. +[`git_signature`](https://libgit2.org/libgit2/#HEAD/type/git_signature) object. """ mutable struct GitSignature <: AbstractGitObject ptr::Ptr{SignatureStruct} @@ -1080,7 +1080,7 @@ end """ LibGit2.BlameHunk -Matches the [`git_blame_hunk`](https://libgit2.github.com/libgit2/#HEAD/type/git_blame_hunk) struct. +Matches the [`git_blame_hunk`](https://libgit2.org/libgit2/#HEAD/type/git_blame_hunk) struct. The fields represent: * `lines_in_hunk`: the number of lines in this hunk of the blame. * `final_commit_id`: the [`GitHash`](@ref) of the commit where this section was last changed. From ba87aa39624e58995e8045555f5d5186f601b283 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Mon, 31 Dec 2018 15:36:59 -0800 Subject: [PATCH 52/65] Set VERSION to 1.1.0-rc1 (#30322) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 87f6e89c2ee8c..8376431e34044 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.0-DEV +1.1.0-rc1 From ecf9911d92cecf50c339eddea20fe525c5697cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Thu, 3 Jan 2019 00:18:03 +0100 Subject: [PATCH 53/65] Remove duplicate NEWS entry (#30560) --- NEWS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 3a76b454587fd..da306541fc7a1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -88,7 +88,6 @@ Standard library changes * `merge(::NamedTuple, ::NamedTuple...)` can now be used with more than 2 `NamedTuple`s ([#29259]). * New `ncodeunits(c::Char)` method as a fast equivalent to `ncodeunits(string(c))` ([#29153]). * New `sort!(::AbstractArray; dims)` method that can sort the array along the `dims` dimension ([#28902]). - * `range` now accepts `stop` as a positional argument ([#28708]). * `get(A::AbstractArray, (), default)` now returns `A[]` instead of an empty array ([#30270]). * `parse(Bool, str)` is now supported ([#29997]). * `copyto!(::AbstractMatrix, ::UniformScaling)` now supports rectangular matrices ([#28790]). From 41c0c2f42d8beb8d1e893a4bfb21d0cfae8b9b07 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 2 Jan 2019 15:00:08 -0500 Subject: [PATCH 54/65] don't use abstract_iteration for types with special cases in _apply (#30483) (cherry picked from commit 3e6f60758fd9b974972a78bbe899bb754e97a533) --- base/compiler/abstractinterpretation.jl | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index b1fab2f0f4e69..b01ad3a271fca 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -405,12 +405,27 @@ function precise_container_type(@nospecialize(typ), vtypes::VarTable, sv::Infere end end return result - elseif isa(tti0, DataType) && tti0 <: Tuple - if isvatuple(tti0) && length(tti0.parameters) == 1 - return Any[Vararg{unwrapva(tti0.parameters[1])}] + elseif tti0 <: Tuple + if isa(tti0, DataType) + if isvatuple(tti0) && length(tti0.parameters) == 1 + return Any[Vararg{unwrapva(tti0.parameters[1])}] + else + return Any[ p for p in tti0.parameters ] + end + elseif !isa(tti, DataType) + return Any[Vararg{Any}] else - return Any[ p for p in tti0.parameters ] + len = length(tti.parameters) + last = tti.parameters[len] + va = isvarargtype(last) + elts = Any[ fieldtype(tti0, i) for i = 1:len ] + if va + elts[len] = Vararg{elts[len]} + end + return elts end + elseif tti0 === SimpleVector || tti0 === Any + return Any[Vararg{Any}] elseif tti0 <: Array return Any[Vararg{eltype(tti0)}] else From 879f7c23ac53d168f7bf13f62f2542f65b783b5c Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 2 Jan 2019 22:45:58 -0500 Subject: [PATCH 55/65] use type inference world in `return_type` (#30470) (cherry picked from commit a5a58828dffbd70b4c9bda3b35dbdd1e324cfe85) --- base/compiler/typeinfer.jl | 7 ++++++- src/gf.c | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index ff9273de3cfd5..cdf56df177d09 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -633,7 +633,12 @@ end function return_type(@nospecialize(f), @nospecialize(t)) - params = Params(ccall(:jl_get_tls_world_age, UInt, ())) + world = ccall(:jl_get_tls_world_age, UInt, ()) + return ccall(:jl_call_in_typeinf_world, Any, (Ptr{Ptr{Cvoid}}, Cint), Any[_return_type, f, t, world], 4) +end + +function _return_type(@nospecialize(f), @nospecialize(t), world) + params = Params(world) rt = Union{} if isa(f, Builtin) rt = builtin_tfunction(f, Any[t.parameters...], nothing, params) diff --git a/src/gf.c b/src/gf.c index 4c8ae077192c1..78e9bfa40e758 100644 --- a/src/gf.c +++ b/src/gf.c @@ -300,6 +300,16 @@ jl_code_info_t *jl_type_infer(jl_method_instance_t **pli JL_ROOTS_TEMPORARILY, s return src; } +JL_DLLEXPORT jl_value_t *jl_call_in_typeinf_world(jl_value_t **args, int nargs) +{ + jl_ptls_t ptls = jl_get_ptls_states(); + size_t last_age = ptls->world_age; + ptls->world_age = jl_typeinf_world; + jl_value_t *ret = jl_apply(args, nargs); + ptls->world_age = last_age; + return ret; +} + int jl_is_rettype_inferred(jl_method_instance_t *li) JL_NOTSAFEPOINT { if (!li->inferred) From d8e69b84273dfa7765c2f64f38a43dd3d6437149 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Fri, 4 Jan 2019 22:45:30 -0800 Subject: [PATCH 56/65] Use XCode 8.3 for macOS on Travis (#30599) This corresponds to macOS 10.12 Sierra. XCode 8 covers El Capitan and Sierra, so if Travis is giving us XCode 8.x for x < 3, we're on El Cap. Homebrew supports only three versions of macOS at a time, which means that El Cap (10.11) is no longer support. This is likely why our Mac builds are trying to build GCC from source; a bottle might not be available. (cherry picked from commit 862fe08de4283346b51e8dcddb3df52a5315ac6a) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 078a9249e2f7a..d04eade2fa27c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ matrix: - gfortran-5 - os: osx env: ARCH="x86_64" - osx_image: xcode8 + osx_image: xcode8.3 cache: ccache branches: only: From 91fe9c3059e1c1a46a4e50c985af76c7c4f005e5 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 4 Jan 2019 19:35:28 -0500 Subject: [PATCH 57/65] Fix use counts for mutable struct SROA PR #28478 moved the computation of the use counts before the finish call. to fix #28444. However, the early parts of the finish call fixes up phi node arguments, which fail to get counted if we look at use counts before that fixup is performed. This causes #30594 where the only non-trivial use is on the backedge of the phi and would thus incorrectly fail to get accounted for. Fix that by taking the use count after phi fixup but before dce. (cherry picked from commit f8f20453c4ca7a6aeb23a189a420dbff130679ce) --- base/compiler/ssair/passes.jl | 10 +++++++--- test/compiler/irpasses.jl | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/base/compiler/ssair/passes.jl b/base/compiler/ssair/passes.jl index d291e85a661b8..68b7424f8a676 100644 --- a/base/compiler/ssair/passes.jl +++ b/base/compiler/ssair/passes.jl @@ -688,10 +688,14 @@ function getfield_elim_pass!(ir::IRCode, domtree::DomTree) compact[idx] = val === nothing ? nothing : val.x end - # Copy the use count, `finish` may modify it and for our predicate - # below we need it consistent with the state of the IR here. + + non_dce_finish!(compact) + # Copy the use count, `simple_dce!` may modify it and for our predicate + # below we need it consistent with the state of the IR here (after tracking + # phi node arguments, but before dce). used_ssas = copy(compact.used_ssas) - ir = finish(compact) + simple_dce!(compact) + ir = complete(compact) # Now go through any mutable structs and see which ones we can eliminate for (idx, (intermediaries, defuse)) in defuses intermediaries = collect(intermediaries) diff --git a/test/compiler/irpasses.jl b/test/compiler/irpasses.jl index 77f75958fd837..d7b1ec172936c 100644 --- a/test/compiler/irpasses.jl +++ b/test/compiler/irpasses.jl @@ -37,3 +37,29 @@ let m = Meta.@lower 1 + 1 Core.Compiler.verify_ir(ir) @test isa(ir.stmts[3], Core.PhiNode) && length(ir.stmts[3].edges) == 1 end + +# Tests for SROA + +mutable struct Foo30594; x::Float64; end +Base.copy(x::Foo30594) = Foo30594(x.x) +function add!(p::Foo30594, off::Foo30594) + p.x += off.x + return p +end +Base.:(+)(a::Foo30594, b::Foo30594) = add!(copy(a), b) + +let results = Float64[] + @noinline use30594(x) = push!(results, x.x); nothing + function foo30594(cnt::Int, dx::Int) + step = Foo30594(dx) + curr = step + Foo30594(1) + for i in 1:cnt + use30594(curr) + curr = curr + step + end + nothing + end + + foo30594(4, -1) + @test results == [0.0, -1.0, -2.0, -3.0] +end From bf0e21237083ebf3fcf8cf1b14b92c49024b6575 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Tue, 8 Jan 2019 15:22:10 -0500 Subject: [PATCH 58/65] some latency hacks (#30566) These changes cut some method dependency edges that tend to lead to invalidations when loading packages. (cherry picked from commit 13fc4c39a37742b8f804c5268426c49c7b31b7f5) --- base/array.jl | 9 +++++---- base/checked.jl | 4 ++-- base/show.jl | 4 ++-- base/strings/io.jl | 1 + stdlib/Distributed/src/managers.jl | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/base/array.jl b/base/array.jl index f13c6ee08358e..6f39e525bc6d6 100644 --- a/base/array.jl +++ b/base/array.jl @@ -267,7 +267,7 @@ offset `do`. Return `dest`. """ function copyto!(dest::Array{T}, doffs::Integer, src::Array{T}, soffs::Integer, n::Integer) where T n == 0 && return dest - n > 0 || _throw_argerror(n) + n > 0 || _throw_argerror() if soffs < 1 || doffs < 1 || soffs+n-1 > length(src) || doffs+n-1 > length(dest) throw(BoundsError()) end @@ -276,10 +276,11 @@ function copyto!(dest::Array{T}, doffs::Integer, src::Array{T}, soffs::Integer, end # Outlining this because otherwise a catastrophic inference slowdown -# occurs, see discussion in #27874 -function _throw_argerror(n) +# occurs, see discussion in #27874. +# It is also mitigated by using a constant string. +function _throw_argerror() @_noinline_meta - throw(ArgumentError(string("tried to copy n=", n, " elements, but n should be nonnegative"))) + throw(ArgumentError("Number of elements to copy must be nonnegative.")) end copyto!(dest::Array{T}, src::Array{T}) where {T} = copyto!(dest, 1, src, 1, length(src)) diff --git a/base/checked.jl b/base/checked.jl index 9b11e13caf796..c6a77cacadbae 100644 --- a/base/checked.jl +++ b/base/checked.jl @@ -87,7 +87,7 @@ function checked_neg(x::T) where T<:Integer checked_sub(T(0), x) end throw_overflowerr_negation(x) = (@_noinline_meta; - throw(OverflowError("checked arithmetic: cannot compute -x for x = $x::$(typeof(x))"))) + throw(OverflowError(Base.invokelatest(string, "checked arithmetic: cannot compute -x for x = ", x, "::", typeof(x))))) if BrokenSignedInt != Union{} function checked_neg(x::BrokenSignedInt) r = -x @@ -151,7 +151,7 @@ end throw_overflowerr_binaryop(op, x, y) = (@_noinline_meta; - throw(OverflowError("$x $op $y overflowed for type $(typeof(x))"))) + throw(OverflowError(Base.invokelatest(string, x, " ", op, "y", " overflowed for type ", typeof(x))))) """ Base.checked_add(x, y) diff --git a/base/show.jl b/base/show.jl index 164031b7a5884..2104858483f76 100644 --- a/base/show.jl +++ b/base/show.jl @@ -455,14 +455,14 @@ function show_type_name(io::IO, tn::Core.TypeName) globname = isdefined(tn, :mt) ? tn.mt.name : nothing globfunc = false if globname !== nothing - globname_str = string(globname) + globname_str = string(globname::Symbol) if ('#' ∉ globname_str && '@' ∉ globname_str && isdefined(tn, :module) && isbindingresolved(tn.module, globname) && isdefined(tn.module, globname) && isconcretetype(tn.wrapper) && isa(getfield(tn.module, globname), tn.wrapper)) globfunc = true end end - sym = globfunc ? globname : tn.name + sym = (globfunc ? globname : tn.name)::Symbol if get(io, :compact, false) if globfunc return print(io, "typeof(", sym, ")") diff --git a/base/strings/io.jl b/base/strings/io.jl index 71767cefb52af..7453845211148 100644 --- a/base/strings/io.jl +++ b/base/strings/io.jl @@ -105,6 +105,7 @@ end tostr_sizehint(x) = 8 tostr_sizehint(x::AbstractString) = lastindex(x) +tostr_sizehint(x::Union{String,SubString{String}}) = sizeof(x) tostr_sizehint(x::Float64) = 20 tostr_sizehint(x::Float32) = 12 diff --git a/stdlib/Distributed/src/managers.jl b/stdlib/Distributed/src/managers.jl index 3bc838750ab71..c782279788a13 100644 --- a/stdlib/Distributed/src/managers.jl +++ b/stdlib/Distributed/src/managers.jl @@ -373,7 +373,7 @@ manage struct DefaultClusterManager <: ClusterManager end -const tunnel_hosts_map = Dict{AbstractString, Semaphore}() +const tunnel_hosts_map = Dict{String, Semaphore}() """ connect(manager::ClusterManager, pid::Int, config::WorkerConfig) -> (instrm::IO, outstrm::IO) From 2f8fb89f065dd6b1dd4d268fc15b667ebf7dd0cb Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Mon, 7 Jan 2019 13:30:25 -0500 Subject: [PATCH 59/65] Fix SROA confusing new and old nodes SROA was accidentally treating a pending node as old and thus getting the wrong type when querying the predecessor. As a result it thought one of the paths was unreachable causing undefined data to be introduced on that path (generally the `1.0` that happened to already be in register). Fix #29983 (cherry picked from commit da0179c4d60c0fa3e5d64c08972773c82d57e4e6) --- base/compiler/ssair/passes.jl | 12 +++++++++--- test/compiler/irpasses.jl | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/base/compiler/ssair/passes.jl b/base/compiler/ssair/passes.jl index 68b7424f8a676..22bc84979ae87 100644 --- a/base/compiler/ssair/passes.jl +++ b/base/compiler/ssair/passes.jl @@ -191,7 +191,7 @@ function walk_to_defs(compact::IncrementalCompact, @nospecialize(defssa), @nospe collect(Iterators.filter(1:length(def.edges)) do n isassigned(def.values, n) || return false val = def.values[n] - if isa(defssa, OldSSAValue) && isa(val, SSAValue) + if is_old(compact, defssa) && isa(val, SSAValue) val = OldSSAValue(val.id) end edge_typ = widenconst(compact_exprtype(compact, val)) @@ -201,7 +201,7 @@ function walk_to_defs(compact::IncrementalCompact, @nospecialize(defssa), @nospe for n in possible_predecessors pred = def.edges[n] val = def.values[n] - if isa(defssa, OldSSAValue) && isa(val, SSAValue) + if is_old(compact, defssa) && isa(val, SSAValue) val = OldSSAValue(val.id) end if isa(val, AnySSAValue) @@ -425,6 +425,12 @@ struct LiftedPhi need_argupdate::Bool end +function is_old(compact, @nospecialize(old_node_ssa)) + isa(old_node_ssa, OldSSAValue) && + !is_pending(compact, old_node_ssa) && + !already_inserted(compact, old_node_ssa) +end + function perform_lifting!(compact::IncrementalCompact, visited_phinodes::Vector{Any}, @nospecialize(cache_key), lifting_cache::IdDict{Pair{AnySSAValue, Any}, AnySSAValue}, @@ -455,7 +461,7 @@ function perform_lifting!(compact::IncrementalCompact, isassigned(old_node.values, i) || continue val = old_node.values[i] orig_val = val - if isa(old_node_ssa, OldSSAValue) && !is_pending(compact, old_node_ssa) && !already_inserted(compact, old_node_ssa) && isa(val, SSAValue) + if is_old(compact, old_node_ssa) && isa(val, SSAValue) val = OldSSAValue(val.id) end if isa(val, Union{NewSSAValue, SSAValue, OldSSAValue}) diff --git a/test/compiler/irpasses.jl b/test/compiler/irpasses.jl index d7b1ec172936c..12b299b7b1d91 100644 --- a/test/compiler/irpasses.jl +++ b/test/compiler/irpasses.jl @@ -63,3 +63,29 @@ let results = Float64[] foo30594(4, -1) @test results == [0.0, -1.0, -2.0, -3.0] end + +# Issue #29983 +# This one is a bit hard to trigger, but the key is to create a case +# where SROA needs to introduce an intermediate type-unstable phi node +struct Foo29983{T} + x::Tuple{T} +end +struct Bar29983{S} + x::S +end +Base.:+(a::T, b::Bar29983{S}) where {T, S} = Bar29983(a + b.x) +Base.:+(a::Bar29983{S}, b::T) where {T, S} = b + a +Base.:+(a::Bar29983{S}, b::Bar29983{T}) where {T, S} = Bar29983(a.x + b.x) +Base.:+(a::Foo29983, b::Foo29983) = Foo29983((a.x[1] + b.x[1],)) + +function f(x::Vector{T}) where {T} + x1 = Foo29983((x[1],)) + la1 = Foo29983((x[1],)) + f1 = Foo29983((0,)) + for _ in 1:2 + f1 += la1 + end + return f1 +end + +@test f([Bar29983(1.0)]).x[1].x == 2.0 From cec7e7bc616b7c2816cf26982f3b8a6cc57a596a Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 4 Jan 2019 22:08:17 -0500 Subject: [PATCH 60/65] Defensively fix patterns similar to #29983 I don't have concrete tests for these, but it looks like they all need the `is_old` predicate for what they're doing, so switch those over also while we're at it. (cherry picked from commit 34f7a4a50458594e6d72793b4f371227e8e842e3) --- base/compiler/ssair/passes.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/compiler/ssair/passes.jl b/base/compiler/ssair/passes.jl index 22bc84979ae87..63bd542157659 100644 --- a/base/compiler/ssair/passes.jl +++ b/base/compiler/ssair/passes.jl @@ -130,7 +130,7 @@ function simple_walk(compact::IncrementalCompact, @nospecialize(defssa#=::AnySSA return defssa end if isa(def.val, SSAValue) - if isa(defssa, OldSSAValue) && !already_inserted(compact, defssa) + if is_old(compact, defssa) defssa = OldSSAValue(def.val.id) else defssa = def.val @@ -281,7 +281,7 @@ function lift_leaves(compact::IncrementalCompact, @nospecialize(stmt), end if is_tuple_call(compact, def) && isa(field, Int) && 1 <= field < length(def.args) lifted = def.args[1+field] - if isa(leaf, OldSSAValue) && isa(lifted, SSAValue) + if is_old(compact, leaf) && isa(lifted, SSAValue) lifted = OldSSAValue(lifted.id) end if isa(lifted, GlobalRef) || isa(lifted, Expr) @@ -320,7 +320,7 @@ function lift_leaves(compact::IncrementalCompact, @nospecialize(stmt), compact[leaf] = def end lifted = def.args[1+field] - if isa(leaf, OldSSAValue) && isa(lifted, SSAValue) + if is_old(compact, leaf) && isa(lifted, SSAValue) lifted = OldSSAValue(lifted.id) end if isa(lifted, GlobalRef) || isa(lifted, Expr) @@ -339,7 +339,7 @@ function lift_leaves(compact::IncrementalCompact, @nospecialize(stmt), # N.B.: This can be a bit dangerous because it can lead to # infinite loops if we accidentally insert a node just ahead # of where we are - if isa(leaf, OldSSAValue) && (isa(field, Int) || isa(field, Symbol)) + if is_old(compact, leaf) && (isa(field, Int) || isa(field, Symbol)) (isa(typ, DataType) && (!typ.abstract)) || return nothing @assert !typ.mutable # If there's the potential for an undefref error on access, we cannot insert a getfield From 17f29780d8d08dd8ae20a441d847e50965a94b0a Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 9 Jan 2019 13:30:02 +0100 Subject: [PATCH 61/65] Force specialization of the SubArray boundserror method. Improves https://github.com/JuliaLang/julia/pull/29867 by avoiding an invoke. (cherry picked from commit f2d2d6f465da338062fee79bddf18a9cf56652fd) --- base/subarray.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/subarray.jl b/base/subarray.jl index 2d6f8a709a642..3c3bb89d271f2 100644 --- a/base/subarray.jl +++ b/base/subarray.jl @@ -42,7 +42,7 @@ check_parent_index_match(parent, ::NTuple{N, Bool}) where {N} = # are inlined @inline Base.throw_boundserror(A::SubArray, I) = __subarray_throw_boundserror(typeof(A), A.parent, A.indices, A.offset1, A.stride1, I) -@noinline __subarray_throw_boundserror(T, parent, indices, offset1, stride1, I) = +@noinline __subarray_throw_boundserror(::Type{T}, parent, indices, offset1, stride1, I) where {T} = throw(BoundsError(T(parent, indices, offset1, stride1), I)) # This computes the linear indexing compatibility for a given tuple of indices From 1a2134d87d135f23a17a3fe3a090951d8b7d4bd8 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 9 Jan 2019 23:54:19 +0100 Subject: [PATCH 62/65] remove unneded patching of Makefile (cherry picked from commit 2a2ba37bf29ff73fc32f6df1c1ab79d569d1d7e2) --- deps/blas.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/deps/blas.mk b/deps/blas.mk index c025d4ac26e39..0f1e3e132606f 100644 --- a/deps/blas.mk +++ b/deps/blas.mk @@ -93,7 +93,6 @@ endif OPENBLAS_BUILD_OPTS += MAKE_NB_JOBS=0 $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/source-extracted - perl -i -ple 's/^\s*(EXTRALIB\s*\+=\s*-lSystemStubs)\s*$$/# $$1/g' $(dir $<)/Makefile.system echo 1 > $@ $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-compiled: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured From a5f63ff816598bb0fc0d4923f2146d65047f4b2e Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Fri, 28 Dec 2018 23:40:15 -0800 Subject: [PATCH 63/65] Add BB downloading for OpenBLAS (#30497) * Auto-detect binarybuilder triplet * Add OpenBLAS BinaryBuilder installation scaffolding Also make it easier to add more BB-cached versions of dependencies in the future * Enable `fixup-libgfortran.sh` to directly ask `$FC` for paths * Tell Appveyor and Travis to use BinaryBuilder OpenBLAS Also allow the build system to auto-guess the triplet (cherry picked from commit 87c18d88aefed9154af18aea9cdabca76763409e) --- .travis.yml | 4 +- Make.inc | 3 +- contrib/fixup-libgfortran.sh | 26 +++++-- contrib/normalize_triplet.py | 125 ++++++++++++++++++++++++++++++ contrib/windows/appveyor_build.sh | 3 +- deps/Makefile | 1 + deps/blas.mk | 20 +++++ deps/llvm.mk | 33 +------- deps/openblas.version | 2 + deps/tools/bb-install.mk | 33 ++++++++ 10 files changed, 210 insertions(+), 40 deletions(-) create mode 100755 contrib/normalize_triplet.py create mode 100644 deps/tools/bb-install.mk diff --git a/.travis.yml b/.travis.yml index d04eade2fa27c..1f45c08d32008 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,8 +76,8 @@ before_install: brew tap staticfloat/julia > /dev/null; brew rm --force $(brew deps --HEAD julia); brew install -v ccache gcc gmp mpfr pcre2 staticfloat/julia/openblas-julia staticfloat/julia/suite-sparse-julia staticfloat/juliadeps/libgfortran; - BUILDOPTS="-j3 USECLANG=1 USECCACHE=1 BINARYBUILDER_TRIPLET=x86_64-apple-darwin14 BINARYBUILDER_LLVM_ASSERTS=1"; - BUILDOPTS="$BUILDOPTS USE_BINARYBUILDER_LLVM=1 LLVM_CONFIG=$TRAVIS_BUILD_DIR/usr/tools/llvm-config LLVM_SIZE=$TRAVIS_BUILD_DIR/usr/tools/llvm-size"; + BUILDOPTS="-j3 USECLANG=1 USECCACHE=1 USE_BINARYBUILDER_LLVM=1 USE_BINARYBUILDER_OPENBLAS=1 BINARYBUILDER_LLVM_ASSERTS=1"; + BUILDOPTS="$BUILDOPTS LLVM_CONFIG=$TRAVIS_BUILD_DIR/usr/tools/llvm-config LLVM_SIZE=$TRAVIS_BUILD_DIR/usr/tools/llvm-size"; BUILDOPTS="$BUILDOPTS VERBOSE=1 USE_BLAS64=0 SUITESPARSE_INC=-I$(brew --prefix suite-sparse-julia)/include FORCE_ASSERTIONS=1"; BUILDOPTS="$BUILDOPTS LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas"; for lib in SUITESPARSE BLAS LAPACK GMP MPFR LIBUNWIND; do diff --git a/Make.inc b/Make.inc index 81ff923156ed8..e9cb2411981e5 100644 --- a/Make.inc +++ b/Make.inc @@ -232,11 +232,10 @@ INSTALL_F := $(JULIAHOME)/contrib/install.sh 644 INSTALL_M := $(JULIAHOME)/contrib/install.sh 755 # BinaryBuilder options -# TODO: Autodiscover triplet +USE_BINARYBUILDER_OPENBLAS := 0 USE_BINARYBUILDER_LLVM := 0 # Use the Assertions build BINARYBUILDER_LLVM_ASSERTS := 0 -BINARYBUILDER_TRIPLET := # LLVM Options LLVMROOT := $(build_prefix) diff --git a/contrib/fixup-libgfortran.sh b/contrib/fixup-libgfortran.sh index a994515d2356d..897c067de6a83 100755 --- a/contrib/fixup-libgfortran.sh +++ b/contrib/fixup-libgfortran.sh @@ -2,6 +2,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license # Run as: fixup-libgfortran.sh [--verbose] <$private_libdir> +FC=${FC:-gfortran} # If we're invoked with "--verbose", create a `debug` function that prints stuff out if [ "$1" = "--verbose" ] || [ "$1" = "-v" ]; then @@ -22,7 +23,7 @@ if [ "$UNAME" = "Linux" ]; then elif [ "$UNAME" = "Darwin" ]; then SHLIB_EXT="dylib" else - echo "WARNING: Could not autodetect platform type ('uname -s' == $UNAME); assuming Linux" >&2 + echo "WARNING: Could not autodetect platform type ('uname -s' = $UNAME); assuming Linux" >&2 UNAME="Linux" SHLIB_EXT="so" fi @@ -41,6 +42,20 @@ find_shlib() fi } +find_shlib_dir() +{ + # Usually, on platforms like OSX we get full paths when linking. However, + # if we are inspecting, say, BinaryBuilder-built OpenBLAS libraries, we will + # only get something like `@rpath/libgfortran.5.dylib` when inspecting the + # libraries. We can, as a last resort, ask `$FC` directly what the full + # filepath for this library is, but only if we don't have a direct path to it: + if [ $(dirname "$1") = "@rpath" ]; then + dirname "$($FC -print-file-name="$(basename "$1")" 2>/dev/null)" + else + dirname "$1" 2>/dev/null + fi +} + # First, discover all the places where libgfortran/libgcc is, as well as their true SONAMES for lib in lapack blas openblas; do for private_libname in ${private_libdir}/lib$lib*.$SHLIB_EXT*; do @@ -51,10 +66,11 @@ for lib in lapack blas openblas; do LIBQUADMATH_PATH=$(find_shlib "$private_libname" libquadmath) # Take the directories, add them onto LIBGFORTRAN_DIRS, which we use to - # search for these libraries in the future. - LIBGFORTRAN_DIRS="$LIBGFORTRAN_DIRS $(dirname $LIBGFORTRAN_PATH 2>/dev/null)" - LIBGFORTRAN_DIRS="$LIBGFORTRAN_DIRS $(dirname $LIBGCC_PATH 2>/dev/null)" - LIBGFORTRAN_DIRS="$LIBGFORTRAN_DIRS $(dirname $LIBQUADMATH_PATH 2>/dev/null)" + # search for these libraries in the future. If there is no directory, try + # asking `$FC` where such a file could be found. + LIBGFORTRAN_DIRS="$LIBGFORTRAN_DIRS $(find_shlib_dir $LIBGFORTRAN_PATH)" + LIBGFORTRAN_DIRS="$LIBGFORTRAN_DIRS $(find_shlib_dir $LIBGCC_PATH)" + LIBGFORTRAN_DIRS="$LIBGFORTRAN_DIRS $(find_shlib_dir $LIBQUADMATH_PATH)" # Save the SONAMES LIBGFORTRAN_SONAMES="$LIBGFORTRAN_SONAMES $(basename "$LIBGFORTRAN_PATH")" diff --git a/contrib/normalize_triplet.py b/contrib/normalize_triplet.py new file mode 100755 index 0000000000000..42e9a9f5d5c15 --- /dev/null +++ b/contrib/normalize_triplet.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python + +import re, sys + +# This script designed to mimick `src/PlatformNames.jl` in `BinaryProvider.jl`, which has +# a method `platform_key_abi()` to parse uname-like output into something standarized. + +if len(sys.argv) < 2: + print("Usage: %s []") + sys.exit(1) + +arch_mapping = { + 'x86_64': '(x86_|amd)64', + 'i686': "i\\d86", + 'aarch64': "aarch64", + 'arm': "arm(v7l)?", + 'powerpc64le': "p(ower)?pc64le", +} +platform_mapping = { + 'darwin': "-apple-darwin[\\d\\.]*", + 'freebsd': "-(.*-)?freebsd[\\d\\.]*", + 'windows': "-w64-mingw32", + 'linux': "-(.*-)?linux", +} +libc_mapping = { + 'blank_libc': "", + 'gnu': "-gnu", + 'musl': "-musl", +} +call_abi_mapping = { + 'blank_call_abi': "", + 'eabihf': "eabihf", +} +gcc_version_mapping = { + 'blank_gcc': "", + 'gcc4': "-gcc4", + 'gcc7': "-gcc7", + 'gcc8': "-gcc8", +} +cxx_abi_mapping = { + 'blank_cxx_abi': "", + 'cxx03': "-cxx03", + 'cxx11': "-cxx11", +} + +# Helper function to collapse dictionary of mappings down into a regex of +# named capture groups joined by "|" operators +c = lambda mapping: "("+"|".join(["(?P<%s>%s)"%(k,v) for (k, v) in mapping.items()]) + ")" +mondo_regex = re.compile( + "^"+ + c(arch_mapping)+ + c(platform_mapping)+ + c(libc_mapping)+ + c(call_abi_mapping)+ + c(gcc_version_mapping)+ + c(cxx_abi_mapping)+ + "$" +) + +# Apply our mondo regex to our input: +m = mondo_regex.match(sys.argv[1]) +if m is None: + print("ERROR: Unmatchable platform string '%s'!"%(sys.argv[1])) + sys.exit(1) + +# Helper function to find the single named field within the giant regex +# that is not `nothing` for each mapping we give it. +def get_field(m, mapping): + g = m.groupdict() + for k in mapping: + if g[k] is not None: + return k + +arch = get_field(m, arch_mapping) +platform = get_field(m, platform_mapping) +libc = get_field(m, libc_mapping) +call_abi = get_field(m, call_abi_mapping) +gcc_version = get_field(m, gcc_version_mapping) +cxx_abi = get_field(m, cxx_abi_mapping) + +def r(x): + x = x.replace("blank_call_abi", "") + x = x.replace("blank_gcc", "") + x = x.replace("blank_cxx_abi", "") + x = x.replace("blank_libc", "") + return x + +def p(x): + # These contain characters that can't be easily represented as + # capture group names, unfortunately: + os_remapping = { + 'darwin': 'apple-darwin14', + 'windows': 'w64-mingw32', + 'freebsd': 'unknown-freebsd11.1', + } + x = r(x) + if x: + for k in os_remapping: + x = x.replace(k, os_remapping[k]) + return '-' + x + return x + +# If the user passes in a GCC version (like 8.2.0) use that to force a +# "-gcc8" tag at the end of the triplet, but only if it has otherwise +# not been specified +if gcc_version == "blank_gcc": + if len(sys.argv) == 3: + gcc_version = { + "4": "gcc4", + "5": "gcc4", + "6": "gcc4", + "7": "gcc7", + "8": "gcc8", + }[sys.argv[2][0]] + + +print(arch+p(platform)+p(libc)+r(call_abi)+p(gcc_version)+p(cxx_abi)) + +# Testing suite: +# triplets="i686-w64-mingw32 x86_64-pc-linux-musl arm-linux-musleabihf x86_64-linux-gnu arm-linux-gnueabihf x86_64-apple-darwin14 x86_64-unknown-freebsd11.1" +# for t in $triplets; do +# if [[ $(./normalize_triplet.py "$t") != "$t" ]]; then +# echo "ERROR: Failed test on $t" +# fi +# done diff --git a/contrib/windows/appveyor_build.sh b/contrib/windows/appveyor_build.sh index fa29774a4e63b..b18780e927842 100755 --- a/contrib/windows/appveyor_build.sh +++ b/contrib/windows/appveyor_build.sh @@ -45,7 +45,6 @@ if [ "$ARCH" = x86_64 ]; then echo 'USE_BLAS64 = 1' >> Make.user echo 'LIBBLAS = -L$(JULIAHOME)/usr/bin -lopenblas64_' >> Make.user echo 'LIBBLASNAME = libopenblas64_' >> Make.user - echo 'BINARYBUILDER_TRIPLET = x86_64-w64-mingw32' >> Make.user else bits=32 archsuffix=86 @@ -53,7 +52,6 @@ else echo "override MARCH = pentium4" >> Make.user echo 'LIBBLAS = -L$(JULIAHOME)/usr/bin -lopenblas' >> Make.user echo 'LIBBLASNAME = libopenblas' >> Make.user - echo 'BINARYBUILDER_TRIPLET = i686-w64-mingw32' >> Make.user fi echo "override JULIA_CPU_TARGET=generic;native" >> Make.user @@ -198,6 +196,7 @@ if [ -n "$USEMSVC" ]; then else # Use BinaryBuilder echo 'USE_BINARYBUILDER_LLVM = 1' >> Make.user + echo 'USE_BINARYBUILDER_OPENBLAS = 1' >> Make.user echo 'BINARYBUILDER_LLVM_ASSERTS = 1' >> Make.user echo 'override DEP_LIBS += llvm openlibm' >> Make.user export CCACHE_DIR=/cygdrive/c/ccache diff --git a/deps/Makefile b/deps/Makefile index a759218f6ca03..ba0bb685181db 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -12,6 +12,7 @@ include $(SRCDIR)/Versions.make include $(JULIAHOME)/Make.inc include $(SRCDIR)/tools/common.mk include $(SRCDIR)/tools/git-external.mk +include $(SRCDIR)/tools/bb-install.mk # Special comments: # diff --git a/deps/blas.mk b/deps/blas.mk index 0f1e3e132606f..147a18b9bf9c8 100644 --- a/deps/blas.mk +++ b/deps/blas.mk @@ -92,6 +92,8 @@ endif # Do not overwrite the "-j" flag OPENBLAS_BUILD_OPTS += MAKE_NB_JOBS=0 +ifneq ($(USE_BINARYBUILDER_OPENBLAS), 1) + $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/source-extracted echo 1 > $@ @@ -193,3 +195,21 @@ configure-lapack: extract-lapack compile-lapack: $(BUILDDIR)/lapack-$(LAPACK_VER)/build-compiled fastcheck-lapack: check-lapack check-lapack: $(BUILDDIR)/lapack-$(LAPACK_VER)/build-checked + +else # USE_BINARYBUILDER_OPENBLAS + + +OPENBLAS_BB_URL_BASE := https://github.com/JuliaPackaging/Yggdrasil/releases/download/OpenBLAS-v$(OPENBLAS_VER)-$(OPENBLAS_BB_REL) +OPENBLAS_BB_NAME := OpenBLAS.v$(OPENBLAS_VER)-$(OPENBLAS_BB_REL) + +$(eval $(call bb-install,openblas,OPENBLAS,true)) +get-lapack: get-openblas +extract-lapack: extract-openblas +configure-lapack: configure-openblas +compile-lapack: compile-openblas +fastcheck-lapack: fastcheck-openblas +check-lapack: check-openblas +clean-lapack: clean-openblas +distclean-lapack: distclean-openblas +install-lapack: install-openblas +endif diff --git a/deps/llvm.mk b/deps/llvm.mk index bfef4d51abdec..c516b577f6269 100644 --- a/deps/llvm.mk +++ b/deps/llvm.mk @@ -513,37 +513,12 @@ ifeq ($(USE_POLLY),1) endif endif else # USE_BINARYBUILDER_LLVM -LLVM_BB_URL_BASE := https://github.com/staticfloat/LLVMBuilder/releases/download +LLVM_BB_URL_BASE := https://github.com/staticfloat/LLVMBuilder/releases/download/v$(LLVM_VER)-$(LLVM_BB_REL) ifneq ($(BINARYBUILDER_LLVM_ASSERTS), 1) -LLVM_BB_NAME := LLVM +LLVM_BB_NAME := LLVM.v$(LLVM_VER) else -LLVM_BB_NAME := LLVM.asserts +LLVM_BB_NAME := LLVM.asserts.v$(LLVM_VER) endif -LLVM_BB_NAME := $(LLVM_BB_NAME).v$(LLVM_VER) -LLVM_BB_URL := $(LLVM_BB_URL_BASE)/v$(LLVM_VER)-$(LLVM_BB_REL)/$(LLVM_BB_NAME).$(BINARYBUILDER_TRIPLET).tar.gz - -$(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL): - mkdir -p $@ - -$(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/LLVM.$(BINARYBUILDER_TRIPLET).tar.gz: | $(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL) - $(JLDOWNLOAD) $@ $(LLVM_BB_URL) - -$(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/build-compiled: | $(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/LLVM.$(BINARYBUILDER_TRIPLET).tar.gz - echo 1 > $@ - -$(eval $(call staged-install,llvm,llvm-$$(LLVM_VER)-$$(LLVM_BB_REL),,,,)) - -#Override provision of stage tarball -$(build_staging)/llvm-$(LLVM_VER)-$(LLVM_BB_REL).tgz: $(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/LLVM.$(BINARYBUILDER_TRIPLET).tar.gz | $(build_staging) - cp $< $@ - -clean-llvm: -distclean-llvm: -get-llvm: $(BUILDDIR)/llvm-$(LLVM_VER)-$(LLVM_BB_REL)/LLVM.$(BINARYBUILDER_TRIPLET).tar.gz -extract-llvm: -configure-llvm: -compile-llvm: -fastcheck-llvm: -check-llvm: +$(eval $(call bb-install,llvm,LLVM,false)) endif # USE_BINARYBUILDER_LLVM diff --git a/deps/openblas.version b/deps/openblas.version index fd259abbf7dc4..889bae7c4c860 100644 --- a/deps/openblas.version +++ b/deps/openblas.version @@ -1,2 +1,4 @@ OPENBLAS_BRANCH=v0.3.3 OPENBLAS_SHA1=fd8d1868a126bb9f12bbc43b36ee30d1ba943fbb +OPENBLAS_VER=0.3.3 +OPENBLAS_BB_REL=0 diff --git a/deps/tools/bb-install.mk b/deps/tools/bb-install.mk new file mode 100644 index 0000000000000..4737a9d7693af --- /dev/null +++ b/deps/tools/bb-install.mk @@ -0,0 +1,33 @@ +define bb-install +# If the user has signified that this is a GCC-multiversioned tarball, then generate the proper tarball +ifeq ($(3),true) +$(2)_BB_TRIPLET := $(shell python $(call cygpath_w,$(JULIAHOME)/contrib/normalize_triplet.py) $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) $(lastword $(shell $(FC) --version | head -1))) +else +$(2)_BB_TRIPLET := $(shell python $(call cygpath_w,$(JULIAHOME)/contrib/normalize_triplet.py) $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE))) +endif +$(2)_BB_URL := $$($(2)_BB_URL_BASE)/$$($(2)_BB_NAME).$$($(2)_BB_TRIPLET).tar.gz + +$$(BUILDDIR)/$(1)-$$($(2)_BB_NAME): + mkdir -p $$@ + +$$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/$(2).$$($(2)_BB_TRIPLET).tar.gz: | $$(BUILDDIR)/$(1)-$$($(2)_BB_NAME) + $$(JLDOWNLOAD) $$@ $$($(2)_BB_URL) + +$$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/build-compiled: | $$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/$(2).$$($(2)_BB_TRIPLET).tar.gz + echo 1 > $$@ + +$$(eval $$(call staged-install,$(1),$(1)-$$$$($(2)_BB_NAME),,,,)) + +#Override provision of stage tarball +$$(build_staging)/$(1)-$$($(2)_BB_NAME).tgz: $$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/$(2).$$($(2)_BB_TRIPLET).tar.gz | $$(build_staging) + cp $$< $$@ + +clean-$(1): +distclean-$(1): +get-$(1): $$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/$(2).$$($(2)_BB_TRIPLET).tar.gz +extract-$(1): +configure-$(1): +compile-$(1): +fastcheck-$(1): +check-$(1): +endef From 05a8951398d94708e3f4b6917da3dca5b2383eb2 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 3 Jan 2019 14:03:38 -0800 Subject: [PATCH 64/65] Fix `bb-install` naming conventions, add hashes (#30535) * Fix `bb-install` naming conventions, add hashes * Set `DEP_LIBS` to include `openblas` on Appveyor * When guessing BB libc, default to `glibc` on Linux * Fix bb-install bash parsing failure Quote to avoid bash freaking out from spurious `)` from compilers that have fancy version strings such as `(Red Hat 7.3.1-5)`, which gets `lastword`'ed down to `7.3.1-5)`. * Add `contrib/refresh_bb_tarballs.sh` to aid in batch-grabbing BB hashes (cherry picked from commit 8b189ec494479d9e2ffda0549f066ba2c6389182) --- contrib/normalize_triplet.py | 4 +++ contrib/refresh_bb_tarballs.sh | 31 +++++++++++++++++++ contrib/windows/appveyor_build.sh | 2 +- .../LLVM.v6.0.1.aarch64-linux-gnu.tar.gz/md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../LLVM.v6.0.1.i686-linux-gnu.tar.gz/md5 | 1 + .../LLVM.v6.0.1.i686-linux-gnu.tar.gz/sha512 | 1 + .../LLVM.v6.0.1.i686-w64-mingw32.tar.gz/md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../LLVM.v6.0.1.x86_64-linux-gnu.tar.gz/md5 | 1 + .../sha512 | 1 + .../LLVM.v6.0.1.x86_64-w64-mingw32.tar.gz/md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 + .../sha512 | 1 + deps/tools/bb-install.mk | 29 +++++++++++------ 92 files changed, 143 insertions(+), 11 deletions(-) create mode 100755 contrib/refresh_bb_tarballs.sh create mode 100644 deps/checksums/LLVM.v6.0.1.aarch64-linux-gnu.tar.gz/md5 create mode 100644 deps/checksums/LLVM.v6.0.1.aarch64-linux-gnu.tar.gz/sha512 create mode 100644 deps/checksums/LLVM.v6.0.1.arm-linux-gnueabihf.tar.gz/md5 create mode 100644 deps/checksums/LLVM.v6.0.1.arm-linux-gnueabihf.tar.gz/sha512 create mode 100644 deps/checksums/LLVM.v6.0.1.i686-linux-gnu.tar.gz/md5 create mode 100644 deps/checksums/LLVM.v6.0.1.i686-linux-gnu.tar.gz/sha512 create mode 100644 deps/checksums/LLVM.v6.0.1.i686-w64-mingw32.tar.gz/md5 create mode 100644 deps/checksums/LLVM.v6.0.1.i686-w64-mingw32.tar.gz/sha512 create mode 100644 deps/checksums/LLVM.v6.0.1.powerpc64le-linux-gnu.tar.gz/md5 create mode 100644 deps/checksums/LLVM.v6.0.1.powerpc64le-linux-gnu.tar.gz/sha512 create mode 100644 deps/checksums/LLVM.v6.0.1.x86_64-apple-darwin14.tar.gz/md5 create mode 100644 deps/checksums/LLVM.v6.0.1.x86_64-apple-darwin14.tar.gz/sha512 create mode 100644 deps/checksums/LLVM.v6.0.1.x86_64-linux-gnu.tar.gz/md5 create mode 100644 deps/checksums/LLVM.v6.0.1.x86_64-linux-gnu.tar.gz/sha512 create mode 100644 deps/checksums/LLVM.v6.0.1.x86_64-w64-mingw32.tar.gz/md5 create mode 100644 deps/checksums/LLVM.v6.0.1.x86_64-w64-mingw32.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc8.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc4.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc4.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc7.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc7.tar.gz/sha512 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc8.tar.gz/md5 create mode 100644 deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc8.tar.gz/sha512 diff --git a/contrib/normalize_triplet.py b/contrib/normalize_triplet.py index 42e9a9f5d5c15..8ac7e2553c291 100755 --- a/contrib/normalize_triplet.py +++ b/contrib/normalize_triplet.py @@ -78,6 +78,10 @@ def get_field(m, mapping): gcc_version = get_field(m, gcc_version_mapping) cxx_abi = get_field(m, cxx_abi_mapping) +# The default libc on Linux is glibc +if platform == "linux" and libc == "blank_libc": + libc = "gnu" + def r(x): x = x.replace("blank_call_abi", "") x = x.replace("blank_gcc", "") diff --git a/contrib/refresh_bb_tarballs.sh b/contrib/refresh_bb_tarballs.sh new file mode 100755 index 0000000000000..9aac101b68e7d --- /dev/null +++ b/contrib/refresh_bb_tarballs.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Get this list via: +# using BinaryBuilder +# print("TRIPLETS=\"$(join(triplet.(BinaryBuilder.supported_platforms()), " "))\"") +TRIPLETS="i686-linux-gnu x86_64-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf powerpc64le-linux-gnu i686-linux-musl x86_64-linux-musl aarch64-linux-musl arm-linux-musleabihf x86_64-apple-darwin14 x86_64-unknown-freebsd11.1 i686-w64-mingw32 x86_64-w64-mingw32" + +# These are the projects currently using BinaryBuilder; both GCC-expanded and non-GCC-expanded: +BB_PROJECTS="llvm" +BB_GCC_EXPANDED_PROJECTS="openblas" + +# Get "contrib/" directory path +CONTRIB_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) + +set -x +# For each triplet and each project, download the BB tarball and save its hash: +for triplet in ${TRIPLETS}; do + for proj in ${BB_PROJECTS}; do + PROJ="$(echo ${proj} | tr [a-z] [A-Z])" + make -C "${CONTRIB_DIR}/../deps" USE_BINARYBUILDER_${PROJ}=1 ${PROJ}_BB_TRIPLET=${triplet} distclean-${proj} + make -C "${CONTRIB_DIR}/../deps" USE_BINARYBUILDER_${PROJ}=1 ${PROJ}_BB_TRIPLET=${triplet} compile-${proj} + done + + for proj in ${BB_GCC_EXPANDED_PROJECTS}; do + PROJ="$(echo ${proj} | tr [a-z] [A-Z])" + for gcc in gcc4 gcc7 gcc8; do + make -C "${CONTRIB_DIR}/../deps" USE_BINARYBUILDER_${PROJ}=1 ${PROJ}_BB_TRIPLET=${triplet}-${gcc} distclean-${proj} + make -C "${CONTRIB_DIR}/../deps" USE_BINARYBUILDER_${PROJ}=1 ${PROJ}_BB_TRIPLET=${triplet}-${gcc} compile-${proj} + done + done +done diff --git a/contrib/windows/appveyor_build.sh b/contrib/windows/appveyor_build.sh index b18780e927842..082d98c17d9b8 100755 --- a/contrib/windows/appveyor_build.sh +++ b/contrib/windows/appveyor_build.sh @@ -198,7 +198,7 @@ else echo 'USE_BINARYBUILDER_LLVM = 1' >> Make.user echo 'USE_BINARYBUILDER_OPENBLAS = 1' >> Make.user echo 'BINARYBUILDER_LLVM_ASSERTS = 1' >> Make.user - echo 'override DEP_LIBS += llvm openlibm' >> Make.user + echo 'override DEP_LIBS += llvm openlibm openblas' >> Make.user export CCACHE_DIR=/cygdrive/c/ccache echo 'USECCACHE=1' >> Make.user make check-whitespace diff --git a/deps/checksums/LLVM.v6.0.1.aarch64-linux-gnu.tar.gz/md5 b/deps/checksums/LLVM.v6.0.1.aarch64-linux-gnu.tar.gz/md5 new file mode 100644 index 0000000000000..27d3b973b20a9 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.aarch64-linux-gnu.tar.gz/md5 @@ -0,0 +1 @@ +46152d2b14fd1a9b052e0dcf341fdc60 diff --git a/deps/checksums/LLVM.v6.0.1.aarch64-linux-gnu.tar.gz/sha512 b/deps/checksums/LLVM.v6.0.1.aarch64-linux-gnu.tar.gz/sha512 new file mode 100644 index 0000000000000..21a1fea1b3b80 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.aarch64-linux-gnu.tar.gz/sha512 @@ -0,0 +1 @@ +0d0f0a2331d5c4fe6b0b81ce1d03df73faa418308b6bb59a3a663d398bb33f95a03a882d2abe1f962c9dd58f063ab8f6d571a3e9df1951ede2b6594fdb1e34b9 diff --git a/deps/checksums/LLVM.v6.0.1.arm-linux-gnueabihf.tar.gz/md5 b/deps/checksums/LLVM.v6.0.1.arm-linux-gnueabihf.tar.gz/md5 new file mode 100644 index 0000000000000..9bafee5a23dce --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.arm-linux-gnueabihf.tar.gz/md5 @@ -0,0 +1 @@ +4969025231930de85f04ba2fcb15589a diff --git a/deps/checksums/LLVM.v6.0.1.arm-linux-gnueabihf.tar.gz/sha512 b/deps/checksums/LLVM.v6.0.1.arm-linux-gnueabihf.tar.gz/sha512 new file mode 100644 index 0000000000000..a4d47733d6f9f --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.arm-linux-gnueabihf.tar.gz/sha512 @@ -0,0 +1 @@ +ee1df591b443e75a6359f1ee72635925a60f1fde2a21c62f818d7eaedff4e8aacfef16a18e417f29ee02f3a5e972dd59a25bcea8b4822efb688ce18a744e24a5 diff --git a/deps/checksums/LLVM.v6.0.1.i686-linux-gnu.tar.gz/md5 b/deps/checksums/LLVM.v6.0.1.i686-linux-gnu.tar.gz/md5 new file mode 100644 index 0000000000000..3702585999c90 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.i686-linux-gnu.tar.gz/md5 @@ -0,0 +1 @@ +8dbfc95c4b69b3a6dee154d73865fff8 diff --git a/deps/checksums/LLVM.v6.0.1.i686-linux-gnu.tar.gz/sha512 b/deps/checksums/LLVM.v6.0.1.i686-linux-gnu.tar.gz/sha512 new file mode 100644 index 0000000000000..43632266302d1 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.i686-linux-gnu.tar.gz/sha512 @@ -0,0 +1 @@ +6cc8bb7d76c4d606f1b02d99d81d320c5498fa851bbaac284162ac9306c5e8b10db43f0411c0c0b6e778bbb88bd86ce33dbc4ff1bd74bc2610514a536af367b4 diff --git a/deps/checksums/LLVM.v6.0.1.i686-w64-mingw32.tar.gz/md5 b/deps/checksums/LLVM.v6.0.1.i686-w64-mingw32.tar.gz/md5 new file mode 100644 index 0000000000000..069cae96b15f5 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.i686-w64-mingw32.tar.gz/md5 @@ -0,0 +1 @@ +20ef707d38a3ea744cc5748170c09dad diff --git a/deps/checksums/LLVM.v6.0.1.i686-w64-mingw32.tar.gz/sha512 b/deps/checksums/LLVM.v6.0.1.i686-w64-mingw32.tar.gz/sha512 new file mode 100644 index 0000000000000..cad16a805c30e --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.i686-w64-mingw32.tar.gz/sha512 @@ -0,0 +1 @@ +84343663f17b6aeea6114478c35741b509ff696e6d042d8666aa52adc9ed17f64d90823123be7eaef367dacf34daf4466c83e662d2b5aa9046e950d1b611f831 diff --git a/deps/checksums/LLVM.v6.0.1.powerpc64le-linux-gnu.tar.gz/md5 b/deps/checksums/LLVM.v6.0.1.powerpc64le-linux-gnu.tar.gz/md5 new file mode 100644 index 0000000000000..4b8a47a1d79ed --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.powerpc64le-linux-gnu.tar.gz/md5 @@ -0,0 +1 @@ +19afaeb0632a880777b88482f69ccdfc diff --git a/deps/checksums/LLVM.v6.0.1.powerpc64le-linux-gnu.tar.gz/sha512 b/deps/checksums/LLVM.v6.0.1.powerpc64le-linux-gnu.tar.gz/sha512 new file mode 100644 index 0000000000000..c1183ce6d3b31 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.powerpc64le-linux-gnu.tar.gz/sha512 @@ -0,0 +1 @@ +3ecd22371aa4bb24b854467c40fa72d25e2e9d2f9e9b684b2d541d6003a151a763998b1a1171636207850f3f4da4656a4c62a4d7bc065d055b86f6380874e430 diff --git a/deps/checksums/LLVM.v6.0.1.x86_64-apple-darwin14.tar.gz/md5 b/deps/checksums/LLVM.v6.0.1.x86_64-apple-darwin14.tar.gz/md5 new file mode 100644 index 0000000000000..657e760ebe3df --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.x86_64-apple-darwin14.tar.gz/md5 @@ -0,0 +1 @@ +fba99debe20aa1a131f61c539cf66b73 diff --git a/deps/checksums/LLVM.v6.0.1.x86_64-apple-darwin14.tar.gz/sha512 b/deps/checksums/LLVM.v6.0.1.x86_64-apple-darwin14.tar.gz/sha512 new file mode 100644 index 0000000000000..484bc27299e2e --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.x86_64-apple-darwin14.tar.gz/sha512 @@ -0,0 +1 @@ +efc19110cd4b36a77249b20fb31b5b35cea0c0932d9ae8bb279064d93ead5869b608a27146a5f08e0aedde913bfa3435758e0a60b6e79087e3fbc2f61c7801ba diff --git a/deps/checksums/LLVM.v6.0.1.x86_64-linux-gnu.tar.gz/md5 b/deps/checksums/LLVM.v6.0.1.x86_64-linux-gnu.tar.gz/md5 new file mode 100644 index 0000000000000..8a99d684df419 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.x86_64-linux-gnu.tar.gz/md5 @@ -0,0 +1 @@ +287274fe536cb5b241d1fd84be23b874 diff --git a/deps/checksums/LLVM.v6.0.1.x86_64-linux-gnu.tar.gz/sha512 b/deps/checksums/LLVM.v6.0.1.x86_64-linux-gnu.tar.gz/sha512 new file mode 100644 index 0000000000000..851222926ac37 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.x86_64-linux-gnu.tar.gz/sha512 @@ -0,0 +1 @@ +9d1419e594c88b9ac4c64745a79292e8a83d3e1b21b65a24bb8531e19b5044d178b975acefe67a71b468282ffebac6a906213a4f7345d9e111c92441fd9b674e diff --git a/deps/checksums/LLVM.v6.0.1.x86_64-w64-mingw32.tar.gz/md5 b/deps/checksums/LLVM.v6.0.1.x86_64-w64-mingw32.tar.gz/md5 new file mode 100644 index 0000000000000..0230bce662d87 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.x86_64-w64-mingw32.tar.gz/md5 @@ -0,0 +1 @@ +f1c51ca218daf247a4119dfa68105ec5 diff --git a/deps/checksums/LLVM.v6.0.1.x86_64-w64-mingw32.tar.gz/sha512 b/deps/checksums/LLVM.v6.0.1.x86_64-w64-mingw32.tar.gz/sha512 new file mode 100644 index 0000000000000..6194e1f96dd77 --- /dev/null +++ b/deps/checksums/LLVM.v6.0.1.x86_64-w64-mingw32.tar.gz/sha512 @@ -0,0 +1 @@ +355e10041f4827bcc3409312cc0d069c10d731b91c3afaf9905f72b321818102bfab7032340282a11e0ddb4b946fb8aff5c874b9f884a856e3743b394ad601b5 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..792f513b4167d --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +f088cf15546c4eedba5209b72a9f9ac5 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..c267d5a7ede11 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +7e43fa526bc31793a2b2a5c289cd8676741c01f2c5403da5da010dc057d8327dba46bbd6bbde6543d110f4c29529f344ed60c6648e8f0860e29b97b02b1900ec diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..c5bd2ae1f68df --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +92628223024ec50dd3a4f9951a519627 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..fb2ec47413c2e --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +83a3c1e457d1b3a5014171bfeb773cd6c9abbe0677f8825565c4b7dfe2c0006fa98432c9603fce65c0bfa303abfa1a5808215d83de0ce25cf82803c89ed090a7 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..1cce6f1bdc23e --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +311db7786512fd6d10d894aacf34585c diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..96fbf57bb0d07 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-gnu-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +a960332431e19c7c81c8fbfd25807dd36b76467783e88d6786390ed380e44d573e83c412e5676099f399dabdd122225dc592f6550ea548df4d5bb855e669a197 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..d02384e04ba5f --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +8a57c45906f45e3e23f45ad15342b86f diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..4c67392f1a146 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +e5746eacd59ab9d758a96887e704c3069756e64c492e803b39667c9fe0fb3f31630b107a8d3ed78d2f577998dcf05ef1b22635269f0b1d07f1f7a885c0a40de0 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..94b0a7869ca16 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +784b3804c06102a2a5e921045128141d diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..32b29be1c51b3 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +42d9a646b9bf334366c6e8f10f97095182cbfa20a1d81767d2c7840807c6b119ac680805a49422594964d1595d840189a0a4237b77aa996f421035f7fa0724df diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..f1609510e419c --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +80847101ea313e3481c6b1eca511edba diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..ab61a60182ca4 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.aarch64-linux-musl-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +e213f0cccec17bcbc575a7892ebc3fef96fd7626af15dabe1e00d11dca1b7ecbdb703b76dded37567f01ad7c6c6bb1128d00deccea3f22b989e906331b90d048 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..807bf5843ec31 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +1725d3703e48a65202fd6a1b85939562 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..cb93ab0a43f0d --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +f0e37ff06cfe5e2e068209ae5606818e2237befb16df44fd37992d6fa4ab09f011163f1ee9bc7f402f01636e102a9aa76ab87b452739767ea5418504bb42e712 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..e6aa6406a6588 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +d04050d4950af260d50b2776fd9644be diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..2644cb0868c61 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +8fe6db1d9f89728dff78d00a3baac433f1cb49cb4f2b4137200a5adc7e09ec1e6defdfacde0ff8b4f116bccc119d7a2446f393d72915d1fb6196bc5eebe6dd3b diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..284204f72591b --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +27f231b907ad9eea5209e7162b7ee9ed diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..89d75e0da6d72 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-gnueabihf-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +13651977b234fd69dd784d3b302d3cc86c01aa5c6feade2a89a2141c0ae8d3e69ae45d8c821efae20bc5fd287675b761923ebe9dd16a6e43ef82b3c39f78efc8 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..e482400f2299c --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +c46ce6edbc149e7e50746d36f5dd39be diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..ba3337631b0e8 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +47e476d9f53678e7831e585bc2bb9da6b5ca52691e534a4ef9a6e4b1d47dab863ea4f40cbc0f280a275ebfe7158502ad8e87c318a099969da86268494ad5cdec diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..b01ce44a9c815 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +7436441c3396058e64aecaed35e0aaf7 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..48a5845697314 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +1855fdc531d9e22a8ea7312d766e1557d8534dee3db2d500815b6a07975a715ebbaa905a7a8e61dc4f187295ef6ac0f1cb88d761b6b219c98723164ce037a701 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..86e3a719f00ce --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +f288cefa5efdf8198baa34f2926efb5f diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..e0942d9a7fb46 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.arm-linux-musleabihf-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +b64d8175bda0ef8f21913612118e2c778378edfd40076d5f4894d63f78275b6308b57fc398c818098c230d2cb5370c681348db01f894a36981315ed4fe231a75 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..67d9c67582570 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +c39eccd8437526a85d882b9361bf992f diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..1da2e5c7fc18d --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +5450c993b3a5d51263b4566f4216539ddfd68a9d320ac2d1acd667aab32cade6dc23d419eb6661fed1da735fe002a1c8174a1587c852291adcba79569ecfbd57 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..d95221396e26d --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +586864e85249190e75aee1ff9efac507 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..5679d3ca77038 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +99efda0f03a13663515451a8bd16dd0db575c92cce469d6eaa8197f59a0f49b485eaafa9746dde9bc362208d1033e0981c4c113436cbf6992155a84579cc2258 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..4203ef9ece336 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +ed4247b9afeed44c4fe6a8936450db0d diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..3cf3d3638f50a --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-gnu-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +ee5427db88236f800721ae5f68996da346a79223a6fc5a4a77241a39462090e9d04617efbf7f9af533002b2394785c408d60cb6dfe8217da6d83f3386df583f6 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..3ac9903586820 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +0d5962eff8b08fa0bde0927ffba16ea6 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..97c5ff5c912c3 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +02a8ebd0172acf789b9f91b9289424185bfbd23c8f7844c31df13eb598d99dcc654fe9f3a3b034b56bad0cae5f88318610a0981aa40ab1304121c2bf4c86f79b diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..39b4cdc316f9e --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +8ed451829c335e9149fb8bb8450186d9 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..811f7ff115a51 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +975f17af10e9d3404d22bd85e2420594d84c142a0223705293a7a4f1f0533ddde1d8cd61db5e6749e1b6f75080d02719bda13a8618e6b751aff257dc01d451f6 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..d8fc618464a41 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +2bd3407e74930750863ef732ed4c436e diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..b880d8f218b32 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-linux-musl-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +d4af029f0ae70604f69d757f8bd6c02ff597984bb130099a8755fe8660dad04b1a22dbeea4008b5ec9462b0508524b6091a380d509f195857de5c82c4b7b058d diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..8a7892b50611e --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +71fabfa2708eee2fc70d559059ea5292 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..1aa5a4b454695 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +5814455eb15782f69b60493e5d4fcc6525c2ae942c8c4836a422401be0f9d89ef581bd6e45a2d85f148ec97a64197159ad7a9a49302b190b0bc0e4f6457b62c0 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..2d6f900493ae0 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +6837acfadac6150ca5da993fbfe49524 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..e48dc0b46fb37 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +26724b8b34e1f435118636d767648c64e91e2f7a25393e5b685564b05d6960e41417a491477952c477ee623cfa66387d41ebde9267539261b851b66add1ba6ba diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..a5c3773388afe --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +bfb0a11291016152f5a8e7c7cd53b729 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..e91fe6d240b8d --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.i686-w64-mingw32-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +64f4121b4d9e242f034630d446cb841f242e48165ca8e9026463c825d42b8cd2720045fcd46d630a402672ba0e06c6519cdec9d7b78d96ab7a0ee6f00fcaf4fd diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..456f9f875449c --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +212dbd606a757a433ca9b025b81d0b01 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..6542731f434f9 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +1aa3d9309b1d1fbcf9fb4c8c0c8e178aed264efe3b60a81ab35328939ae63b141e8d87de9abafac6c488ae8438f3550cccb05200b78e6994fdc4d8be478aade3 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..4ee77ca0fd4f0 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +d85de52c6b2d2163da276fec2fb853e2 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..1972a0e145120 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +35724cc9eead1a1b48c87b1f9924284382538904ba857778840258e98e45cc72898cac48736cd08007a20e9908a6f43ee26a3891e4de9e1d1988db3c4e140a70 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..0a1246c78259e --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +a064e25190a1b8e88e6ac5a23138b600 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..e5e889c7cf4c1 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.powerpc64le-linux-gnu-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +9cf9658fa77c61b7a2f462ef5ce4097b288579aeb6e19e2fb3f4bc2e2d2697be16febda65b92a4061e7c007b9b5a317e6c318e5e7c7deaabd84a5a382f7f74b8 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..a1ed52a7b2ee0 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +b45a0b6dbd411ca00674113086066fb1 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..62b089d98d99a --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +c3630ff607f78ec5007e72edec8c237ddd68b9b3bb5d15ce0695677d33107302aaca33e1fe7349762779a7ea327e6465a7edaeb114df44ff363074d8e69124fc diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..671eab75db79b --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +0914a5f99799b10515533d966088739a diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..3eef2762c12ed --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +160225f3afa22f1ce4698bea73597266a96a7483454283a5f17ab105731dadff7374b36e21b37eeff73afa9e725d224fb1e65262d2a737ff91a2e04825eddb5d diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..3a00ca0216ed2 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +7a19c9986027c6740d9ccf878fdf685a diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..3e0388b9e80c3 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-apple-darwin14-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +582b285d2bc3f5d6984a60646356efa2a17c198d598a47f5060638fdaaca814cff0035946b408707d7269bbb9d5f30ca0cf1cec72d98b1c1f5893d94b5bf0e69 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..95608d50b3a10 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +cf06a7c6dbe8e72f7faf0e8b8dc45b5b diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..729ca02670b8a --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +ee6c8d7ab063151cc31384c8b5aac09930e43ad47eaf88ea6becc3fe63b45502979b2510df9c64866e2fe843b6c996b6e8f6c580557765262f48ddf05711ac77 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..a18e2bfcd872a --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +dd83850d3dccaf8a86c1dc2c92bd2722 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..5aa3cbcd98e5c --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +f09ec01d77dd362afce2d801b07bbad3fd7bf4968f3675f7da199f6e36641fa4a1f39e0efdd29811f38af41e084a06999e183a5e9d8dd6b19ccc574009bbd56a diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..9c9dae5cf3eed --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +77dcaa22914d8a83bb430fa8da8f0e7d diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..01490f443b11f --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-gnu-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +b2b9141ca3ed0ffc7e6b65b6e066d7c18fd9d2db4cde0ffdf3ad4dfa6d6c6c2a0d58986e611d6628e36644f3fb50a844aac9a8b5aa2a70e29a26005b019a2592 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..dfd30fccb742d --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +21124a1f217460744ef6613d1227da03 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..1d74b2061dbb1 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +fddebd7bbd1e67e1ce3fb9887b2bfbdba53452ab445d25a718d6369a9d91957b45fbca24f246d2823bfcf51a1aa8f9bc3530f43cf66d7915e01da8810041342d diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..d73728859785f --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +a5203a3d0101c0f8af922ca4d9e9f63d diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..2b3a6f1a7dbae --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +209107bb4d61494a90f7efecfaeb2074183e1f0ca4b28e6caf1bd87fd356ba7f82ba4ad34e9e34a27669ee55f9df38bb831bcc9c3ca3f4f45aacc1d1747cd2b5 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..8835978052e1b --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +25b669075a95cdaf89f15970125d1f61 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..0f4bdbdb92d75 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-linux-musl-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +62dcd6e02b4d175eb2cf4a66fbd0bdc53b42e5cf7d710b999cf82cefe96abffe017b7e02821ea9f8da610d64a671414b92b8ae66750c0d828573f0c30161b223 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc4.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc4.tar.gz/md5 new file mode 100644 index 0000000000000..35fc9d28191e7 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc4.tar.gz/md5 @@ -0,0 +1 @@ +6f18d278fde2b975a87eb4bc4713535a diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc4.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc4.tar.gz/sha512 new file mode 100644 index 0000000000000..565dd9928a980 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc4.tar.gz/sha512 @@ -0,0 +1 @@ +6fed03c459cf4eb0237d838da1e0dfb2f57d6f13a345e74a4e7bdd0f11ef487646d00c1741a8965a2a05abdf61b4ed517a1bf955e5f8a93b590ed7824543d5da diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc7.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc7.tar.gz/md5 new file mode 100644 index 0000000000000..c2c8e742da8da --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc7.tar.gz/md5 @@ -0,0 +1 @@ +4adce6ef2ba3b74ae180302d511144de diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc7.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc7.tar.gz/sha512 new file mode 100644 index 0000000000000..0608e8a46d6fc --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc7.tar.gz/sha512 @@ -0,0 +1 @@ +ca43770bbb021a0ffb2847bf45fbaa4d9b8fff78bc201094adf4dac1df4e5db52eee2646155c415fc9b5a0e419426f335b246c90c193c423cce86def172b034f diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc8.tar.gz/md5 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc8.tar.gz/md5 new file mode 100644 index 0000000000000..e228b6bb332db --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc8.tar.gz/md5 @@ -0,0 +1 @@ +e88ac7a195ddb48f71ecd13d91e62cf0 diff --git a/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc8.tar.gz/sha512 b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc8.tar.gz/sha512 new file mode 100644 index 0000000000000..0ef69f1f9b025 --- /dev/null +++ b/deps/checksums/OpenBLAS.v0.3.3-0.x86_64-w64-mingw32-gcc8.tar.gz/sha512 @@ -0,0 +1 @@ +0a73eec901c3470c354468e0b961325eda1a1515dcbe9f25528856390eecf21f81fec37def9f9e1661ec84db1a4fa782a4607d16805661c743bd978050f82d6a diff --git a/deps/tools/bb-install.mk b/deps/tools/bb-install.mk index 4737a9d7693af..24e3e7232d4d8 100644 --- a/deps/tools/bb-install.mk +++ b/deps/tools/bb-install.mk @@ -1,33 +1,42 @@ define bb-install # If the user has signified that this is a GCC-multiversioned tarball, then generate the proper tarball ifeq ($(3),true) -$(2)_BB_TRIPLET := $(shell python $(call cygpath_w,$(JULIAHOME)/contrib/normalize_triplet.py) $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) $(lastword $(shell $(FC) --version | head -1))) +$(2)_BB_TRIPLET := $(shell python $(call cygpath_w,$(JULIAHOME)/contrib/normalize_triplet.py) $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) "$(lastword $(shell $(FC) --version | head -1))") else $(2)_BB_TRIPLET := $(shell python $(call cygpath_w,$(JULIAHOME)/contrib/normalize_triplet.py) $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE))) endif $(2)_BB_URL := $$($(2)_BB_URL_BASE)/$$($(2)_BB_NAME).$$($(2)_BB_TRIPLET).tar.gz +$(2)_BB_BASENAME := $$(shell basename $$($(2)_BB_URL)) -$$(BUILDDIR)/$(1)-$$($(2)_BB_NAME): +$$(BUILDDIR)/$$($(2)_BB_NAME): mkdir -p $$@ -$$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/$(2).$$($(2)_BB_TRIPLET).tar.gz: | $$(BUILDDIR)/$(1)-$$($(2)_BB_NAME) +$$(SRCCACHE)/$$($(2)_BB_BASENAME): | $$(SRCCACHE) $$(JLDOWNLOAD) $$@ $$($(2)_BB_URL) -$$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/build-compiled: | $$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/$(2).$$($(2)_BB_TRIPLET).tar.gz +$$(BUILDDIR)/$$($(2)_BB_NAME)/build-compiled: $$(BUILDDIR)/$$($(2)_BB_NAME) | $$(SRCCACHE)/$$($(2)_BB_BASENAME) + $$(JLCHECKSUM) $$(SRCCACHE)/$$($(2)_BB_BASENAME) echo 1 > $$@ -$$(eval $$(call staged-install,$(1),$(1)-$$$$($(2)_BB_NAME),,,,)) +$$(eval $$(call staged-install,$(1),$$($(2)_BB_NAME),,,,)) #Override provision of stage tarball -$$(build_staging)/$(1)-$$($(2)_BB_NAME).tgz: $$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/$(2).$$($(2)_BB_TRIPLET).tar.gz | $$(build_staging) +$$(build_staging)/$$($(2)_BB_NAME).tgz: $$(SRCCACHE)/$$($(2)_BB_BASENAME) | $$(build_staging) cp $$< $$@ -clean-$(1): -distclean-$(1): -get-$(1): $$(BUILDDIR)/$(1)-$$($(2)_BB_NAME)/$(2).$$($(2)_BB_TRIPLET).tar.gz +clean-bb-$(1): + rm -f $$(build_staging)/$$($(2)_BB_BASENAME) + rm -f $$(BUILDDIR)/$$($(2)_BB_NAME)/build-compiled + +clean-$(1): clean-bb-$(1) +distclean-$(1): clean-bb-$(1) +get-$(1): $$(SRCCACHE)/$$($(2)_BB_BASENAME) extract-$(1): configure-$(1): -compile-$(1): +compile-$(1): $$(BUILDDIR)/$$($(2)_BB_NAME)/build-compiled +install-$(1): compile-$(1) fastcheck-$(1): check-$(1): + +.PHONY: clean-bb-$(1) endef From 980eda064e5a0381a6afa19046d77c1f33e1f301 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sat, 12 Jan 2019 16:19:04 -0800 Subject: [PATCH 65/65] Set VERSION to 1.1.0-rc2 (#30701) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8376431e34044..82c82bc474fa2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.0-rc1 +1.1.0-rc2