diff --git a/NEWS.md b/NEWS.md index 11424d5df1381..4a9c56566d151 100644 --- a/NEWS.md +++ b/NEWS.md @@ -88,7 +88,6 @@ New library functions * `Sys.username()` can be used to return the current user's username ([#51897]). * `Sys.isreadable(), Sys.iswritable()` can be used to check if the current user has access permissions that permit reading and writing, respectively. ([#53320]). -* `wrap(Array, m::Union{MemoryRef{T}, Memory{T}}, dims)` is the safe counterpart to `unsafe_wrap` ([#52049]). * `GC.logging_enabled()` can be used to test whether GC logging has been enabled via `GC.enable_logging` ([#51647]). * `IdSet` is now exported from Base and considered public ([#53262]). * `@time` now reports a count of any lock conflicts where a `ReentrantLock` had to wait, plus a new macro @@ -142,12 +141,6 @@ Standard library changes * The new `@styled_str` string macro provides a convenient way of creating a `AnnotatedString` with various faces or other attributes applied ([#49586]). -#### JuliaSyntaxHighlighting - -* A new standard library for applying syntax highlighting to Julia code, this - uses `JuliaSyntax` and `StyledStrings` to implement a `highlight` function - that creates an `AnnotatedString` with syntax highlighting applied. - #### Libdl * A new `LazyLibrary` type is exported from `Libdl` for use in building chained lazy library diff --git a/base/Base.jl b/base/Base.jl index e192fd3f48cf6..438d08e2e01d1 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -604,6 +604,10 @@ function __init__() init_active_project() append!(empty!(_sysimage_modules), keys(loaded_modules)) empty!(explicit_loaded_modules) + @assert isempty(loaded_precompiles) + for (mod, key) in module_keys + loaded_precompiles[key => module_build_id(mod)] = mod + end if haskey(ENV, "JULIA_MAX_NUM_PRECOMPILE_FILES") MAX_NUM_PRECOMPILE_FILES[] = parse(Int, ENV["JULIA_MAX_NUM_PRECOMPILE_FILES"]) end diff --git a/base/array.jl b/base/array.jl index 190b37cc12cf6..d7abb2a757454 100644 --- a/base/array.jl +++ b/base/array.jl @@ -216,7 +216,7 @@ isbitsunion(u::Type) = u isa Union && allocatedinline(u) function _unsetindex!(A::Array, i::Int) @inline @boundscheck checkbounds(A, i) - @inbounds _unsetindex!(GenericMemoryRef(A.ref, i)) + @inbounds _unsetindex!(memoryref(A.ref, i)) return A end @@ -239,14 +239,14 @@ function isassigned(a::Array, i::Int...) @_noub_if_noinbounds_meta @boundscheck checkbounds(Bool, a, i...) || return false ii = _sub2ind(size(a), i...) - return @inbounds isassigned(memoryref(a.ref, ii, false)) + return @inbounds isassigned(memoryrefnew(a.ref, ii, false)) end function isassigned(a::Vector, i::Int) # slight compiler simplification for the most common case @inline @_noub_if_noinbounds_meta @boundscheck checkbounds(Bool, a, i) || return false - return @inbounds isassigned(memoryref(a.ref, i, false)) + return @inbounds isassigned(memoryrefnew(a.ref, i, false)) end @@ -281,7 +281,7 @@ the same manner as C. """ function unsafe_copyto!(dest::Array, doffs, src::Array, soffs, n) n == 0 && return dest - unsafe_copyto!(GenericMemoryRef(dest.ref, doffs), GenericMemoryRef(src.ref, soffs), n) + unsafe_copyto!(memoryref(dest.ref, doffs), memoryref(src.ref, soffs), n) return dest end @@ -303,8 +303,8 @@ function _copyto_impl!(dest::Union{Array,Memory}, doffs::Integer, src::Union{Arr n > 0 || _throw_argerror("Number of elements to copy must be non-negative.") @boundscheck checkbounds(dest, doffs:doffs+n-1) @boundscheck checkbounds(src, soffs:soffs+n-1) - @inbounds let dest = GenericMemoryRef(dest isa Array ? getfield(dest, :ref) : dest, doffs) - src = GenericMemoryRef(src isa Array ? getfield(src, :ref) : src, soffs) + @inbounds let dest = memoryref(dest isa Array ? getfield(dest, :ref) : dest, doffs), + src = memoryref(src isa Array ? getfield(src, :ref) : src, soffs) unsafe_copyto!(dest, src, n) end return dest @@ -348,7 +348,7 @@ copy @_nothrow_meta ref = a.ref newmem = ccall(:jl_genericmemory_copy_slice, Ref{Memory{T}}, (Any, Ptr{Cvoid}, Int), ref.mem, ref.ptr_or_offset, length(a)) - return $(Expr(:new, :(typeof(a)), :(Core.memoryref(newmem)), :(a.size))) + return $(Expr(:new, :(typeof(a)), :(memoryref(newmem)), :(a.size))) end ## Constructors ## @@ -973,21 +973,21 @@ function setindex! end function setindex!(A::Array{T}, x, i::Int) where {T} @_noub_if_noinbounds_meta @boundscheck (i - 1)%UInt < length(A)%UInt || throw_boundserror(A, (i,)) - memoryrefset!(memoryref(A.ref, i, false), x isa T ? x : convert(T,x)::T, :not_atomic, false) + memoryrefset!(memoryrefnew(A.ref, i, false), x isa T ? x : convert(T,x)::T, :not_atomic, false) return A end function setindex!(A::Array{T}, x, i1::Int, i2::Int, I::Int...) where {T} @inline @_noub_if_noinbounds_meta @boundscheck checkbounds(A, i1, i2, I...) # generally _to_linear_index requires bounds checking - memoryrefset!(memoryref(A.ref, _to_linear_index(A, i1, i2, I...), false), x isa T ? x : convert(T,x)::T, :not_atomic, false) + memoryrefset!(memoryrefnew(A.ref, _to_linear_index(A, i1, i2, I...), false), x isa T ? x : convert(T,x)::T, :not_atomic, false) return A end __safe_setindex!(A::Vector{Any}, @nospecialize(x), i::Int) = (@inline; @_nothrow_noub_meta; - memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A) + memoryrefset!(memoryrefnew(A.ref, i, false), x, :not_atomic, false); return A) __safe_setindex!(A::Vector{T}, x::T, i::Int) where {T} = (@inline; @_nothrow_noub_meta; - memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A) + memoryrefset!(memoryrefnew(A.ref, i, false), x, :not_atomic, false); return A) __safe_setindex!(A::Vector{T}, x, i::Int) where {T} = (@inline; __safe_setindex!(A, convert(T, x)::T, i)) @@ -1059,7 +1059,7 @@ function _growbeg!(a::Vector, delta::Integer) setfield!(a, :size, (newlen,)) # if offset is far enough advanced to fit data in existing memory without copying if delta <= offset - 1 - setfield!(a, :ref, @inbounds GenericMemoryRef(ref, 1 - delta)) + setfield!(a, :ref, @inbounds memoryref(ref, 1 - delta)) else @noinline (function() memlen = length(mem) @@ -1078,7 +1078,7 @@ function _growbeg!(a::Vector, delta::Integer) newmem = array_new_memory(mem, newmemlen) end unsafe_copyto!(newmem, newoffset + delta, mem, offset, len) - setfield!(a, :ref, @inbounds GenericMemoryRef(newmem, newoffset)) + setfield!(a, :ref, @inbounds memoryref(newmem, newoffset)) end)() end return @@ -1113,7 +1113,7 @@ function _growend!(a::Vector, delta::Integer) newmem = array_new_memory(mem, newmemlen2) newoffset = offset end - newref = @inbounds GenericMemoryRef(newmem, newoffset) + newref = @inbounds memoryref(newmem, newoffset) unsafe_copyto!(newref, ref, len) setfield!(a, :ref, newref) end)() @@ -1142,7 +1142,7 @@ function _growat!(a::Vector, i::Integer, delta::Integer) prefer_start = i <= div(len, 2) # if offset is far enough advanced to fit data in beginning of the memory if prefer_start && delta <= offset - 1 - newref = @inbounds GenericMemoryRef(mem, offset - delta) + newref = @inbounds memoryref(mem, offset - delta) unsafe_copyto!(newref, ref, i) setfield!(a, :ref, newref) for j in i:i+delta-1 @@ -1159,7 +1159,7 @@ function _growat!(a::Vector, i::Integer, delta::Integer) newmemlen = max(overallocation(memlen), len+2*delta+1) newoffset = (newmemlen - newlen) รท 2 + 1 newmem = array_new_memory(mem, newmemlen) - newref = @inbounds GenericMemoryRef(newmem, newoffset) + newref = @inbounds memoryref(newmem, newoffset) unsafe_copyto!(newref, ref, i-1) unsafe_copyto!(newmem, newoffset + delta + i - 1, mem, offset + i - 1, len - i + 1) setfield!(a, :ref, newref) @@ -1176,7 +1176,7 @@ function _deletebeg!(a::Vector, delta::Integer) end newlen = len - delta if newlen != 0 # if newlen==0 we could accidentally index past the memory - newref = @inbounds GenericMemoryRef(a.ref, delta + 1) + newref = @inbounds memoryref(a.ref, delta + 1) setfield!(a, :ref, newref) end setfield!(a, :size, (newlen,)) @@ -1491,16 +1491,16 @@ function sizehint!(a::Vector, sz::Integer; first::Bool=false, shrink::Bool=true) end newmem = array_new_memory(mem, sz) if first - newref = GenericMemoryRef(newmem, inc + 1) + newref = memoryref(newmem, inc + 1) else - newref = GenericMemoryRef(newmem) + newref = memoryref(newmem) end unsafe_copyto!(newref, ref, len) setfield!(a, :ref, newref) elseif first _growbeg!(a, inc) newref = getfield(a, :ref) - newref = GenericMemoryRef(newref, inc + 1) + newref = memoryref(newref, inc + 1) setfield!(a, :size, (len,)) # undo the size change from _growbeg! setfield!(a, :ref, newref) # undo the offset change from _growbeg! else # last @@ -3075,15 +3075,17 @@ function _wrap(ref::MemoryRef{T}, dims::NTuple{N, Int}) where {T, N} mem_len = length(mem) + 1 - memoryrefoffset(ref) len = Core.checked_dims(dims...) @boundscheck mem_len >= len || invalid_wrap_err(mem_len, dims, len) - if N != 1 && !(ref === GenericMemoryRef(mem) && len === mem_len) + if N != 1 && !(ref === memoryref(mem) && len === mem_len) mem = ccall(:jl_genericmemory_slice, Memory{T}, (Any, Ptr{Cvoid}, Int), mem, ref.ptr_or_offset, len) - ref = MemoryRef(mem) + ref = memoryref(mem) end return ref end -@noinline invalid_wrap_err(len, dims, proddims) = throw(DimensionMismatch( - "Attempted to wrap a MemoryRef of length $len with an Array of size dims=$dims, which is invalid because prod(dims) = $proddims > $len, so that the array would have more elements than the underlying memory can store.")) +@noinline invalid_wrap_err(len, dims, proddims) = throw(DimensionMismatch(LazyString( + "Attempted to wrap a MemoryRef of length ", len, " with an Array of size dims=", dims, + " which is invalid because prod(dims) = ", proddims, " > ", len, + " so that the array would have more elements than the underlying memory can store."))) @eval @propagate_inbounds function wrap(::Type{Array}, m::MemoryRef{T}, dims::NTuple{N, Integer}) where {T, N} dims = convert(Dims, dims) @@ -3093,7 +3095,7 @@ end @eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}, dims::NTuple{N, Integer}) where {T, N} dims = convert(Dims, dims) - ref = _wrap(MemoryRef(m), dims) + ref = _wrap(memoryref(m), dims) $(Expr(:new, :(Array{T, N}), :ref, :dims)) end @eval @propagate_inbounds function wrap(::Type{Array}, m::MemoryRef{T}, l::Integer) where {T} @@ -3103,11 +3105,11 @@ end end @eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}, l::Integer) where {T} dims = (Int(l),) - ref = _wrap(MemoryRef(m), (l,)) + ref = _wrap(memoryref(m), (l,)) $(Expr(:new, :(Array{T, 1}), :ref, :dims)) end @eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}) where {T} - ref = MemoryRef(m) + ref = memoryref(m) dims = (length(m),) $(Expr(:new, :(Array{T, 1}), :ref, :dims)) end diff --git a/base/asyncevent.jl b/base/asyncevent.jl index 3c782be10e194..c6cb3d3fa73bb 100644 --- a/base/asyncevent.jl +++ b/base/asyncevent.jl @@ -127,8 +127,11 @@ function _trywait(t::Union{Timer, AsyncCondition}) t isa Timer || Core.Intrinsics.atomic_fence(:acquire_release) else if !isopen(t) - close(t) # wait for the close to complete - return false + set = t.set + if !set + close(t) # wait for the close to complete + return false + end end iolock_begin() set = t.set @@ -151,7 +154,7 @@ function _trywait(t::Union{Timer, AsyncCondition}) end iolock_end() end - @atomic :monotonic t.set = false + @atomic :monotonic t.set = false # if there are multiple waiters, an unspecified number may short-circuit past here return set end @@ -161,14 +164,14 @@ function wait(t::Union{Timer, AsyncCondition}) end -isopen(t::Union{Timer, AsyncCondition}) = t.isopen && t.handle != C_NULL +isopen(t::Union{Timer, AsyncCondition}) = @atomic :acquire t.isopen function close(t::Union{Timer, AsyncCondition}) - t.handle == C_NULL && return # short-circuit path + t.handle == C_NULL && !t.isopen && return # short-circuit path, :monotonic iolock_begin() if t.handle != C_NULL if t.isopen - @atomic :monotonic t.isopen = false + @atomic :release t.isopen = false ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t) end # implement _trywait here without the auto-reset function, just waiting for the final close signal @@ -186,6 +189,8 @@ function close(t::Union{Timer, AsyncCondition}) unlock(t.cond) unpreserve_handle(t) end + elseif t.isopen + @atomic :release t.isopen = false end iolock_end() nothing @@ -198,8 +203,8 @@ function uvfinalize(t::Union{Timer, AsyncCondition}) if t.handle != C_NULL disassociate_julia_struct(t.handle) # not going to call the usual close hooks anymore if t.isopen - @atomic :monotonic t.isopen = false - ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t.handle) + @atomic :release t.isopen = false + ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t.handle) # this will call Libc.free end @atomic :monotonic t.handle = C_NULL notify(t.cond, false) @@ -214,8 +219,10 @@ end function _uv_hook_close(t::Union{Timer, AsyncCondition}) lock(t.cond) try - @atomic :monotonic t.isopen = false - Libc.free(@atomicswap :monotonic t.handle = C_NULL) + handle = t.handle + @atomic :release t.isopen = false + @atomic :monotonic t.handle = C_NULL + Libc.free(handle) notify(t.cond, false) finally unlock(t.cond) @@ -243,7 +250,7 @@ function uv_timercb(handle::Ptr{Cvoid}) if ccall(:uv_timer_get_repeat, UInt64, (Ptr{Cvoid},), t) == 0 # timer is stopped now if t.isopen - @atomic :monotonic t.isopen = false + @atomic :release t.isopen = false ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t) end end diff --git a/base/boot.jl b/base/boot.jl index e8156b325a843..2e5c3a277262e 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -518,15 +518,12 @@ const undef = UndefInitializer() # empty vector constructor (self::Type{GenericMemory{kind,T,addrspace}})() where {T,kind,addrspace} = self(undef, 0) +memoryref(mem::GenericMemory) = memoryrefnew(mem) +memoryref(mem::GenericMemory, i::Integer) = memoryrefnew(memoryrefnew(mem), Int(i), @_boundscheck) +memoryref(ref::GenericMemoryRef, i::Integer) = memoryrefnew(ref, Int(i), @_boundscheck) GenericMemoryRef(mem::GenericMemory) = memoryref(mem) -GenericMemoryRef(ref::GenericMemoryRef, i::Integer) = memoryref(ref, Int(i), @_boundscheck) -GenericMemoryRef(mem::GenericMemory, i::Integer) = memoryref(memoryref(mem), Int(i), @_boundscheck) -GenericMemoryRef{kind,<:Any,AS}(mem::GenericMemory{kind,<:Any,AS}) where {kind,AS} = memoryref(mem) -GenericMemoryRef{kind,<:Any,AS}(ref::GenericMemoryRef{kind,<:Any,AS}, i::Integer) where {kind,AS} = memoryref(ref, Int(i), @_boundscheck) -GenericMemoryRef{kind,<:Any,AS}(mem::GenericMemory{kind,<:Any,AS}, i::Integer) where {kind,AS} = memoryref(memoryref(mem), Int(i), @_boundscheck) -GenericMemoryRef{kind,T,AS}(mem::GenericMemory{kind,T,AS}) where {kind,T,AS} = memoryref(mem) -GenericMemoryRef{kind,T,AS}(ref::GenericMemoryRef{kind,T,AS}, i::Integer) where {kind,T,AS} = memoryref(ref, Int(i), @_boundscheck) -GenericMemoryRef{kind,T,AS}(mem::GenericMemory{kind,T,AS}, i::Integer) where {kind,T,AS} = memoryref(memoryref(mem), Int(i), @_boundscheck) +GenericMemoryRef(mem::GenericMemory, i::Integer) = memoryref(mem, i) +GenericMemoryRef(mem::GenericMemoryRef, i::Integer) = memoryref(mem, i) const Memory{T} = GenericMemory{:not_atomic, T, CPU} const MemoryRef{T} = GenericMemoryRef{:not_atomic, T, CPU} @@ -634,12 +631,12 @@ module IR export CodeInfo, MethodInstance, CodeInstance, GotoNode, GotoIfNot, ReturnNode, NewvarNode, SSAValue, SlotNumber, Argument, PiNode, PhiNode, PhiCNode, UpsilonNode, LineInfoNode, - Const, PartialStruct, InterConditional, EnterNode + Const, PartialStruct, InterConditional, EnterNode, memoryref using Core: CodeInfo, MethodInstance, CodeInstance, GotoNode, GotoIfNot, ReturnNode, NewvarNode, SSAValue, SlotNumber, Argument, PiNode, PhiNode, PhiCNode, UpsilonNode, LineInfoNode, - Const, PartialStruct, InterConditional, EnterNode + Const, PartialStruct, InterConditional, EnterNode, memoryref end # module IR diff --git a/base/compiler/optimize.jl b/base/compiler/optimize.jl index 7d9e612491415..3e930107b61f1 100644 --- a/base/compiler/optimize.jl +++ b/base/compiler/optimize.jl @@ -677,7 +677,7 @@ function iscall_with_boundscheck(@nospecialize(stmt), sv::PostOptAnalysisState) f === nothing && return false if f === getfield nargs = 4 - elseif f === memoryref || f === memoryrefget || f === memoryref_isassigned + elseif f === memoryrefnew || f === memoryrefget || f === memoryref_isassigned nargs = 4 elseif f === memoryrefset! nargs = 5 diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 6979d1cffe217..8b778b86db8f0 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1095,7 +1095,7 @@ end end @nospecs function _getfield_tfunc(๐•ƒ::AnyMustAliasesLattice, s00, name, setfield::Bool) - return _getfield_tfunc(widenlattice(๐•ƒ), widenmustalias(s00), name, setfield) + return _getfield_tfunc(widenlattice(๐•ƒ), widenmustalias(s00), widenmustalias(name), setfield) end @nospecs function _getfield_tfunc(๐•ƒ::PartialsLattice, s00, name, setfield::Bool) @@ -2074,7 +2074,7 @@ end hasintersect(widenconst(idx), Int) || return Bottom return ref end -add_tfunc(memoryref, 1, 3, memoryref_tfunc, 1) +add_tfunc(memoryrefnew, 1, 3, memoryref_tfunc, 1) @nospecs function memoryrefoffset_tfunc(๐•ƒ::AbstractLattice, mem) hasintersect(widenconst(mem), GenericMemoryRef) || return Bottom @@ -2224,7 +2224,7 @@ end # Query whether the given builtin is guaranteed not to throw given the argtypes @nospecs function _builtin_nothrow(๐•ƒ::AbstractLattice, f, argtypes::Vector{Any}, rt) โŠ‘ = partialorder(๐•ƒ) - if f === memoryref + if f === memoryrefnew return memoryref_builtin_common_nothrow(argtypes) elseif f === memoryrefoffset length(argtypes) == 1 || return false @@ -2348,7 +2348,7 @@ const _EFFECT_FREE_BUILTINS = [ isa, UnionAll, getfield, - memoryref, + memoryrefnew, memoryrefoffset, memoryrefget, memoryref_isassigned, @@ -2383,7 +2383,7 @@ const _INACCESSIBLEMEM_BUILTINS = Any[ ] const _ARGMEM_BUILTINS = Any[ - memoryref, + memoryrefnew, memoryrefoffset, memoryrefget, memoryref_isassigned, @@ -2565,7 +2565,7 @@ function builtin_effects(๐•ƒ::AbstractLattice, @nospecialize(f::Builtin), argty else if contains_is(_CONSISTENT_BUILTINS, f) consistent = ALWAYS_TRUE - elseif f === memoryref || f === memoryrefoffset + elseif f === memoryrefnew || f === memoryrefoffset consistent = ALWAYS_TRUE elseif f === memoryrefget || f === memoryrefset! || f === memoryref_isassigned consistent = CONSISTENT_IF_INACCESSIBLEMEMONLY @@ -2589,7 +2589,7 @@ function builtin_effects(๐•ƒ::AbstractLattice, @nospecialize(f::Builtin), argty else inaccessiblememonly = ALWAYS_FALSE end - if f === memoryref || f === memoryrefget || f === memoryrefset! || f === memoryref_isassigned + if f === memoryrefnew || f === memoryrefget || f === memoryrefset! || f === memoryref_isassigned noub = memoryop_noub(f, argtypes) ? ALWAYS_TRUE : ALWAYS_FALSE else noub = ALWAYS_TRUE @@ -2604,7 +2604,7 @@ function memoryop_noub(@nospecialize(f), argtypes::Vector{Any}) nargs == 0 && return true # must throw and noub lastargtype = argtypes[end] isva = isvarargtype(lastargtype) - if f === memoryref + if f === memoryrefnew if nargs == 1 && !isva return true elseif nargs == 2 && !isva diff --git a/base/deepcopy.jl b/base/deepcopy.jl index 6256773423497..c4f9ae1a6cb10 100644 --- a/base/deepcopy.jl +++ b/base/deepcopy.jl @@ -105,16 +105,16 @@ function _deepcopy_memory_t(@nospecialize(x::Memory), T, stackdict::IdDict) end dest = typeof(x)(undef, length(x)) stackdict[x] = dest - xr = Core.memoryref(x) - dr = Core.memoryref(dest) + xr = memoryref(x) + dr = memoryref(dest) for i = 1:length(x) - xi = Core.memoryref(xr, i, false) + xi = Core.memoryrefnew(xr, i, false) if Core.memoryref_isassigned(xi, :not_atomic, false) xi = Core.memoryrefget(xi, :not_atomic, false) if !isbits(xi) xi = deepcopy_internal(xi, stackdict)::typeof(xi) end - di = Core.memoryref(dr, i, false) + di = Core.memoryrefnew(dr, i, false) Core.memoryrefset!(di, xi, :not_atomic, false) end end @@ -131,9 +131,9 @@ function deepcopy_internal(x::GenericMemoryRef, stackdict::IdDict) return stackdict[x]::typeof(x) end mem = getfield(x, :mem) - dest = GenericMemoryRef(deepcopy_internal(mem, stackdict)::typeof(mem)) + dest = memoryref(deepcopy_internal(mem, stackdict)::typeof(mem)) i = memoryrefoffset(x) - i == 1 || (dest = Core.memoryref(dest, i, true)) + i == 1 || (dest = Core.memoryrefnew(dest, i, true)) return dest end diff --git a/base/docs/basedocs.jl b/base/docs/basedocs.jl index 91c9e44f1913b..1011164d2c959 100644 --- a/base/docs/basedocs.jl +++ b/base/docs/basedocs.jl @@ -1354,7 +1354,11 @@ Usually `begin` will not be necessary, since keywords such as [`function`](@ref) implicitly begin blocks of code. See also [`;`](@ref). `begin` may also be used when indexing to represent the first index of a -collection or the first index of a dimension of an array. +collection or the first index of a dimension of an array. For example, +`a[begin]` is the first element of an array `a`. + +!!! compat "Julia 1.4" + Use of `begin` as an index requires Julia 1.4 or later. # Examples ```jldoctest @@ -1415,8 +1419,20 @@ kw"struct" mutable struct `mutable struct` is similar to [`struct`](@ref), but additionally allows the -fields of the type to be set after construction. See the manual section on -[Composite Types](@ref) for more information. +fields of the type to be set after construction. + +Individual fields of a mutable struct can be marked as `const` to make them immutable: + +```julia +mutable struct Baz + a::Int + const b::Float64 +end +``` +!!! compat "Julia 1.8" + The `const` keyword for fields of mutable structs requires at least Julia 1.8. + +See the manual section on [Composite Types](@ref) for more information. """ kw"mutable struct" @@ -2669,23 +2685,23 @@ julia> Memory{Float64}(undef, 3) Memory{T}(::UndefInitializer, n) """ - MemoryRef(memory) + `memoryref(::GenericMemory)` -Construct a MemoryRef from a memory object. This does not fail, but the -resulting memory may point out-of-bounds if the memory is empty. +Construct a `GenericMemoryRef` from a memory object. This does not fail, but the +resulting memory will point out-of-bounds if and only if the memory is empty. """ -MemoryRef(::Memory) +memoryref(::Memory) """ - MemoryRef(::Memory, index::Integer) - MemoryRef(::MemoryRef, index::Integer) + memoryref(::GenericMemory, index::Integer) + memoryref(::GenericMemoryRef, index::Integer) -Construct a MemoryRef from a memory object and an offset index (1-based) which +Construct a `GenericMemoryRef` from a memory object and an offset index (1-based) which can also be negative. This always returns an inbounds object, and will throw an error if that is not possible (because the index would result in a shift out-of-bounds of the underlying memory). """ -MemoryRef(::Union{Memory,MemoryRef}, ::Integer) +memoryref(::Union{GenericMemory,GenericMemoryRef}, ::Integer) """ Vector{T}(undef, n) diff --git a/base/docs/intrinsicsdocs.jl b/base/docs/intrinsicsdocs.jl index ca06ad678bdbf..c9538ea74ab26 100644 --- a/base/docs/intrinsicsdocs.jl +++ b/base/docs/intrinsicsdocs.jl @@ -23,20 +23,20 @@ The `Core.Intrinsics` module holds the `Core.IntrinsicFunction` objects. Core.Intrinsics """ - Core.memoryref(::GenericMemory) - Core.memoryref(::GenericMemoryRef, index::Int, [boundscheck::Bool]) + Core.memoryrefnew(::GenericMemory) + Core.memoryrefnew(::GenericMemoryRef, index::Int, [boundscheck::Bool]) -Return a `GenericMemoryRef` for a `GenericMemory`. See [`MemoryRef`](@ref). +Return a `GenericMemoryRef` for a `GenericMemory`. See [`memoryref`](@ref). !!! compat "Julia 1.11" This function requires Julia 1.11 or later. """ -Core.memoryref +Core.memoryrefnew """ Core..memoryrefoffset(::GenericMemoryRef) -Return the offset index that was used to construct the `MemoryRef`. See [`Core.memoryref`](@ref). +Return the offset index that was used to construct the `MemoryRef`. See [`memoryref`](@ref). !!! compat "Julia 1.11" This function requires Julia 1.11 or later. diff --git a/base/essentials.jl b/base/essentials.jl index 45f0829da66df..fd2a4af30e51d 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -1,6 +1,6 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -using Core: CodeInfo, SimpleVector, donotdelete, compilerbarrier, memoryref, memoryrefget, memoryrefset! +using Core: CodeInfo, SimpleVector, donotdelete, compilerbarrier, memoryrefnew, memoryrefget, memoryrefset! const Callable = Union{Function,Type} @@ -384,7 +384,7 @@ default_access_order(a::GenericMemoryRef{:not_atomic}) = :not_atomic default_access_order(a::GenericMemoryRef{:atomic}) = :monotonic getindex(A::GenericMemory, i::Int) = (@_noub_if_noinbounds_meta; - memoryrefget(memoryref(memoryref(A), i, @_boundscheck), default_access_order(A), false)) + memoryrefget(memoryrefnew(memoryrefnew(A), i, @_boundscheck), default_access_order(A), false)) getindex(A::GenericMemoryRef) = memoryrefget(A, default_access_order(A), @_boundscheck) function iterate end @@ -902,16 +902,16 @@ end function getindex(A::Array, i::Int) @_noub_if_noinbounds_meta @boundscheck ult_int(bitcast(UInt, sub_int(i, 1)), bitcast(UInt, length(A))) || throw_boundserror(A, (i,)) - memoryrefget(memoryref(getfield(A, :ref), i, false), :not_atomic, false) + memoryrefget(memoryrefnew(getfield(A, :ref), i, false), :not_atomic, false) end # simple Array{Any} operations needed for bootstrap function setindex!(A::Array{Any}, @nospecialize(x), i::Int) @_noub_if_noinbounds_meta @boundscheck ult_int(bitcast(UInt, sub_int(i, 1)), bitcast(UInt, length(A))) || throw_boundserror(A, (i,)) - memoryrefset!(memoryref(getfield(A, :ref), i, false), x, :not_atomic, false) + memoryrefset!(memoryrefnew(getfield(A, :ref), i, false), x, :not_atomic, false) return A end -setindex!(A::Memory{Any}, @nospecialize(x), i::Int) = (memoryrefset!(memoryref(memoryref(A), i, @_boundscheck), x, :not_atomic, @_boundscheck); A) +setindex!(A::Memory{Any}, @nospecialize(x), i::Int) = (memoryrefset!(memoryrefnew(memoryrefnew(A), i, @_boundscheck), x, :not_atomic, @_boundscheck); A) setindex!(A::MemoryRef{T}, x) where {T} = (memoryrefset!(A, convert(T, x), :not_atomic, @_boundscheck); A) setindex!(A::MemoryRef{Any}, @nospecialize(x)) = (memoryrefset!(A, x, :not_atomic, @_boundscheck); A) diff --git a/base/exports.jl b/base/exports.jl index ffbe0dd6830ba..888587b30a0c5 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -549,6 +549,7 @@ export mapfoldl, mapfoldr, mapreduce, + memoryref, merge!, mergewith!, merge, @@ -1079,6 +1080,7 @@ public Checked, Filesystem, Order, + ScopedValues, Sort, # Types diff --git a/base/expr.jl b/base/expr.jl index dc85f3591efa1..f39a46b492d90 100644 --- a/base/expr.jl +++ b/base/expr.jl @@ -855,6 +855,9 @@ while it can not infer the concrete return type of it. Without the `@nospecializeinfer`, `f([1.0])` would infer the return type of `g` as `Float64`, indicating that inference ran for `g(::Vector{Float64})` despite the prohibition on specialized code generation. + +!!! compat "Julia 1.10" + Using `Base.@nospecializeinfer` requires Julia version 1.10. """ macro nospecializeinfer(ex) esc(isa(ex, Expr) ? pushmeta!(ex, :nospecializeinfer) : ex) diff --git a/base/genericmemory.jl b/base/genericmemory.jl index 64a647cdc545a..3e9d230b44459 100644 --- a/base/genericmemory.jl +++ b/base/genericmemory.jl @@ -70,12 +70,12 @@ IndexStyle(::Type{<:GenericMemory}) = IndexLinear() pointer(mem::GenericMemoryRef) = unsafe_convert(Ptr{Cvoid}, mem) # no bounds check, even for empty array -_unsetindex!(A::Memory, i::Int) = (@_propagate_inbounds_meta; _unsetindex!(GenericMemoryRef(A, i)); A) +_unsetindex!(A::Memory, i::Int) = (@_propagate_inbounds_meta; _unsetindex!(memoryref(A, i)); A) function _unsetindex!(A::MemoryRef{T}) where T @_terminates_locally_meta @_propagate_inbounds_meta @inline - @boundscheck GenericMemoryRef(A, 1) + @boundscheck memoryref(A, 1) mem = A.mem MemT = typeof(mem) arrayelem = datatype_arrayelem(MemT) @@ -104,7 +104,7 @@ sizeof(a::GenericMemory) = Core.sizeof(a) function isassigned(a::GenericMemory, i::Int) @inline @boundscheck (i - 1)%UInt < length(a)%UInt || return false - return @inbounds memoryref_isassigned(GenericMemoryRef(a, i), default_access_order(a), false) + return @inbounds memoryref_isassigned(memoryref(a, i), default_access_order(a), false) end isassigned(a::GenericMemoryRef) = memoryref_isassigned(a, default_access_order(a), @_boundscheck) @@ -113,21 +113,21 @@ isassigned(a::GenericMemoryRef) = memoryref_isassigned(a, default_access_order(a function unsafe_copyto!(dest::MemoryRef{T}, src::MemoryRef{T}, n) where {T} @_terminates_globally_notaskstate_meta n == 0 && return dest - @boundscheck GenericMemoryRef(dest, n), GenericMemoryRef(src, n) + @boundscheck memoryref(dest, n), memoryref(src, n) ccall(:jl_genericmemory_copyto, Cvoid, (Any, Ptr{Cvoid}, Any, Ptr{Cvoid}, Int), dest.mem, dest.ptr_or_offset, src.mem, src.ptr_or_offset, Int(n)) return dest end function unsafe_copyto!(dest::GenericMemoryRef, src::GenericMemoryRef, n) n == 0 && return dest - @boundscheck GenericMemoryRef(dest, n), GenericMemoryRef(src, n) + @boundscheck memoryref(dest, n), memoryref(src, n) unsafe_copyto!(dest.mem, memoryrefoffset(dest), src.mem, memoryrefoffset(src), n) return dest end function unsafe_copyto!(dest::Memory{T}, doffs, src::Memory{T}, soffs, n) where{T} n == 0 && return dest - unsafe_copyto!(GenericMemoryRef(dest, doffs), GenericMemoryRef(src, soffs), n) + unsafe_copyto!(memoryref(dest, doffs), memoryref(src, soffs), n) return dest end @@ -160,6 +160,7 @@ end copy(a::T) where {T<:Memory} = ccall(:jl_genericmemory_copy, Ref{T}, (Any,), a) +copyto!(dest::Memory, src::Memory) = copyto!(dest, 1, src, 1, length(src)) function copyto!(dest::Memory, doffs::Integer, src::Memory, soffs::Integer, n::Integer) n < 0 && _throw_argerror("Number of elements to copy must be non-negative.") unsafe_copyto!(dest, doffs, src, soffs, n) @@ -231,7 +232,7 @@ getindex(A::Memory, c::Colon) = copy(A) function setindex!(A::Memory{T}, x, i1::Int) where {T} val = x isa T ? x : convert(T,x)::T - ref = memoryref(memoryref(A), i1, @_boundscheck) + ref = memoryrefnew(memoryref(A), i1, @_boundscheck) memoryrefset!(ref, val, :not_atomic, @_boundscheck) return A end diff --git a/base/iobuffer.jl b/base/iobuffer.jl index 38713908bef9c..fa1a99d3553f8 100644 --- a/base/iobuffer.jl +++ b/base/iobuffer.jl @@ -466,7 +466,7 @@ function take!(io::IOBuffer) if nbytes == 0 || io.reinit data = StringVector(0) elseif io.writable - data = wrap(Array, MemoryRef(io.data, io.offset + 1), nbytes) + data = wrap(Array, memoryref(io.data, io.offset + 1), nbytes) else data = copyto!(StringVector(nbytes), 1, io.data, io.offset + 1, nbytes) end @@ -475,7 +475,7 @@ function take!(io::IOBuffer) if nbytes == 0 data = StringVector(0) elseif io.writable - data = wrap(Array, MemoryRef(io.data, io.ptr), nbytes) + data = wrap(Array, memoryref(io.data, io.ptr), nbytes) else data = read!(io, data) end @@ -503,8 +503,8 @@ Array allocation), as well as omits some checks. """ _unsafe_take!(io::IOBuffer) = wrap(Array, io.size == io.offset ? - MemoryRef(Memory{UInt8}()) : - MemoryRef(io.data, io.offset + 1), + memoryref(Memory{UInt8}()) : + memoryref(io.data, io.offset + 1), io.size - io.offset) function write(to::IO, from::GenericIOBuffer) diff --git a/base/loading.jl b/base/loading.jl index f210d2f67c9ba..30aa182bd95ef 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1176,8 +1176,8 @@ function _include_from_serialized(pkg::PkgId, path::String, ocachepath::Union{No dep = depmods[i] dep isa Module && continue _, depkey, depbuild_id = dep::Tuple{String, PkgId, UInt128} - @assert root_module_exists(depkey) - dep = root_module(depkey) + dep = loaded_precompiles[depkey => depbuild_id] + @assert PkgId(dep) == depkey && module_build_id(dep) === depbuild_id depmods[i] = dep end @@ -1234,7 +1234,8 @@ function register_restored_modules(sv::SimpleVector, pkg::PkgId, path::String) push!(Base.Docs.modules, M) end if parentmodule(M) === M - register_root_module(M) + push!(loaded_modules_order, M) + loaded_precompiles[pkg => module_build_id(M)] = M end end @@ -1654,7 +1655,7 @@ function compilecache_path(pkg::PkgId; if staledeps === true continue end - staledeps, _ = staledeps::Tuple{Vector{Any}, Union{Nothing, String}} + staledeps, _, _ = staledeps::Tuple{Vector{Any}, Union{Nothing, String}, UInt128} # finish checking staledeps module graph for i in 1:length(staledeps) dep = staledeps[i] @@ -1742,23 +1743,20 @@ end # search for a precompile cache file to load, after some various checks function _tryrequire_from_serialized(modkey::PkgId, build_id::UInt128) assert_havelock(require_lock) - if root_module_exists(modkey) - loaded = root_module(modkey) - else - loaded = start_loading(modkey) - if loaded === nothing - try - modpath = locate_package(modkey) - modpath === nothing && return nothing - set_pkgorigin_version_path(modkey, String(modpath)) - loaded = _require_search_from_serialized(modkey, String(modpath), build_id, true) - finally - end_loading(modkey, loaded) - end - if loaded isa Module - insert_extension_triggers(modkey) - run_package_callbacks(modkey) - end + loaded = start_loading(modkey, build_id, false) + if loaded === nothing + try + modpath = locate_package(modkey) + isnothing(modpath) && error("Cannot locate source for $(repr("text/plain", modkey))") + modpath = String(modpath)::String + set_pkgorigin_version_path(modkey, modpath) + loaded = _require_search_from_serialized(modkey, modpath, build_id, true) + finally + end_loading(modkey, loaded) + end + if loaded isa Module + insert_extension_triggers(modkey) + run_package_callbacks(modkey) end end if loaded isa Module && PkgId(loaded) == modkey && module_build_id(loaded) === build_id @@ -1831,10 +1829,12 @@ function _tryrequire_from_serialized(pkg::PkgId, path::String, ocachepath::Union depmods[i] = dep end # then load the file - return _include_from_serialized(pkg, path, ocachepath, depmods, ignore_native) + loaded = _include_from_serialized(pkg, path, ocachepath, depmods, ignore_native) + loaded isa Module && register_root_module(loaded) + return loaded end -# returns `nothing` if require found a precompile cache for this sourcepath, but couldn't load it +# returns `nothing` if require found a precompile cache for this sourcepath, but couldn't load it or it was stale # returns the set of modules restored if the cache load succeeded @constprop :none function _require_search_from_serialized(pkg::PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons=nothing, DEPOT_PATH::typeof(DEPOT_PATH)=DEPOT_PATH) assert_havelock(require_lock) @@ -1846,7 +1846,7 @@ end continue end try - staledeps, ocachefile = staledeps::Tuple{Vector{Any}, Union{Nothing, String}} + staledeps, ocachefile, newbuild_id = staledeps::Tuple{Vector{Any}, Union{Nothing, String}, UInt128} # finish checking staledeps module graph for i in 1:length(staledeps) dep = staledeps[i] @@ -1858,7 +1858,7 @@ end if modstaledeps === true continue end - modstaledeps, modocachepath = modstaledeps::Tuple{Vector{Any}, Union{Nothing, String}} + modstaledeps, modocachepath, _ = modstaledeps::Tuple{Vector{Any}, Union{Nothing, String}, UInt128} staledeps[i] = (modpath, modkey, modbuild_id, modpath_to_try, modstaledeps, modocachepath) @goto check_next_dep end @@ -1866,6 +1866,11 @@ end @goto check_next_path @label check_next_dep end + M = get(loaded_precompiles, pkg => newbuild_id, nothing) + if isa(M, Module) + stalecheck && register_root_module(M) + return M + end if stalecheck try touch(path_to_try) # update timestamp of precompilation file @@ -1874,30 +1879,26 @@ end end end # finish loading module graph into staledeps + # TODO: call all start_loading calls (in reverse order) before calling any _include_from_serialized, since start_loading will drop the loading lock for i in 1:length(staledeps) dep = staledeps[i] dep isa Module && continue modpath, modkey, modbuild_id, modcachepath, modstaledeps, modocachepath = dep::Tuple{String, PkgId, UInt128, String, Vector{Any}, Union{Nothing, String}} - dep = nothing - if root_module_exists(modkey) - dep = root_module(modkey) - end + dep = start_loading(modkey, modbuild_id, stalecheck) while true if dep isa Module if PkgId(dep) == modkey && module_build_id(dep) === modbuild_id break else - if stalecheck - @debug "Rejecting cache file $path_to_try because module $modkey is already loaded and incompatible." - @goto check_next_path - end + @debug "Rejecting cache file $path_to_try because module $modkey got loaded at a different version than expected." + @goto check_next_path end end - dep = start_loading(modkey) if dep === nothing try set_pkgorigin_version_path(modkey, modpath) dep = _include_from_serialized(modkey, modcachepath, modocachepath, modstaledeps) + dep isa Module && stalecheck && register_root_module(dep) finally end_loading(modkey, dep) end @@ -1911,14 +1912,18 @@ end end staledeps[i] = dep end - restored = _include_from_serialized(pkg, path_to_try, ocachefile, staledeps) + restored = get(loaded_precompiles, pkg => newbuild_id, nothing) + if !isa(restored, Module) + restored = _include_from_serialized(pkg, path_to_try, ocachefile, staledeps) + end + isa(restored, Module) && stalecheck && register_root_module(restored) isa(restored, Module) && return restored @debug "Deserialization checks failed while attempting to load cache from $path_to_try" exception=restored @label check_next_path finally for modkey in newdeps insert_extension_triggers(modkey) - run_package_callbacks(modkey) + stalecheck && run_package_callbacks(modkey) end empty!(newdeps) end @@ -1931,12 +1936,22 @@ const package_locks = Dict{PkgId,Pair{Task,Threads.Condition}}() debug_loading_deadlocks::Bool = true # Enable a slightly more expensive, but more complete algorithm that can handle simultaneous tasks. # This only triggers if you have multiple tasks trying to load the same package at the same time, - # so it is unlikely to make a difference normally. -function start_loading(modkey::PkgId) - # handle recursive calls to require + # so it is unlikely to make a performance difference normally. +function start_loading(modkey::PkgId, build_id::UInt128, stalecheck::Bool) + # handle recursive and concurrent calls to require assert_havelock(require_lock) - loading = get(package_locks, modkey, nothing) - if loading !== nothing + while true + loaded = stalecheck ? maybe_root_module(modkey) : nothing + loaded isa Module && return loaded + if build_id != UInt128(0) + loaded = get(loaded_precompiles, modkey => build_id, nothing) + loaded isa Module && return loaded + end + loading = get(package_locks, modkey, nothing) + if loading === nothing + package_locks[modkey] = current_task() => Threads.Condition(require_lock) + return nothing + end # load already in progress for this module on the task task, cond = loading deps = String[modkey.name] @@ -1975,10 +1990,9 @@ function start_loading(modkey::PkgId) end throw(ConcurrencyViolationError(msg)) end - return wait(cond) + loaded = wait(cond) + loaded isa Module && return loaded end - package_locks[modkey] = current_task() => Threads.Condition(require_lock) - return end function end_loading(modkey::PkgId, @nospecialize loaded) @@ -1997,17 +2011,24 @@ const package_callbacks = Any[] const include_callbacks = Any[] # used to optionally track dependencies when requiring a module: -const _concrete_dependencies = Pair{PkgId,UInt128}[] # these dependency versions are "set in stone", and the process should try to avoid invalidating them +const _concrete_dependencies = Pair{PkgId,UInt128}[] # these dependency versions are "set in stone", because they are explicitly loaded, and the process should try to avoid invalidating them const _require_dependencies = Any[] # a list of (mod, abspath, fsize, hash, mtime) tuples that are the file dependencies of the module currently being precompiled const _track_dependencies = Ref(false) # set this to true to track the list of file dependencies -function _include_dependency(mod::Module, _path::AbstractString; track_content=true) +function _include_dependency(mod::Module, _path::AbstractString; track_content=true, + path_may_be_dir=false) prev = source_path(nothing) if prev === nothing path = abspath(_path) else path = normpath(joinpath(dirname(prev), _path)) end - if _track_dependencies[] + if !_track_dependencies[] + if !path_may_be_dir && !isfile(path) + throw(SystemError("opening file $(repr(path))", Libc.ENOENT)) + elseif path_may_be_dir && !Filesystem.isreadable(path) + throw(SystemError("opening file or folder $(repr(path))", Libc.ENOENT)) + end + else @lock require_lock begin if track_content hash = isdir(path) ? _crc32c(join(readdir(path))) : open(_crc32c, path, "r") @@ -2022,22 +2043,23 @@ function _include_dependency(mod::Module, _path::AbstractString; track_content=t end """ - include_dependency(path::AbstractString; track_content::Bool=false) + include_dependency(path::AbstractString; track_content::Bool=true) In a module, declare that the file, directory, or symbolic link specified by `path` -(relative or absolute) is a dependency for precompilation; that is, the module will need -to be recompiled if the modification time `mtime` of `path` changes. -If `track_content=true` recompilation is triggered when the content of `path` changes +(relative or absolute) is a dependency for precompilation; that is, if `track_content=true` +the module will need to be recompiled if the content of `path` changes (if `path` is a directory the content equals `join(readdir(path))`). +If `track_content=false` recompilation is triggered when the modification time `mtime` of `path` changes. This is only needed if your module depends on a path that is not used via [`include`](@ref). It has no effect outside of compilation. !!! compat "Julia 1.11" Keyword argument `track_content` requires at least Julia 1.11. + An error is now thrown if `path` is not readable. """ -function include_dependency(path::AbstractString; track_content::Bool=false) - _include_dependency(Main, path, track_content=track_content) +function include_dependency(path::AbstractString; track_content::Bool=true) + _include_dependency(Main, path, track_content=track_content, path_may_be_dir=true) return nothing end @@ -2066,6 +2088,7 @@ order to throw an error if Julia attempts to precompile it. end # require always works in Main scope and loads files from node 1 +# XXX: (this is deprecated, but still used by Distributed) const toplevel_load = Ref(true) const _require_world_age = Ref{UInt}(typemax(UInt)) @@ -2212,24 +2235,28 @@ end function __require_prelocked(uuidkey::PkgId, env=nothing) assert_havelock(require_lock) - if !root_module_exists(uuidkey) - newm = _require(uuidkey, env) - if newm === nothing - error("package `$(uuidkey.name)` did not define the expected \ - module `$(uuidkey.name)`, check for typos in package module name") + m = start_loading(uuidkey, UInt128(0), true) + if m === nothing + last = toplevel_load[] + try + toplevel_load[] = false + m = _require(uuidkey, env) + if m === nothing + error("package `$(uuidkey.name)` did not define the expected \ + module `$(uuidkey.name)`, check for typos in package module name") + end + finally + toplevel_load[] = last + end_loading(uuidkey, m) end insert_extension_triggers(uuidkey) # After successfully loading, notify downstream consumers run_package_callbacks(uuidkey) - else - m = get(loaded_modules, uuidkey, nothing) - if m !== nothing && !haskey(explicit_loaded_modules, uuidkey) - explicit_loaded_modules[uuidkey] = m - run_package_callbacks(uuidkey) - end - newm = root_module(uuidkey) + elseif !haskey(explicit_loaded_modules, uuidkey) + explicit_loaded_modules[uuidkey] = m + run_package_callbacks(uuidkey) end - return newm + return m end mutable struct PkgOrigin @@ -2240,15 +2267,20 @@ end PkgOrigin() = PkgOrigin(nothing, nothing, nothing) const pkgorigins = Dict{PkgId,PkgOrigin}() -const loaded_modules = Dict{PkgId,Module}() -# Emptied on Julia start -const explicit_loaded_modules = Dict{PkgId,Module}() +const explicit_loaded_modules = Dict{PkgId,Module}() # Emptied on Julia start +const loaded_modules = Dict{PkgId,Module}() # available to be explicitly loaded +const loaded_precompiles = Dict{Pair{PkgId,UInt128},Module}() # extended (complete) list of modules, available to be loaded const loaded_modules_order = Vector{Module}() -const module_keys = IdDict{Module,PkgId}() # the reverse +const module_keys = IdDict{Module,PkgId}() # the reverse of loaded_modules is_root_module(m::Module) = @lock require_lock haskey(module_keys, m) root_module_key(m::Module) = @lock require_lock module_keys[m] +function module_build_id(m::Module) + hi, lo = ccall(:jl_module_build_id, NTuple{2,UInt64}, (Any,), m) + return (UInt128(hi) << 64) | lo +end + @constprop :none function register_root_module(m::Module) # n.b. This is called from C after creating a new module in `Base.__toplevel__`, # instead of adding them to the binding table there. @@ -2264,7 +2296,7 @@ root_module_key(m::Module) = @lock require_lock module_keys[m] end end end - push!(loaded_modules_order, m) + haskey(loaded_precompiles, key => module_build_id(m)) || push!(loaded_modules_order, m) loaded_modules[key] = m explicit_loaded_modules[key] = m module_keys[m] = key @@ -2295,7 +2327,12 @@ maybe_root_module(key::PkgId) = @lock require_lock get(loaded_modules, key, noth root_module_exists(key::PkgId) = @lock require_lock haskey(loaded_modules, key) loaded_modules_array() = @lock require_lock copy(loaded_modules_order) +# after unreference_module, a subsequent require call will try to load a new copy of it, if stale +# reload(m) = (unreference_module(m); require(m)) function unreference_module(key::PkgId) + if haskey(explicit_loaded_modules, key) + m = pop!(explicit_loaded_modules, key) + end if haskey(loaded_modules, key) m = pop!(loaded_modules, key) # need to ensure all modules are GC rooted; will still be referenced @@ -2322,125 +2359,115 @@ disable_parallel_precompile::Bool = false # Returns `nothing` or the new(ish) module function _require(pkg::PkgId, env=nothing) assert_havelock(require_lock) - loaded = start_loading(pkg) - loaded === nothing || return loaded - last = toplevel_load[] - try - toplevel_load[] = false - # perform the search operation to select the module file require intends to load - path = locate_package(pkg, env) - if path === nothing - throw(ArgumentError(""" - Package $(repr("text/plain", pkg)) is required but does not seem to be installed: - - Run `Pkg.instantiate()` to install all recorded dependencies. - """)) - end - set_pkgorigin_version_path(pkg, path) - - parallel_precompile_attempted = false # being safe to avoid getting stuck in a precompilepkgs loop - reasons = Dict{String,Int}() - # attempt to load the module file via the precompile cache locations - if JLOptions().use_compiled_modules != 0 - @label load_from_cache - m = _require_search_from_serialized(pkg, path, UInt128(0), true; reasons) - if m isa Module - return m - end - end - - if JLOptions().use_compiled_modules == 3 - error("Precompiled image $pkg not available with flags $(CacheFlags())") - end - - # if the module being required was supposed to have a particular version - # but it was not handled by the precompile loader, complain - for (concrete_pkg, concrete_build_id) in _concrete_dependencies - if pkg == concrete_pkg - @warn """Module $(pkg.name) with build ID $((UUID(concrete_build_id))) is missing from the cache. - This may mean $(repr("text/plain", pkg)) does not support precompilation but is imported by a module that does.""" - if JLOptions().incremental != 0 - # during incremental precompilation, this should be fail-fast - throw(PrecompilableError()) - end + # perform the search operation to select the module file require intends to load + path = locate_package(pkg, env) + if path === nothing + throw(ArgumentError(""" + Package $(repr("text/plain", pkg)) is required but does not seem to be installed: + - Run `Pkg.instantiate()` to install all recorded dependencies. + """)) + end + set_pkgorigin_version_path(pkg, path) + + parallel_precompile_attempted = false # being safe to avoid getting stuck in a precompilepkgs loop + reasons = Dict{String,Int}() + # attempt to load the module file via the precompile cache locations + if JLOptions().use_compiled_modules != 0 + @label load_from_cache + loaded = _require_search_from_serialized(pkg, path, UInt128(0), true; reasons) + if loaded isa Module + return loaded + end + end + + if JLOptions().use_compiled_modules == 3 + error("Precompiled image $pkg not available with flags $(CacheFlags())") + end + + # if the module being required was supposed to have a particular version + # but it was not handled by the precompile loader, complain + for (concrete_pkg, concrete_build_id) in _concrete_dependencies + if pkg == concrete_pkg + @warn """Module $(pkg.name) with build ID $((UUID(concrete_build_id))) is missing from the cache. + This may mean $(repr("text/plain", pkg)) does not support precompilation but is imported by a module that does.""" + if JLOptions().incremental != 0 + # during incremental precompilation, this should be fail-fast + throw(PrecompilableError()) end end + end - if JLOptions().use_compiled_modules == 1 - if !generating_output(#=incremental=#false) - project = active_project() - if !generating_output() && !parallel_precompile_attempted && !disable_parallel_precompile && @isdefined(Precompilation) && project !== nothing && - isfile(project) && project_file_manifest_path(project) !== nothing - parallel_precompile_attempted = true - unlock(require_lock) - try - Precompilation.precompilepkgs([pkg.name]; _from_loading=true) - finally - lock(require_lock) - end - @goto load_from_cache - end - # spawn off a new incremental pre-compile task for recursive `require` calls - cachefile_or_module = maybe_cachefile_lock(pkg, path) do - # double-check now that we have lock - m = _require_search_from_serialized(pkg, path, UInt128(0), true) - m isa Module && return m - compilecache(pkg, path; reasons) + if JLOptions().use_compiled_modules == 1 + if !generating_output(#=incremental=#false) + project = active_project() + if !generating_output() && !parallel_precompile_attempted && !disable_parallel_precompile && @isdefined(Precompilation) && project !== nothing && + isfile(project) && project_file_manifest_path(project) !== nothing + parallel_precompile_attempted = true + unlock(require_lock) + try + Precompilation.precompilepkgs([pkg.name]; _from_loading=true) + finally + lock(require_lock) end - cachefile_or_module isa Module && return cachefile_or_module::Module - cachefile = cachefile_or_module - if isnothing(cachefile) # maybe_cachefile_lock returns nothing if it had to wait for another process - @goto load_from_cache # the new cachefile will have the newest mtime so will come first in the search - elseif isa(cachefile, Exception) - if precompilableerror(cachefile) - verbosity = isinteractive() ? CoreLogging.Info : CoreLogging.Debug - @logmsg verbosity "Skipping precompilation due to precompilable error. Importing $(repr("text/plain", pkg))." exception=m - else - @warn "The call to compilecache failed to create a usable precompiled cache file for $(repr("text/plain", pkg))" exception=m - end - # fall-through to loading the file locally if not incremental + @goto load_from_cache + end + # spawn off a new incremental pre-compile task for recursive `require` calls + loaded = maybe_cachefile_lock(pkg, path) do + # double-check the search now that we have lock + m = _require_search_from_serialized(pkg, path, UInt128(0), true) + m isa Module && return m + return compilecache(pkg, path; reasons) + end + loaded isa Module && return loaded + if isnothing(loaded) # maybe_cachefile_lock returns nothing if it had to wait for another process + @goto load_from_cache # the new cachefile will have the newest mtime so will come first in the search + elseif isa(loaded, Exception) + if precompilableerror(loaded) + verbosity = isinteractive() ? CoreLogging.Info : CoreLogging.Debug + @logmsg verbosity "Skipping precompilation due to precompilable error. Importing $(repr("text/plain", pkg))." exception=loaded else - cachefile, ocachefile = cachefile::Tuple{String, Union{Nothing, String}} - m = _tryrequire_from_serialized(pkg, cachefile, ocachefile) - if !isa(m, Module) - @warn "The call to compilecache failed to create a usable precompiled cache file for $(repr("text/plain", pkg))" exception=m - else - return m - end + @warn "The call to compilecache failed to create a usable precompiled cache file for $(repr("text/plain", pkg))" exception=loaded end - if JLOptions().incremental != 0 - # during incremental precompilation, this should be fail-fast - throw(PrecompilableError()) + # fall-through to loading the file locally if not incremental + else + cachefile, ocachefile = loaded::Tuple{String, Union{Nothing, String}} + loaded = _tryrequire_from_serialized(pkg, cachefile, ocachefile) + if !isa(loaded, Module) + @warn "The call to compilecache failed to create a usable precompiled cache file for $(repr("text/plain", pkg))" exception=loaded + else + return loaded end end + if JLOptions().incremental != 0 + # during incremental precompilation, this should be fail-fast + throw(PrecompilableError()) + end end + end - # just load the file normally via include - # for unknown dependencies - uuid = pkg.uuid - uuid = (uuid === nothing ? (UInt64(0), UInt64(0)) : convert(NTuple{2, UInt64}, uuid)) - old_uuid = ccall(:jl_module_uuid, NTuple{2, UInt64}, (Any,), __toplevel__) + # just load the file normally via include + # for unknown dependencies + uuid = pkg.uuid + uuid = (uuid === nothing ? (UInt64(0), UInt64(0)) : convert(NTuple{2, UInt64}, uuid)) + old_uuid = ccall(:jl_module_uuid, NTuple{2, UInt64}, (Any,), __toplevel__) + if uuid !== old_uuid + ccall(:jl_set_module_uuid, Cvoid, (Any, NTuple{2, UInt64}), __toplevel__, uuid) + end + unlock(require_lock) + try + include(__toplevel__, path) + loaded = get(loaded_modules, pkg, nothing) + finally + lock(require_lock) if uuid !== old_uuid - ccall(:jl_set_module_uuid, Cvoid, (Any, NTuple{2, UInt64}), __toplevel__, uuid) - end - unlock(require_lock) - try - include(__toplevel__, path) - loaded = get(loaded_modules, pkg, nothing) - finally - lock(require_lock) - if uuid !== old_uuid - ccall(:jl_set_module_uuid, Cvoid, (Any, NTuple{2, UInt64}), __toplevel__, old_uuid) - end + ccall(:jl_set_module_uuid, Cvoid, (Any, NTuple{2, UInt64}), __toplevel__, old_uuid) end - finally - toplevel_load[] = last - end_loading(pkg, loaded) end return loaded end -# load a serialized file directly +# load a serialized file directly, including dependencies (without checking staleness except for immediate conflicts) function _require_from_serialized(uuidkey::PkgId, path::String, ocachepath::Union{String, Nothing}, sourcepath::String) @lock require_lock begin set_pkgorigin_version_path(uuidkey, sourcepath) @@ -2458,8 +2485,9 @@ function require_stdlib(package_uuidkey::PkgId, ext::Union{Nothing, String}=noth @lock require_lock begin # the PkgId of the ext, or package if not an ext this_uuidkey = ext isa String ? PkgId(uuid5(package_uuidkey.uuid, ext), ext) : package_uuidkey - if root_module_exists(this_uuidkey) - return loaded_modules[this_uuidkey] + newm = maybe_root_module(this_uuidkey) + if newm isa Module + return newm end # first since this is a stdlib, try to look there directly first env = Sys.STDLIB @@ -2486,7 +2514,7 @@ function require_stdlib(package_uuidkey::PkgId, ext::Union{Nothing, String}=noth #end set_pkgorigin_version_path(this_uuidkey, sourcepath) depot_path = append_bundled_depot_path!(empty(DEPOT_PATH)) - newm = start_loading(this_uuidkey) + newm = start_loading(this_uuidkey, UInt128(0), true) newm === nothing || return newm try newm = _require_search_from_serialized(this_uuidkey, sourcepath, UInt128(0), false; DEPOT_PATH=depot_path) @@ -2874,13 +2902,15 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in cachepath = compilecache_dir(pkg) # build up the list of modules that we want the precompile process to preserve - concrete_deps = copy(_concrete_dependencies) if keep_loaded_modules - for mod in loaded_modules_array() - if !(mod === Main || mod === Core || mod === Base) - push!(concrete_deps, PkgId(mod) => module_build_id(mod)) + concrete_deps = copy(_concrete_dependencies) + for (pkgreq, modreq) in loaded_modules # TODO: convert all relevant staleness heuristics to use explicit_loaded_modules instead + if !(pkgreq === Main || pkgreq === Core || pkgreq === Base) + push!(concrete_deps, pkgreq => module_build_id(modreq)) end end + else + concrete_deps = empty(_concrete_dependencies) end # run the expression and cache the result verbosity = isinteractive() ? CoreLogging.Info : CoreLogging.Debug @@ -3003,11 +3033,6 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in end end -function module_build_id(m::Module) - hi, lo = ccall(:jl_module_build_id, NTuple{2,UInt64}, (Any,), m) - return (UInt128(hi) << 64) | lo -end - function isvalid_cache_header(f::IOStream) pkgimage = Ref{UInt8}() checksum = ccall(:jl_read_verify_header, UInt64, (Ptr{Cvoid}, Ptr{UInt8}, Ptr{Int64}, Ptr{Int64}), f.ios, pkgimage, Ref{Int64}(), Ref{Int64}()) # returns checksum id or zero @@ -3560,7 +3585,7 @@ end @constprop :none function stale_cachefile(modkey::PkgId, build_id::UInt128, modpath::String, cachefile::String; ignore_loaded::Bool=false, requested_flags::CacheFlags=CacheFlags(), reasons::Union{Dict{String,Int},Nothing}=nothing, stalecheck::Bool=true) - # XXX: this function appears to dl all of the file validation, not just those checks related to stale + # n.b.: this function does nearly all of the file validation, not just those checks related to stale, so the name is potentially unclear io = open(cachefile, "r") try checksum = isvalid_cache_header(io) @@ -3614,8 +3639,8 @@ end record_reason(reasons, "for different pkgid") return true end + id_build = (UInt128(checksum) << 64) | id.second if build_id != UInt128(0) - id_build = (UInt128(checksum) << 64) | id.second if id_build != build_id @debug "Ignoring cache file $cachefile for $modkey ($((UUID(id_build)))) since it does not provide desired build_id ($((UUID(build_id))))" record_reason(reasons, "for different buildid") @@ -3630,8 +3655,12 @@ end depmods = Vector{Any}(undef, ndeps) for i in 1:ndeps req_key, req_build_id = required_modules[i] - # Module is already loaded - if root_module_exists(req_key) + # Check if module is already loaded + if !stalecheck && haskey(loaded_precompiles, req_key => req_build_id) + M = loaded_precompiles[req_key => req_build_id] + @assert PkgId(M) == req_key && module_build_id(M) === req_build_id + depmods[i] = M + elseif root_module_exists(req_key) M = root_module(req_key) if PkgId(M) == req_key && module_build_id(M) === req_build_id depmods[i] = M @@ -3662,17 +3691,19 @@ end # check if this file is going to provide one of our concrete dependencies # or if it provides a version that conflicts with our concrete dependencies # or neither - for (req_key, req_build_id) in _concrete_dependencies - build_id = get(modules, req_key, UInt64(0)) - if build_id !== UInt64(0) - build_id |= UInt128(checksum) << 64 - if build_id === req_build_id - stalecheck = false - break + if stalecheck + for (req_key, req_build_id) in _concrete_dependencies + build_id = get(modules, req_key, UInt64(0)) + if build_id !== UInt64(0) + build_id |= UInt128(checksum) << 64 + if build_id === req_build_id + stalecheck = false + break + end + @debug "Rejecting cache file $cachefile because it provides the wrong build_id (got $((UUID(build_id)))) for $req_key (want $(UUID(req_build_id)))" + record_reason(reasons, "wrong dep buildid") + return true # cachefile doesn't provide the required version of the dependency end - @debug "Rejecting cache file $cachefile because it provides the wrong build_id (got $((UUID(build_id)))) for $req_key (want $(UUID(req_build_id)))" - record_reason(reasons, "wrong dep buildid") - return true # cachefile doesn't provide the required version of the dependency end end @@ -3760,7 +3791,7 @@ end return true end - return depmods, ocachefile # fresh cachefile + return depmods, ocachefile, id_build # fresh cachefile finally close(io) end diff --git a/base/reshapedarray.jl b/base/reshapedarray.jl index 63e508e8835de..c7ae1e3a25cd1 100644 --- a/base/reshapedarray.jl +++ b/base/reshapedarray.jl @@ -51,9 +51,9 @@ eltype(::Type{<:ReshapedArrayIterator{I}}) where {I} = @isdefined(I) ? ReshapedI ref = a.ref if M == 1 && N !== 1 mem = ref.mem::Memory{T} - if !(ref === GenericMemoryRef(mem) && len === mem.length) + if !(ref === memoryref(mem) && len === mem.length) mem = ccall(:jl_genericmemory_slice, Memory{T}, (Any, Ptr{Cvoid}, Int), mem, ref.ptr_or_offset, len) - ref = GenericMemoryRef(mem)::typeof(ref) + ref = memoryref(mem)::typeof(ref) end end # or we could use `a = Array{T,N}(undef, ntuple(0, Val(N))); a.ref = ref; a.size = dims; return a` here diff --git a/base/strings/annotated.jl b/base/strings/annotated.jl index 4f2caa107b5f1..69b04202edbf6 100644 --- a/base/strings/annotated.jl +++ b/base/strings/annotated.jl @@ -593,6 +593,7 @@ function _insert_annotations!(io::AnnotatedIOBuffer, annotations::Vector{Tuple{U for i in reverse(axes(annotations, 1)) annot = annotations[i] first(first(annot)) == 1 || continue + i <= length(io.annotations) || continue if last(annot) == last(last(io.annotations)) valid_run = true for runlen in 1:i diff --git a/base/strings/io.jl b/base/strings/io.jl index 94b5a1e4e4614..3f8f531ae6ec4 100644 --- a/base/strings/io.jl +++ b/base/strings/io.jl @@ -116,7 +116,7 @@ function sprint(f::Function, args...; context=nothing, sizehint::Integer=0) String(_unsafe_take!(s)) end -function _str_sizehint(x) +function _str_sizehint(@nospecialize x) if x isa Float64 return 20 elseif x isa Float32 diff --git a/base/strings/string.jl b/base/strings/string.jl index b2afce897a937..98e4a50ffa970 100644 --- a/base/strings/string.jl +++ b/base/strings/string.jl @@ -81,7 +81,7 @@ function String(v::Vector{UInt8}) end # optimized empty!(v); sizehint!(v, 0) calls setfield!(v, :size, (0,)) - setfield!(v, :ref, MemoryRef(Memory{UInt8}())) + setfield!(v, :ref, memoryref(Memory{UInt8}())) return str end diff --git a/base/threadingconstructs.jl b/base/threadingconstructs.jl index 56d596958bc7e..4a0faff3b6bff 100644 --- a/base/threadingconstructs.jl +++ b/base/threadingconstructs.jl @@ -67,7 +67,7 @@ function _tpid_to_sym(tpid::Int8) elseif tpid == -1 return :foreign else - throw(ArgumentError("Unrecognized threadpool id $tpid")) + throw(ArgumentError(LazyString("Unrecognized threadpool id ", tpid))) end end @@ -79,7 +79,7 @@ function _sym_to_tpid(tp::Symbol) elseif tp == :foreign return Int8(-1) else - throw(ArgumentError("Unrecognized threadpool name `$(repr(tp))`")) + throw(ArgumentError(LazyString("Unrecognized threadpool name `", tp, "`"))) end end @@ -462,7 +462,7 @@ macro spawn(args...) if ttype isa QuoteNode ttype = ttype.value if ttype !== :interactive && ttype !== :default - throw(ArgumentError("unsupported threadpool in @spawn: $ttype")) + throw(ArgumentError(LazyString("unsupported threadpool in @spawn: ", ttype))) end tp = QuoteNode(ttype) else diff --git a/deps/blastrampoline.version b/deps/blastrampoline.version index 616300377e3e6..871053db3c9f2 100644 --- a/deps/blastrampoline.version +++ b/deps/blastrampoline.version @@ -2,6 +2,6 @@ BLASTRAMPOLINE_JLL_NAME := libblastrampoline ## source build -BLASTRAMPOLINE_VER := 5.8.0 -BLASTRAMPOLINE_BRANCH=v5.8.0 -BLASTRAMPOLINE_SHA1=81316155d4838392e8462a92bcac3eebe9acd0c7 +BLASTRAMPOLINE_VER := 5.10.1 +BLASTRAMPOLINE_BRANCH=v5.10.1 +BLASTRAMPOLINE_SHA1=ff05ebb4e450deda0aebe8dce4d4f054e23fecfc diff --git a/deps/checksums/JuliaSyntaxHighlighting-4110caaf4fcdf0c614fd3ecd7c5bf589ca82ac63.tar.gz/md5 b/deps/checksums/JuliaSyntaxHighlighting-4110caaf4fcdf0c614fd3ecd7c5bf589ca82ac63.tar.gz/md5 deleted file mode 100644 index 5e99f7453cfe2..0000000000000 --- a/deps/checksums/JuliaSyntaxHighlighting-4110caaf4fcdf0c614fd3ecd7c5bf589ca82ac63.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -08230d0801fda3c81927d558452215e4 diff --git a/deps/checksums/JuliaSyntaxHighlighting-4110caaf4fcdf0c614fd3ecd7c5bf589ca82ac63.tar.gz/sha512 b/deps/checksums/JuliaSyntaxHighlighting-4110caaf4fcdf0c614fd3ecd7c5bf589ca82ac63.tar.gz/sha512 deleted file mode 100644 index 16d15cdef3104..0000000000000 --- a/deps/checksums/JuliaSyntaxHighlighting-4110caaf4fcdf0c614fd3ecd7c5bf589ca82ac63.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -0386841dcf30ee53f7f95dd3206e1208482507d157aa09739873de2a56e5ca3d7bbf27eccd9f4ed81c1c0fea229673475f6454fe94df0ff960563ca4c29ed36c diff --git a/deps/checksums/Pkg-280f702c1ace34b51cd4551ed448b19516c36849.tar.gz/md5 b/deps/checksums/Pkg-280f702c1ace34b51cd4551ed448b19516c36849.tar.gz/md5 deleted file mode 100644 index 4abb92bd80663..0000000000000 --- a/deps/checksums/Pkg-280f702c1ace34b51cd4551ed448b19516c36849.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -abc7137d1f7e982957a605d3290f9e12 diff --git a/deps/checksums/Pkg-280f702c1ace34b51cd4551ed448b19516c36849.tar.gz/sha512 b/deps/checksums/Pkg-280f702c1ace34b51cd4551ed448b19516c36849.tar.gz/sha512 deleted file mode 100644 index 90c5e7cf45e19..0000000000000 --- a/deps/checksums/Pkg-280f702c1ace34b51cd4551ed448b19516c36849.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -3dd9b0cf67a2846b23af0c666e4f4780a0dbc7348fa7d0689c2dccbe462a3b06240e3116b8e1c5c89747858d4c72370e0b3823ce635a09144901f338d74cc7fd diff --git a/deps/checksums/Pkg-8457d3eff518f75bbff2d8b183e66e44ae5c47f1.tar.gz/md5 b/deps/checksums/Pkg-8457d3eff518f75bbff2d8b183e66e44ae5c47f1.tar.gz/md5 new file mode 100644 index 0000000000000..d7b567d238603 --- /dev/null +++ b/deps/checksums/Pkg-8457d3eff518f75bbff2d8b183e66e44ae5c47f1.tar.gz/md5 @@ -0,0 +1 @@ +493a4e2e5f8f0e9a0f7b212d9090c4d3 diff --git a/deps/checksums/Pkg-8457d3eff518f75bbff2d8b183e66e44ae5c47f1.tar.gz/sha512 b/deps/checksums/Pkg-8457d3eff518f75bbff2d8b183e66e44ae5c47f1.tar.gz/sha512 new file mode 100644 index 0000000000000..3219baba7b6ef --- /dev/null +++ b/deps/checksums/Pkg-8457d3eff518f75bbff2d8b183e66e44ae5c47f1.tar.gz/sha512 @@ -0,0 +1 @@ +4940684b63729357560aec6268049142b89fe36fab9426d978f486340f2de33abfb2a2b5b7f3692c973e303527b685dda42f16e634cf57549dced7889e3a6ff8 diff --git a/deps/checksums/SuiteSparse-e8285dd13a6d5b5cf52d8124793fc4d622d07554.tar.gz/md5 b/deps/checksums/SuiteSparse-e8285dd13a6d5b5cf52d8124793fc4d622d07554.tar.gz/md5 deleted file mode 100644 index 2f81a0d9191b5..0000000000000 --- a/deps/checksums/SuiteSparse-e8285dd13a6d5b5cf52d8124793fc4d622d07554.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -46541001073d1c3c85e18d910f8308f3 diff --git a/deps/checksums/SuiteSparse-e8285dd13a6d5b5cf52d8124793fc4d622d07554.tar.gz/sha512 b/deps/checksums/SuiteSparse-e8285dd13a6d5b5cf52d8124793fc4d622d07554.tar.gz/sha512 deleted file mode 100644 index e2eb44845e276..0000000000000 --- a/deps/checksums/SuiteSparse-e8285dd13a6d5b5cf52d8124793fc4d622d07554.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -f7470a447b934ca9315e216a07b97e363f11bc93186f9aa057b20b2d05092c58ae4f1b733de362de4a0730861c00be4ca5588d0b3ba65f018c1798b9122b9672 diff --git a/deps/checksums/blastrampoline b/deps/checksums/blastrampoline index d72a584fd1b0c..b8c4c68c661ba 100644 --- a/deps/checksums/blastrampoline +++ b/deps/checksums/blastrampoline @@ -1,34 +1,34 @@ -blastrampoline-81316155d4838392e8462a92bcac3eebe9acd0c7.tar.gz/md5/0478361eac783b99002b1ad985182f05 -blastrampoline-81316155d4838392e8462a92bcac3eebe9acd0c7.tar.gz/sha512/2489ce5770a9861889a2d07e61440ba4f233a92efd4a3544747f83320e0e7a229a8fe01553d99f5f1d98713316f2506daf0adb7d024a46e32b3de1bb2966d637 -libblastrampoline.v5.8.0+1.aarch64-apple-darwin.tar.gz/md5/a28837b9838fef2b3831de3278ec7949 -libblastrampoline.v5.8.0+1.aarch64-apple-darwin.tar.gz/sha512/111ac2fe5f8f8102f2f7c9e9e6aa1d1a12d2db941238c949ff8e64b30335e8b2f6ecce0d5f577879c231eb839c06e259302b709f3d34e94a97047bfa984222f6 -libblastrampoline.v5.8.0+1.aarch64-linux-gnu.tar.gz/md5/9e781a026e03118df81347fb90f10d45 -libblastrampoline.v5.8.0+1.aarch64-linux-gnu.tar.gz/sha512/89469f32a666efd46437351a8fb16758c35e5aecc563d202b480c10ddf9fa5350a5a321076b79b0a1a07ec2cea0b73aa5c28979cc382a198fa96cca0b5899d25 -libblastrampoline.v5.8.0+1.aarch64-linux-musl.tar.gz/md5/b7acda2fdd157bbb183d0dd33643beef -libblastrampoline.v5.8.0+1.aarch64-linux-musl.tar.gz/sha512/cf4125a47334fe2ec0d5a4b11624b12e1366ec031500218f680ad5a53152b9d752c0c02a0b92d0e07f3eb21f2f8f58d0c587438a4869a72197bbd5e91531369d -libblastrampoline.v5.8.0+1.armv6l-linux-gnueabihf.tar.gz/md5/eafabd99fb1287d495acb8efb8091fde -libblastrampoline.v5.8.0+1.armv6l-linux-gnueabihf.tar.gz/sha512/63ff4e6bc400fa8ee713a1c5ae4af0a8e152d49860c6f5e94a17e426ad9f780d41cc0f84d33c75ea5347af1a53f07fc012798d603b6a94ea39f37cfd651a0719 -libblastrampoline.v5.8.0+1.armv6l-linux-musleabihf.tar.gz/md5/9788f74b375ef6b84c16c080f2be5bdd -libblastrampoline.v5.8.0+1.armv6l-linux-musleabihf.tar.gz/sha512/f00ebf794927404e2294a2fbb759b1e3e57836c7f683525fac0b2ac570da2c75904e43f154cf76fce310a624f9b35fbd40e6c7757882bb6f30db790f4221a543 -libblastrampoline.v5.8.0+1.armv7l-linux-gnueabihf.tar.gz/md5/4492bace63d8274d68ecdaa735e47e99 -libblastrampoline.v5.8.0+1.armv7l-linux-gnueabihf.tar.gz/sha512/8868283e6c5224b80145fdfd17f13f713053ba94e49c170f38f0cbf9f794185d7dec9c107ce65dc76121d3ac5b21d2f3857f619d8279bede86a906230ff59a71 -libblastrampoline.v5.8.0+1.armv7l-linux-musleabihf.tar.gz/md5/d66b6ed1d4e5f6a130f36791063e651d -libblastrampoline.v5.8.0+1.armv7l-linux-musleabihf.tar.gz/sha512/414ad07574a6e9aa670bbfea13eaea11da13129c9ccb4193cad708014c31493ff10ff427558b90cb16040fa64c8a325c2e375e3310c39fb37bb3e7fdb6a72a5f -libblastrampoline.v5.8.0+1.i686-linux-gnu.tar.gz/md5/595199a3a01174cfa4d9ce3407bf30dc -libblastrampoline.v5.8.0+1.i686-linux-gnu.tar.gz/sha512/02c3b0c3c0a411d5090a081f3bbbe38aaae40eaa5fe63d0690e0582e233cd9ce76483922557d4f65dc457e29a4e84d86ee5af20a60b082aec7bec4ca8607c1ca -libblastrampoline.v5.8.0+1.i686-linux-musl.tar.gz/md5/5832d0044842cb84f4e1e1b0a04b8205 -libblastrampoline.v5.8.0+1.i686-linux-musl.tar.gz/sha512/d28954d0feef6a33fa0bfeb59acb68821222d36a4e353eaf41936ee2c9aace719c2d0f0b0f080eafe2baecc67a29de4cacc0446aac776bbb615c4426d35c9c8f -libblastrampoline.v5.8.0+1.i686-w64-mingw32.tar.gz/md5/46391ac222980a0ad2c2d6d2b54db26d -libblastrampoline.v5.8.0+1.i686-w64-mingw32.tar.gz/sha512/6dd3434648a297639ef327efa5827d6aea70df551774e52ba395cdf187bfb603d365eed84780913fda5f3d12512ac54ccf784da3cf6317671ab346211f5984b3 -libblastrampoline.v5.8.0+1.powerpc64le-linux-gnu.tar.gz/md5/5f76f5c6a88c0caaa6419ba212f8cb94 -libblastrampoline.v5.8.0+1.powerpc64le-linux-gnu.tar.gz/sha512/785071e682075b2cebd992394e66169f4ee2db3a8e23affb88dc05d9abf55f49d597b2a7400a13c83ad106ad825b5ee666b01f8625e51aec267132573273991e -libblastrampoline.v5.8.0+1.x86_64-apple-darwin.tar.gz/md5/21beb51d448bd22e4608a16b3f4fde05 -libblastrampoline.v5.8.0+1.x86_64-apple-darwin.tar.gz/sha512/620ba64d93ef416e483f813617aa313957282d8361f920b5444702fa911ff0051d1f8a8814b5fa0b082fd4dc77d96cb8b763937c786959bbc97cbb6131617152 -libblastrampoline.v5.8.0+1.x86_64-linux-gnu.tar.gz/md5/14c1045ba4d400f490ddea5343a46f04 -libblastrampoline.v5.8.0+1.x86_64-linux-gnu.tar.gz/sha512/0fdae83f4df93b28951521cf426736367f568c1e76fb68eea42b045cc9a288b6836abb3206a6d61e4f88adcf198553e911c45231aecb0f552e06de28eb3bec54 -libblastrampoline.v5.8.0+1.x86_64-linux-musl.tar.gz/md5/59b110676fcb2fcfdcf670a5d435d555 -libblastrampoline.v5.8.0+1.x86_64-linux-musl.tar.gz/sha512/57a5022e9fabc0637a29f3c32f6180cb4f6a90282191232e299df6cea5265b535e4a0af4fde15c8fe80e5a59edea0fae96dd3a510f5720ecd78e85a2a9ffbfe0 -libblastrampoline.v5.8.0+1.x86_64-unknown-freebsd.tar.gz/md5/c22da112cfc7f9fa0f103d08f4b78965 -libblastrampoline.v5.8.0+1.x86_64-unknown-freebsd.tar.gz/sha512/ace02fac0dc6df472456007a081e0aaa85a6b17290321fb214349aac0f2d0f893df602dca28fc26ddfd4ed574fd9063bacff343249e5a1109f5d92dc9cb7a1d3 -libblastrampoline.v5.8.0+1.x86_64-w64-mingw32.tar.gz/md5/34fdc53745245887f968f420b2f02ed9 -libblastrampoline.v5.8.0+1.x86_64-w64-mingw32.tar.gz/sha512/bbf478736b7bd57b340ccd5b6744d526a7a95fc524d30fdf9af6e9d79285641be26fae5f9e5302d71a5be76b05c379e969a829e259d8100ba9c6ce202b632b3d +blastrampoline-ff05ebb4e450deda0aebe8dce4d4f054e23fecfc.tar.gz/md5/48ec847f7a687dd36789d6365d3c5645 +blastrampoline-ff05ebb4e450deda0aebe8dce4d4f054e23fecfc.tar.gz/sha512/85f6a46e7fe5f76ff8cef5776dad73b17eb97be3b16ca1af961cf2c2cbe125c629bd808b0243b793e4235dcb545a02cc082eaf14b3a438f3e0973d46921550a3 +libblastrampoline.v5.10.1+0.aarch64-apple-darwin.tar.gz/md5/cbbb4b5a6ebee04d686f072a69e855be +libblastrampoline.v5.10.1+0.aarch64-apple-darwin.tar.gz/sha512/32eaebb0fa3c0bc85a270b5c13fecaaa86ee10b4cea04405672badbaaa5ae3f22757dc758d9d971c811dc100a8ebd72fa00391238c0227de3690341f0434842a +libblastrampoline.v5.10.1+0.aarch64-linux-gnu.tar.gz/md5/da097a9459dcb8554f3d9511ea1a1c88 +libblastrampoline.v5.10.1+0.aarch64-linux-gnu.tar.gz/sha512/0159dbd4579d2a334f4341a64841bc1cef1354fc744709055339957b299b2b36b30162c2c90367abc04a2fb2f236aaa1fe6eb290393702f6fb97eaa79e4bb028 +libblastrampoline.v5.10.1+0.aarch64-linux-musl.tar.gz/md5/f32839481836dad6a1b159d9c33db752 +libblastrampoline.v5.10.1+0.aarch64-linux-musl.tar.gz/sha512/b973e739ab4af6ba93328943b03f16f02625553efc2375909b5e5bed4446287a21f99025817ce73267cac2d0b6b65f7dc2a5bd4b4c88d263b3c923b2ec3ad5c4 +libblastrampoline.v5.10.1+0.armv6l-linux-gnueabihf.tar.gz/md5/23eb2cbc1a547f94935fa4f9ffa2285b +libblastrampoline.v5.10.1+0.armv6l-linux-gnueabihf.tar.gz/sha512/0681497bac1d8f3ff1932adbb9fdd0b710b2a28ca7f2f4bb0093ba1123b14acd8bcb062e81e538c6e51ed8449ffea582cdb5b610e97d0c76a6feb58545938a6b +libblastrampoline.v5.10.1+0.armv6l-linux-musleabihf.tar.gz/md5/4e5168b1ada4e36861aeb3f4a6ace318 +libblastrampoline.v5.10.1+0.armv6l-linux-musleabihf.tar.gz/sha512/4ee663d2d3665e6ea356cfac60274c5f06ab08c1ee99b345ddda6872125663acb5559f704d0a918706e6cb075fc3071aaec4bcc3b9fee5fee72696e2f1454fb3 +libblastrampoline.v5.10.1+0.armv7l-linux-gnueabihf.tar.gz/md5/a28e3820fdf1435027f69204a553b5f9 +libblastrampoline.v5.10.1+0.armv7l-linux-gnueabihf.tar.gz/sha512/48edfc069aeaead468ffb6145986b11a040286990520b191e0f9cfa99f0b9458e6b17e523c8cc81889af7c9c2adce6372c65f2205a20c8e778614eaa06d288f9 +libblastrampoline.v5.10.1+0.armv7l-linux-musleabihf.tar.gz/md5/c5ea1756f3d58f8a74e76958f3a93658 +libblastrampoline.v5.10.1+0.armv7l-linux-musleabihf.tar.gz/sha512/f3eb003f954ffc346ae1037325b56fb2e4db9a6f88cc878862f921df79d8e0a5c8da9d229610dcd5d21c3d7af0a61ddcc0e70e32bf45fc9ea828d9ab2d1ddda8 +libblastrampoline.v5.10.1+0.i686-linux-gnu.tar.gz/md5/8bbdd602fed40577c4c9f020a8304c57 +libblastrampoline.v5.10.1+0.i686-linux-gnu.tar.gz/sha512/67947bd68c9f1131311d5d6a0fbcc92540f2fb2e1d2d0fa46951033fd75658661ba355c415b68de5dcd1bf0c440e27e3362ece70f5fd989fade796e9e723becd +libblastrampoline.v5.10.1+0.i686-linux-musl.tar.gz/md5/455bb539e7646e060fa24fb59c82f2f0 +libblastrampoline.v5.10.1+0.i686-linux-musl.tar.gz/sha512/e392334512ebce93ea4b34265ead802c543db5678c30083fb0dce08c071dd7140a9532d3162f215815807650138ffec5ad5d6d848025ee3913dfe353308d8e57 +libblastrampoline.v5.10.1+0.i686-w64-mingw32.tar.gz/md5/9a1c6845cb2e85b3497cd01d3a89b06b +libblastrampoline.v5.10.1+0.i686-w64-mingw32.tar.gz/sha512/66a9429a70575f4fd19d1cfb263c4c7801ac4a88408f98125f6e347b0ba35d2fdc4cbb82bf7407462beab1f7a7df2184163f76d5f2330f485bc1c7e5354716aa +libblastrampoline.v5.10.1+0.powerpc64le-linux-gnu.tar.gz/md5/b2b3eea1cfce87642a1f2afa125dcc5c +libblastrampoline.v5.10.1+0.powerpc64le-linux-gnu.tar.gz/sha512/43d5bf6535ad8f0910a523a3940787db956a3700681cc0dc1e2a1aabdaafa669e46e42854df29c0dcff06b3ade899159cb4845a48a6e618ba52af7276151fd0e +libblastrampoline.v5.10.1+0.x86_64-apple-darwin.tar.gz/md5/497a8f88c810a12b3faf12851427c784 +libblastrampoline.v5.10.1+0.x86_64-apple-darwin.tar.gz/sha512/7e3ed2117c6248761ba5bc3fd339f12ca98050d163d5c3668a62ee90aec10858d30fe9d78cea01796c9b2231cdd4f9ad0ae886bf8e984cb24d745e9f8c0fd62b +libblastrampoline.v5.10.1+0.x86_64-linux-gnu.tar.gz/md5/355612dc7c383dd860dc03498254814b +libblastrampoline.v5.10.1+0.x86_64-linux-gnu.tar.gz/sha512/12d803c53f705dacf2bf5f3884bd9b40f89a248ebda8bce1da6bba0cfe4331222bed5124dc45ea377e7c0fcc2d0dc624cc71b0eb454319fd12e2fd4c58d265f7 +libblastrampoline.v5.10.1+0.x86_64-linux-musl.tar.gz/md5/78a09fe918b1b0b3dc72c17c2e62799b +libblastrampoline.v5.10.1+0.x86_64-linux-musl.tar.gz/sha512/1ff3d7e8d36d450f430119b30e03a64f2d78d6d13a04e4a4b97c64966e341f486080c733dbd73ee3ed7c1557ad737f37c013335578e1555d162f0591929de747 +libblastrampoline.v5.10.1+0.x86_64-unknown-freebsd.tar.gz/md5/ad9f213bc4a7882784ad09017fc82234 +libblastrampoline.v5.10.1+0.x86_64-unknown-freebsd.tar.gz/sha512/4de6f08a45cb3c3819f71ccd44688b847c2e9b36e0d4bce94191558fe2d775c2790f4c68eea1a366d0a869f0c986aa33626d427946403cf4e128f45b5881f70e +libblastrampoline.v5.10.1+0.x86_64-w64-mingw32.tar.gz/md5/2d0cf117d8d797e7716f8d836dfdd9f5 +libblastrampoline.v5.10.1+0.x86_64-w64-mingw32.tar.gz/sha512/d7a94f3a71400b22b6c14648455e38dff750eb88661928b66b307f721d53769dea3aec43bb86e2200145ed072475c32e1bfc38e0fc35445c4c42e5752754b0e5 diff --git a/deps/checksums/suitesparse b/deps/checksums/suitesparse index 88f5195bb021a..eec27cb539d0f 100644 --- a/deps/checksums/suitesparse +++ b/deps/checksums/suitesparse @@ -1,34 +1,36 @@ -SuiteSparse-7.6.0.tar.gz/md5/79a68c2eca2d4b213a304bd08180c630 -SuiteSparse-7.6.0.tar.gz/sha512/6cffb283e7620afd31c6f7517ca9d28c2927515af582680d346e0e8a4ee1289daec0b4d83660f88f309e53e54a87403291fc4b0b45fe50dffd59781ec0129a8f -SuiteSparse.v7.6.0+0.aarch64-apple-darwin.tar.gz/md5/dd7cb2ded54840648d9bb28099dfbc66 -SuiteSparse.v7.6.0+0.aarch64-apple-darwin.tar.gz/sha512/64edba78b463dffebf7a1dbcc21665a8229fc795f22ea669e648b03595bb2bc646d0e5d8d9326adca525f325523f50bb8aeb1f1d6da12ba2c465f16f87ed6726 -SuiteSparse.v7.6.0+0.aarch64-linux-gnu.tar.gz/md5/f7e30ff16e597cae91031dd84fcc790a -SuiteSparse.v7.6.0+0.aarch64-linux-gnu.tar.gz/sha512/a3bfdaef6a2108d0179de3a3fa56c58af4a6cc36d12f987baa6ce15842bff2473c5ea92e5ce0e28d97744c5b8ffae5fb178c14a2e504f8d0291d5dc67370836d -SuiteSparse.v7.6.0+0.aarch64-linux-musl.tar.gz/md5/763d9208eb9a8d134d8a0fcdf01745c2 -SuiteSparse.v7.6.0+0.aarch64-linux-musl.tar.gz/sha512/657d78d577dade8ddb6b863208c3baf9e15e4cae83853f3730dce49a5f227eb48164f60b39cfd4a22f1d4bcf6d9c6e4b3fcf340bdc6c36345c60fb235bc2cfd7 -SuiteSparse.v7.6.0+0.armv6l-linux-gnueabihf.tar.gz/md5/7c71369a2edfe3eca0061339b8a30e3a -SuiteSparse.v7.6.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/bc197a50a1031e17721a63405438c2705da456c5ad97dcae0ccc538b0a5d46fa474b49e14a8d3db3d32402e7234e4d9523659a0ec2318901b5e6cd8a5fe7ea8f -SuiteSparse.v7.6.0+0.armv6l-linux-musleabihf.tar.gz/md5/2933e936ec3cdbbbd015206124d2a98e -SuiteSparse.v7.6.0+0.armv6l-linux-musleabihf.tar.gz/sha512/d3e3382b982198b5d37928ca0e2354bb110b327069b9dfeb72e9aef1d82e79e5a1536679112c0c82c20acf7e005269f0168c84d498b4ef87c5521bd18b133134 -SuiteSparse.v7.6.0+0.armv7l-linux-gnueabihf.tar.gz/md5/df109c03141c3c34dcbcee180c255539 -SuiteSparse.v7.6.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/cbffe6e5c023f3efbb60a78d6c403feb2b2ca0ff4cac4586c82ffba65d87a4bd1cff63370abfff91882d64e6cf2bb2e10e792ab21f4b7380f413c6a78b89f242 -SuiteSparse.v7.6.0+0.armv7l-linux-musleabihf.tar.gz/md5/5a82f651831d0e83214791156637c38b -SuiteSparse.v7.6.0+0.armv7l-linux-musleabihf.tar.gz/sha512/0436c0a83d2fb40f21cdd49817182a12824b903050fb47a717a55040445393e5312596e27654a0dabe059059b8dabf82c37e4754a71f189ee1561ddeb11098dc -SuiteSparse.v7.6.0+0.i686-linux-gnu.tar.gz/md5/b58d6186f54c4f10d1e37ac1b82ebd1c -SuiteSparse.v7.6.0+0.i686-linux-gnu.tar.gz/sha512/7d3f1cdd2f9786fa072d8820e4ec424d282595051aa2355c84de0530c957459408f7a4d7eb213863fe91a78c03b96346f8c6f8c088ee6e2bad91c576a5e7e39c -SuiteSparse.v7.6.0+0.i686-linux-musl.tar.gz/md5/c43f347674f1d983d76d453a1ce26c63 -SuiteSparse.v7.6.0+0.i686-linux-musl.tar.gz/sha512/467a4e3af813c7a550b097699ca45083fcdad4ad04689bf53c302b2cf769962c23b62bc39a7afa851c4a1226cd6fbb37e1e8590fd1dbca3c680f7138eb029a8b -SuiteSparse.v7.6.0+0.i686-w64-mingw32.tar.gz/md5/cd92ad4bef9109ab60357b78ae3c444b -SuiteSparse.v7.6.0+0.i686-w64-mingw32.tar.gz/sha512/41557b4e4254469bd1f264f0bea4335761ee18328e22d3626dd9ddb69ab8501c40d31c2848ac3c28b361454d80b8d97514478b8db96a335aa4b8580eba22de93 -SuiteSparse.v7.6.0+0.powerpc64le-linux-gnu.tar.gz/md5/8ba38d83ee767ef1a3108ad2fbdc9edf -SuiteSparse.v7.6.0+0.powerpc64le-linux-gnu.tar.gz/sha512/37ae98d9557ae8d2ce6edbcf2b18f49690b98daa5a19fab2cda747d2f19c735430031414fc8f23bca35899cb21995170e6fe72623dc6dae25b207870b9396698 -SuiteSparse.v7.6.0+0.x86_64-apple-darwin.tar.gz/md5/21cedd18cf9f5aa83b1bdaaf2d4253af -SuiteSparse.v7.6.0+0.x86_64-apple-darwin.tar.gz/sha512/e86ea34ac3d1d1123be7d6989893948d26a98ae28198740272c108c434650d1616f89c9176ea51c0dbc3550a1a4f0611935eec29b2aafd96d80717c99916a2b1 -SuiteSparse.v7.6.0+0.x86_64-linux-gnu.tar.gz/md5/10674b26e56d1cb4345012b965cac926 -SuiteSparse.v7.6.0+0.x86_64-linux-gnu.tar.gz/sha512/d1dba73e5449768ac728923edf665f1c11e6d54654ab14190fa3c7cd128642b2dac5b21f3c2d91313ab35e5054e6406542e074b6de2b8c0bce49269a9ab89dd4 -SuiteSparse.v7.6.0+0.x86_64-linux-musl.tar.gz/md5/9f2b78216d7474b064c710f6966b15d9 -SuiteSparse.v7.6.0+0.x86_64-linux-musl.tar.gz/sha512/32a3c124ca8041390b0e6d4ebcfe536d25c88fee28e178fb78279e52428613cb6e109ec99b3801331740985226dd40684bf20f75dd5c99c4c74335177d3a8307 -SuiteSparse.v7.6.0+0.x86_64-unknown-freebsd.tar.gz/md5/724ee53946f949618be56ded74c15d29 -SuiteSparse.v7.6.0+0.x86_64-unknown-freebsd.tar.gz/sha512/2fc9b2fdcabfe8e98a14f74ad1f94689cbde704e9f5635f6e5677af9090920627e46e903790231edb4de998eea3a732ad88b0c3ebc2ae5a158433b487e739340 -SuiteSparse.v7.6.0+0.x86_64-w64-mingw32.tar.gz/md5/57c4bd66dfd1bdf824017150d798f8aa -SuiteSparse.v7.6.0+0.x86_64-w64-mingw32.tar.gz/sha512/26d9c15de1b5b68b9f01775a758f322b5a9f8600c66fa713b5de1009a90cec8e6db755305c19485406f9a9e88d752871b70fff5e336d09fca9bdf61bcb4de3ba +SuiteSparse-7.7.0.tar.gz/md5/e659373ed5e9b961d2fcb6d67d250783 +SuiteSparse-7.7.0.tar.gz/sha512/aa62dae81ae423ce7162ae83b46e5cf606d95482e6c6bb7ae6d61e15987761119d9418ef3a96648e6ba2327871a2847eef8ace197aa375279d71c80329d6f451 +SuiteSparse-e8285dd13a6d5b5cf52d8124793fc4d622d07554.tar.gz/md5/46541001073d1c3c85e18d910f8308f3 +SuiteSparse-e8285dd13a6d5b5cf52d8124793fc4d622d07554.tar.gz/sha512/f7470a447b934ca9315e216a07b97e363f11bc93186f9aa057b20b2d05092c58ae4f1b733de362de4a0730861c00be4ca5588d0b3ba65f018c1798b9122b9672 +SuiteSparse.v7.7.0+0.aarch64-apple-darwin.tar.gz/md5/276f7355e36eeab2911a141e5570dede +SuiteSparse.v7.7.0+0.aarch64-apple-darwin.tar.gz/sha512/72aa979c3a4f6d2fa65f4d16ab106a7b306f5e84da91bf04a7a11bd863f71a8386ca5248b7e3fde83347cf912fae8ec3c87617db09f6bfadf12c476061855d28 +SuiteSparse.v7.7.0+0.aarch64-linux-gnu.tar.gz/md5/4c3ab9c8c451198420516bd84fdd079f +SuiteSparse.v7.7.0+0.aarch64-linux-gnu.tar.gz/sha512/7afb088a9b117f79531d828a458419e0e8901daa635eeb1b5c753d60c26784496095f2bf70c5c3dedfc5a1c8dd04c56cd8408667fedcbd06abcec0a41a1171bb +SuiteSparse.v7.7.0+0.aarch64-linux-musl.tar.gz/md5/e12af599488fa7578fb8f2018969f4c5 +SuiteSparse.v7.7.0+0.aarch64-linux-musl.tar.gz/sha512/c9e1c2938754dc3b7704e373f36cc876b592acac06c945860958e56f26e09b7be6ce58c4a9184d3528bcc1458d1f7ab9bd605b9a11083419e849e9fa2cc93f2b +SuiteSparse.v7.7.0+0.armv6l-linux-gnueabihf.tar.gz/md5/a3912a6af26ff19d3fcd166d8426f1ff +SuiteSparse.v7.7.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/5f724f5cfb526f2db7d184976f1711f09f77d548593ef9c28ae98a15b6927303864535761929fcd729448d9ece8a7f599cf82d0a83a7668966bdd8b6b62b641f +SuiteSparse.v7.7.0+0.armv6l-linux-musleabihf.tar.gz/md5/24ab4184bf83e59e029cf950be56f1c5 +SuiteSparse.v7.7.0+0.armv6l-linux-musleabihf.tar.gz/sha512/9f1b05c48b051b3c0440e7075f84105a5c5e8e2c8685d93fac847e1cbbf5427ba623ecde16d9b2293b0c286326bfbce07f8d2906a892065fa9fe3d36a4c0386b +SuiteSparse.v7.7.0+0.armv7l-linux-gnueabihf.tar.gz/md5/8433d1206bc72053c1936a1e5f76ea30 +SuiteSparse.v7.7.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/d5f3249db8bb3a4f216d3abef0416e090c1b4d0a847d814df03f3585159602a31b8e4edffae36c3cc39b5c79691c15d51a085b746f03b86d9a0a9b18d00332d9 +SuiteSparse.v7.7.0+0.armv7l-linux-musleabihf.tar.gz/md5/8651a96c9b5617287c917b07d9f6fb16 +SuiteSparse.v7.7.0+0.armv7l-linux-musleabihf.tar.gz/sha512/3e3f21083a8cd26919d6592be41f531ce4293a9e05a84d5298a4d6c3c222892d6d364c30c75558a1461020ac5446fd51e88a333d03118d74eb28ea33a3386d3b +SuiteSparse.v7.7.0+0.i686-linux-gnu.tar.gz/md5/184c95889dfb07319b9ee51e2ff12d0e +SuiteSparse.v7.7.0+0.i686-linux-gnu.tar.gz/sha512/5424a42418e033c67e0868dd7878990158a9f099f2e3ed04aed45c6ceff0a828080df6eae004e10a3784136f66ac13da46df0b3bb3c96fc32c7bdf02830af41f +SuiteSparse.v7.7.0+0.i686-linux-musl.tar.gz/md5/0bde5fe930ec4e2e90945b6bfd78e8d2 +SuiteSparse.v7.7.0+0.i686-linux-musl.tar.gz/sha512/1ff4c8e578146cca72c1bd74cddbba5999053e5729fdb217b0e4f1c0d5cbcae5a73f466e72a52e92979e5f8cc2549b1c5222c7ca32b628db0b71e129a2d22714 +SuiteSparse.v7.7.0+0.i686-w64-mingw32.tar.gz/md5/5439e41ed1909ffe4ba28669eb45ef43 +SuiteSparse.v7.7.0+0.i686-w64-mingw32.tar.gz/sha512/380999433f0a2c1d65a1bf6ea48da60e6cead831cfc31ab3df0ba122afbc32b2e14fb3d8d578a909b9f39f2763923816a691863756996ea064a595e58a788b98 +SuiteSparse.v7.7.0+0.powerpc64le-linux-gnu.tar.gz/md5/ea08ebbd5aaae629a194450c25a77d2e +SuiteSparse.v7.7.0+0.powerpc64le-linux-gnu.tar.gz/sha512/cfe6675e6a6b7790de8a6a3de2dbf561770fa63113c66890a3f888fba71e20c77edaa89b23cdf0038f3a870be9bd5e351aa84b774e7da833c9c0c90e05c0e9fb +SuiteSparse.v7.7.0+0.x86_64-apple-darwin.tar.gz/md5/314a033b51d6d239e29a91fcca911260 +SuiteSparse.v7.7.0+0.x86_64-apple-darwin.tar.gz/sha512/77147381738484d147ce529b4e9d3dff9bccbe5ed07071b5df647a785f118e46792f739f145d597ef78c871d75759348109ad3e08125fb58dd12b8a6813a8fcc +SuiteSparse.v7.7.0+0.x86_64-linux-gnu.tar.gz/md5/f62f17fc50b15e0a4a117f77c52b35f3 +SuiteSparse.v7.7.0+0.x86_64-linux-gnu.tar.gz/sha512/0ba022a5d0039b1348a09521cc2bd366df8c6603a7d3de4bf7d1b15504add8607bf5fa2bcf7d95b2b48cb676c17cc516903323615b6a668e53310363a3f6b242 +SuiteSparse.v7.7.0+0.x86_64-linux-musl.tar.gz/md5/d9b77034590bb0511f2ea2d726303f94 +SuiteSparse.v7.7.0+0.x86_64-linux-musl.tar.gz/sha512/a1149ec6f50b978b1bad91662035d8d131d431459e1910b2cd9fe0307f50d23ca15148f1af522db04327e8cc9cc7c04f85852ddb606ac82fa346b4ab70d28752 +SuiteSparse.v7.7.0+0.x86_64-unknown-freebsd.tar.gz/md5/7b7f00672f0880e397a5182da084c334 +SuiteSparse.v7.7.0+0.x86_64-unknown-freebsd.tar.gz/sha512/06696d78cd7e385906e2fbfbd8ec804de5a4a3d8134d30bc105f713eb915742204e4226229b33a93740f30a3ff24d48dde651e64a78bc6d937e84ce484f6dd74 +SuiteSparse.v7.7.0+0.x86_64-w64-mingw32.tar.gz/md5/91b2e33ead8c2898881475ddfe202987 +SuiteSparse.v7.7.0+0.x86_64-w64-mingw32.tar.gz/sha512/cb5f2caff872ba2ab66f1285e264b4c28ec0a05a4a0fea3964c22aa167195b57a9d9de2c9b9289438459c6b1c1b9f047807414b3e1305e87642edabd22973bd6 diff --git a/deps/libsuitesparse.version b/deps/libsuitesparse.version index 2602a449e3a4e..3131908a4a298 100644 --- a/deps/libsuitesparse.version +++ b/deps/libsuitesparse.version @@ -4,5 +4,5 @@ LIBSUITESPARSE_JLL_NAME := SuiteSparse ## source build -LIBSUITESPARSE_VER := 7.6.0 -LIBSUITESPARSE_SHA1=1a4d4fb0c399b261f4ed11aa980c6bab754aefa6 +LIBSUITESPARSE_VER := 7.7.0 +LIBSUITESPARSE_SHA1=13806726cbf470914d012d132a85aea1aff9ee77 diff --git a/doc/src/base/arrays.md b/doc/src/base/arrays.md index f7dfdd502c845..e77574a895202 100644 --- a/doc/src/base/arrays.md +++ b/doc/src/base/arrays.md @@ -32,7 +32,7 @@ Base.StridedMatrix Base.StridedVecOrMat Base.GenericMemory Base.Memory -Base.MemoryRef +Base.memoryref Base.Slices Base.RowSlices Base.ColumnSlices @@ -140,7 +140,6 @@ Base.reshape Base.dropdims Base.vec Base.SubArray -Base.wrap ``` ## Concatenation and permutation diff --git a/doc/src/devdocs/build/arm.md b/doc/src/devdocs/build/arm.md index 747ee25d22a04..df9ede07d270f 100644 --- a/doc/src/devdocs/build/arm.md +++ b/doc/src/devdocs/build/arm.md @@ -55,18 +55,9 @@ due to unsupported inline assembly. In that case, add `MCPU=armv7-a` to ## AArch64 (ARMv8) -Julia has been successfully built on the following ARMv8 devices: +Julia is expected to work and build on ARMv8 cpus. One should follow the general [build instructions](https://github.com/JuliaLang/julia/blob/master/README.md). Julia expects to have around 8GB of ram or swap enabled to build itself. -* [nVidia Jetson TX1 & TX2](https://www.nvidia.com/object/embedded-systems-dev-kits-modules.html); -* [X-Gene 1](https://www.apm.com/products/data-center/x-gene-family/x-gene/); -* [Overdrive 3000](https://softiron.com/products/overdrive-3000/); -* [Cavium ThunderX](https://www.cavium.com/ThunderX_ARM_Processors.html) on [packet.net](https://www.packet.net). - -Compilation on `ARMv8-A` requires that `Make.user` is configured as follows: - -``` -MCPU=armv8-a -``` +### Known issues Starting from Julia v1.10, [JITLink](https://llvm.org/docs/JITLink.html) is automatically enabled on this architecture for all operating systems when linking to LLVM 15 or later versions. Due to a [bug in LLVM memory manager](https://github.com/llvm/llvm-project/issues/63236), non-trivial workloads may generate too many memory mappings that on Linux can exceed the limit of memory mappings (`mmap`) set in the file `/proc/sys/vm/max_map_count`, resulting in an error like @@ -77,21 +68,3 @@ Should this happen, ask your system administrator to increase the limit of memor ``` sysctl -w vm.max_map_count=262144 ``` - -### nVidia Jetson TX2 - -Julia builds and runs on the [nVidia Jetson TX2](https://www.nvidia.com/object/embedded-systems-dev-kits-modules.html) -platform with minimal configuration changes. - -After configuring `Make.user` as per the `AArch64` instructions in this document, -follow the general [build instructions](https://github.com/JuliaLang/julia/blob/master/README.md). -The majority of the build dependencies specified in the instructions are installed by -the default configuration flashed by [Jetpack 3.0](https://developer.nvidia.com/embedded/jetpack). The remaining tools can be installed by issuing the following command: - -``` -sudo apt-get install gfortran wget cmake -``` - -A full parallel build, including LLVM, -will complete in around two hours. All tests pass and CUDA functionality is available -through, e.g., [CUDAdrv](https://github.com/JuliaGPU/CUDAdrv.jl). diff --git a/doc/src/devdocs/builtins.md b/doc/src/devdocs/builtins.md index 5ce7fae16f488..a572bfa39c7d2 100644 --- a/doc/src/devdocs/builtins.md +++ b/doc/src/devdocs/builtins.md @@ -7,7 +7,7 @@ definitions for what defines the abilities and behaviors of a Julia program. The typically accessed through a higher level generic API. ```@docs -Core.memoryref +Core.memoryrefnew Core.memoryrefoffset Core.memoryrefget Core.memoryrefset! diff --git a/src/builtins.c b/src/builtins.c index 37ea8d18b2340..361c1f1f4cf85 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -2423,7 +2423,7 @@ void jl_init_primitives(void) JL_GC_DISABLED jl_builtin_setglobalonce = add_builtin_func("setglobalonce!", jl_f_setglobalonce); // memory primitives - jl_builtin_memoryref = add_builtin_func("memoryref", jl_f_memoryref); + jl_builtin_memoryref = add_builtin_func("memoryrefnew", jl_f_memoryref); jl_builtin_memoryrefoffset = add_builtin_func("memoryrefoffset", jl_f_memoryrefoffset); jl_builtin_memoryrefget = add_builtin_func("memoryrefget", jl_f_memoryrefget); jl_builtin_memoryrefset = add_builtin_func("memoryrefset!", jl_f_memoryrefset); diff --git a/src/coverage.cpp b/src/coverage.cpp index 100a4c66322bd..c061276e66fd9 100644 --- a/src/coverage.cpp +++ b/src/coverage.cpp @@ -77,11 +77,10 @@ JL_DLLEXPORT uint64_t *jl_malloc_data_pointer(StringRef filename, int line) return allocLine(mallocData[filename], line); } -// Resets the malloc counts. -extern "C" JL_DLLEXPORT void jl_clear_malloc_data(void) +static void clear_log_data(logdata_t &logData, int resetValue) { - logdata_t::iterator it = mallocData.begin(); - for (; it != mallocData.end(); it++) { + logdata_t::iterator it = logData.begin(); + for (; it != logData.end(); it++) { SmallVector &bytes = (*it).second; SmallVector::iterator itb; for (itb = bytes.begin(); itb != bytes.end(); itb++) { @@ -89,7 +88,7 @@ extern "C" JL_DLLEXPORT void jl_clear_malloc_data(void) logdata_block &data = **itb; for (int i = 0; i < logdata_blocksize; i++) { if (data[i] > 0) - data[i] = 1; + data[i] = resetValue; } } } @@ -97,6 +96,18 @@ extern "C" JL_DLLEXPORT void jl_clear_malloc_data(void) jl_gc_sync_total_bytes(0); } +// Resets the malloc counts. +extern "C" JL_DLLEXPORT void jl_clear_malloc_data(void) +{ + clear_log_data(mallocData, 1); +} + +// Resets the code coverage +extern "C" JL_DLLEXPORT void jl_clear_coverage_data(void) +{ + clear_log_data(coverageData, 0); +} + static void write_log_data(logdata_t &logData, const char *extension) { std::string base = std::string(jl_options.julia_bindir); diff --git a/src/jitlayers.h b/src/jitlayers.h index 3da4c28af6601..7d35ff7f18034 100644 --- a/src/jitlayers.h +++ b/src/jitlayers.h @@ -90,6 +90,7 @@ struct OptimizationOptions { bool enable_vector_pipeline; bool remove_ni; bool cleanup; + bool warn_missed_transformations; static constexpr OptimizationOptions defaults( bool lower_intrinsics=true, @@ -103,12 +104,13 @@ struct OptimizationOptions { bool enable_loop_optimizations=true, bool enable_vector_pipeline=true, bool remove_ni=true, - bool cleanup=true) { + bool cleanup=true, + bool warn_missed_transformations=false) { return {lower_intrinsics, dump_native, external_use, llvm_only, always_inline, enable_early_simplifications, enable_early_optimizations, enable_scalar_optimizations, enable_loop_optimizations, enable_vector_pipeline, - remove_ni, cleanup}; + remove_ni, cleanup, warn_missed_transformations}; } }; diff --git a/src/jltypes.c b/src/jltypes.c index b357172606f30..cb03b493d8598 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -3518,8 +3518,11 @@ void jl_init_types(void) JL_GC_DISABLED jl_emptysvec, 0, 0, 4); // all Kinds share the Type method table (not the nonfunction one) - jl_unionall_type->name->mt = jl_uniontype_type->name->mt = jl_datatype_type->name->mt = - jl_type_type_mt; + jl_unionall_type->name->mt = + jl_uniontype_type->name->mt = + jl_datatype_type->name->mt = + jl_typeofbottom_type->name->mt = + jl_type_type_mt; jl_intrinsic_type = jl_new_primitivetype((jl_value_t*)jl_symbol("IntrinsicFunction"), core, jl_builtin_type, jl_emptysvec, 32); diff --git a/src/pipeline.cpp b/src/pipeline.cpp index 8fbc6be6026c4..1cb86a98502d8 100644 --- a/src/pipeline.cpp +++ b/src/pipeline.cpp @@ -609,7 +609,8 @@ static void buildPipeline(ModulePassManager &MPM, PassBuilder *PB, OptimizationL if (O.getSpeedupLevel() >= 2) { buildVectorPipeline(FPM, PB, O, options); } - FPM.addPass(WarnMissedTransformationsPass()); + if (options.warn_missed_transformations) + FPM.addPass(WarnMissedTransformationsPass()); MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM))); } buildIntrinsicLoweringPipeline(MPM, PB, O, options); @@ -632,6 +633,7 @@ struct PipelineConfig { int enable_vector_pipeline; int remove_ni; int cleanup; + int warn_missed_transformations; }; extern "C" JL_DLLEXPORT_CODEGEN void jl_build_newpm_pipeline_impl(void *MPM, void *PB, PipelineConfig* config) JL_NOTSAFEPOINT @@ -672,7 +674,8 @@ extern "C" JL_DLLEXPORT_CODEGEN void jl_build_newpm_pipeline_impl(void *MPM, voi !!config->enable_loop_optimizations, !!config->enable_vector_pipeline, !!config->remove_ni, - !!config->cleanup}); + !!config->cleanup, + !!config->warn_missed_transformations}); } #undef JULIA_PASS @@ -858,7 +861,8 @@ static Optional> parseJuliaPip OPTION(lower_intrinsics), OPTION(dump_native), OPTION(external_use), - OPTION(llvm_only) + OPTION(llvm_only), + OPTION(warn_missed_transformations) #undef OPTION }; while (!name.empty()) { diff --git a/src/toplevel.c b/src/toplevel.c index a641a635562bb..bab7e5e3da359 100644 --- a/src/toplevel.c +++ b/src/toplevel.c @@ -757,14 +757,14 @@ jl_value_t *jl_toplevel_eval_flex(jl_module_t *JL_NONNULL m, jl_value_t *e, int if (jl_is_expr(a) && ((jl_expr_t*)a)->head == jl_dot_sym) { name = NULL; jl_module_t *import = eval_import_path(m, from, ((jl_expr_t*)a)->args, &name, "using"); - jl_module_t *u = import; - if (name != NULL) - u = (jl_module_t*)jl_eval_global_var(import, name); if (from) { // `using A: B` and `using A: B.c` syntax jl_module_use(m, import, name); } else { + jl_module_t *u = import; + if (name != NULL) + u = (jl_module_t*)jl_eval_global_var(import, name); if (!jl_is_module(u)) jl_eval_errorf(m, "invalid using path: \"%s\" does not name a module", jl_symbol_name(name)); diff --git a/stdlib/.gitignore b/stdlib/.gitignore index 93668857189af..ce744aa43d9f5 100644 --- a/stdlib/.gitignore +++ b/stdlib/.gitignore @@ -27,8 +27,6 @@ /Distributed /StyledStrings-* /StyledStrings -/JuliaSyntaxHighlighting-* -/JuliaSyntaxHighlighting /*_jll/StdlibArtifacts.toml /*/Manifest.toml /*.image diff --git a/stdlib/Artifacts/src/Artifacts.jl b/stdlib/Artifacts/src/Artifacts.jl index bd44369655ae4..bfc884cc30634 100644 --- a/stdlib/Artifacts/src/Artifacts.jl +++ b/stdlib/Artifacts/src/Artifacts.jl @@ -545,10 +545,10 @@ function jointail(dir, tail) end function _artifact_str(__module__, artifacts_toml, name, path_tail, artifact_dict, hash, platform, @nospecialize(lazyartifacts)) - moduleroot = Base.moduleroot(__module__) - if haskey(Base.module_keys, moduleroot) + pkg = Base.PkgId(__module__) + if pkg.uuid !== nothing # Process overrides for this UUID, if we know what it is - process_overrides(artifact_dict, Base.module_keys[moduleroot].uuid) + process_overrides(artifact_dict, pkg.uuid) end # If the artifact exists, we're in the happy path and we can immediately diff --git a/stdlib/JuliaSyntaxHighlighting.version b/stdlib/JuliaSyntaxHighlighting.version deleted file mode 100644 index 4a819d056e70e..0000000000000 --- a/stdlib/JuliaSyntaxHighlighting.version +++ /dev/null @@ -1,4 +0,0 @@ -JULIASYNTAXHIGHLIGHTING_BRANCH = main -JULIASYNTAXHIGHLIGHTING_SHA1 = 4110caaf4fcdf0c614fd3ecd7c5bf589ca82ac63 -JULIASYNTAXHIGHLIGHTING_GIT_URL := https://github.com/julialang/JuliaSyntaxHighlighting.jl.git -JULIASYNTAXHIGHLIGHTING_TAR_URL = https://api.github.com/repos/julialang/JuliaSyntaxHighlighting.jl/tarball/$1 diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index 9262c2fddca45..ec0363e1f751c 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -241,6 +241,8 @@ Note that the [element type](@ref eltype) of the matrix must admit [`norm`](@ref """ struct ColumnNorm <: PivotingStrategy end +using Base: DimOrInd + # Check that stride of matrix/vector is 1 # Writing like this to avoid splatting penalty when called with multiple arguments, # see PR 16416 diff --git a/stdlib/LinearAlgebra/src/abstractq.jl b/stdlib/LinearAlgebra/src/abstractq.jl index bf4064c907a2d..09beca1dd960d 100644 --- a/stdlib/LinearAlgebra/src/abstractq.jl +++ b/stdlib/LinearAlgebra/src/abstractq.jl @@ -78,6 +78,14 @@ axes(Q::AbstractQ, d::Integer) = d in (1, 2) ? axes(Q)[d] : Base.OneTo(1) copymutable(Q::AbstractQ{T}) where {T} = lmul!(Q, Matrix{T}(I, size(Q))) copy(Q::AbstractQ) = copymutable(Q) +# legacy compatibility +similar(Q::AbstractQ) = similar(Q, eltype(Q), size(Q)) +similar(Q::AbstractQ, ::Type{T}) where {T} = similar(Q, T, size(Q)) +similar(Q::AbstractQ, size::DimOrInd...) = similar(Q, eltype(Q), size...) +similar(Q::AbstractQ, ::Type{T}, size::DimOrInd...) where {T} = similar(Q, T, Base.to_shape(size)) +similar(Q::AbstractQ, size::Tuple{Vararg{DimOrInd}}) = similar(Q, eltype(Q), Base.to_shape(size)) +similar(Q::AbstractQ, ::Type{T}, size::NTuple{N,Integer}) where {T,N} = Array{T,N}(undef, size) + # getindex @inline function getindex(Q::AbstractQ, inds...) @boundscheck Base.checkbounds_indices(Bool, axes(Q), inds) || Base.throw_boundserror(Q, inds) diff --git a/stdlib/LinearAlgebra/src/bidiag.jl b/stdlib/LinearAlgebra/src/bidiag.jl index d356379f34dff..91e41855bcbc6 100644 --- a/stdlib/LinearAlgebra/src/bidiag.jl +++ b/stdlib/LinearAlgebra/src/bidiag.jl @@ -178,8 +178,8 @@ end elseif A.uplo == 'L' && (i == j + 1) @inbounds A.ev[j] = x elseif !iszero(x) - throw(ArgumentError(string("cannot set entry ($i, $j) off the ", - "$(istriu(A) ? "upper" : "lower") bidiagonal band to a nonzero value ($x)"))) + throw(ArgumentError(LazyString(lazy"cannot set entry ($i, $j) off the ", + istriu(A) ? "upper" : "lower", " bidiagonal band to a nonzero value ", x))) end return x end @@ -343,8 +343,8 @@ isdiag(M::Bidiagonal) = iszero(M.ev) function tril!(M::Bidiagonal{T}, k::Integer=0) where T n = length(M.dv) if !(-n - 1 <= k <= n - 1) - throw(ArgumentError(string("the requested diagonal, $k, must be at least ", - "$(-n - 1) and at most $(n - 1) in an $n-by-$n matrix"))) + throw(ArgumentError(LazyString(lazy"the requested diagonal, $k, must be at least ", + lazy"$(-n - 1) and at most $(n - 1) in an $n-by-$n matrix"))) elseif M.uplo == 'U' && k < 0 fill!(M.dv, zero(T)) fill!(M.ev, zero(T)) @@ -362,8 +362,8 @@ end function triu!(M::Bidiagonal{T}, k::Integer=0) where T n = length(M.dv) if !(-n + 1 <= k <= n + 1) - throw(ArgumentError(string("the requested diagonal, $k, must be at least", - "$(-n + 1) and at most $(n + 1) in an $n-by-$n matrix"))) + throw(ArgumentError(LazyString(lazy"the requested diagonal, $k, must be at least", + lazy"$(-n + 1) and at most $(n + 1) in an $n-by-$n matrix"))) elseif M.uplo == 'L' && k > 0 fill!(M.dv, zero(T)) fill!(M.ev, zero(T)) @@ -388,8 +388,8 @@ function diag(M::Bidiagonal{T}, n::Integer=0) where T elseif -size(M,1) <= n <= size(M,1) return fill!(similar(M.dv, size(M,1)-abs(n)), zero(T)) else - throw(ArgumentError(string("requested diagonal, $n, must be at least $(-size(M, 1)) ", - "and at most $(size(M, 2)) for an $(size(M, 1))-by-$(size(M, 2)) matrix"))) + throw(ArgumentError(LazyString(lazy"requested diagonal, $n, must be at least $(-size(M, 1)) ", + lazy"and at most $(size(M, 2)) for an $(size(M, 1))-by-$(size(M, 2)) matrix"))) end end diff --git a/stdlib/LinearAlgebra/src/diagonal.jl b/stdlib/LinearAlgebra/src/diagonal.jl index f07e0fba17f53..6ee4f1279b4fd 100644 --- a/stdlib/LinearAlgebra/src/diagonal.jl +++ b/stdlib/LinearAlgebra/src/diagonal.jl @@ -237,8 +237,8 @@ end function tril!(D::Diagonal{T}, k::Integer=0) where T n = size(D,1) if !(-n - 1 <= k <= n - 1) - throw(ArgumentError(string("the requested diagonal, $k, must be at least ", - "$(-n - 1) and at most $(n - 1) in an $n-by-$n matrix"))) + throw(ArgumentError(LazyString(lazy"the requested diagonal, $k, must be at least ", + lazy"$(-n - 1) and at most $(n - 1) in an $n-by-$n matrix"))) elseif k < 0 fill!(D.diag, zero(T)) end diff --git a/stdlib/LinearAlgebra/src/lapack.jl b/stdlib/LinearAlgebra/src/lapack.jl index 4b7bffcd50e89..30307d365251b 100644 --- a/stdlib/LinearAlgebra/src/lapack.jl +++ b/stdlib/LinearAlgebra/src/lapack.jl @@ -61,9 +61,13 @@ macro chkvalidparam(position::Int, param, validvalues) :(chkvalidparam($position, $(string(param)), $(esc(param)), $validvalues)) end function chkvalidparam(position::Int, var::String, val, validvals) + # mimic `repr` for chars without explicitly calling it + # This is because `repr` introduces dynamic dispatch + _repr(c::AbstractChar) = "'$c'" + _repr(c) = c if val โˆ‰ validvals throw(ArgumentError( - lazy"argument #$position: $var must be one of $validvals, but $(repr(val)) was passed")) + lazy"argument #$position: $var must be one of $validvals, but $(_repr(val)) was passed")) end return val end diff --git a/stdlib/LinearAlgebra/src/triangular.jl b/stdlib/LinearAlgebra/src/triangular.jl index c3def1318db86..6f204959448d4 100644 --- a/stdlib/LinearAlgebra/src/triangular.jl +++ b/stdlib/LinearAlgebra/src/triangular.jl @@ -1231,6 +1231,7 @@ function generic_trimatdiv!(C::AbstractVecOrMat, uploc, isunitc, tfun::Function, if size(C) != size(B) throw(DimensionMismatch(lazy"size of output, $(size(C)), does not match size of right hand side, $(size(B))")) end + iszero(mA) && return C oA = oneunit(eltype(A)) @inbounds if uploc == 'U' if isunitc == 'N' @@ -1367,6 +1368,7 @@ function generic_trimatdiv!(C::AbstractVecOrMat, uploc, isunitc, ::Function, xA: if size(C) != size(B) throw(DimensionMismatch(lazy"size of output, $(size(C)), does not match size of right hand side, $(size(B))")) end + iszero(mA) && return C oA = oneunit(eltype(A)) @inbounds if uploc == 'U' if isunitc == 'N' diff --git a/stdlib/LinearAlgebra/test/abstractq.jl b/stdlib/LinearAlgebra/test/abstractq.jl index 0eb88324e8c20..e46f4d2600eb2 100644 --- a/stdlib/LinearAlgebra/test/abstractq.jl +++ b/stdlib/LinearAlgebra/test/abstractq.jl @@ -102,6 +102,30 @@ n = 5 @test Q โ‰ˆ Prect @test Q โ‰ˆ Psquare @test Q โ‰ˆ F.Q*I + + @testset "similar" begin + QS = similar(Q) + @test QS isa Matrix{eltype(Q)} + @test size(QS) == size(Q) + + QS = similar(Q, Int8) + @test QS isa Matrix{Int8} + @test size(QS) == size(Q) + + QS = similar(Q, 1) + @test QS isa Vector{eltype(Q)} + @test size(QS) == (1,) + + QS = similar(Q, Int8, 2) + @test QS isa Vector{Int8} + @test size(QS) == (2,) + + QS = similar(Q, Int8, ()) + @test QS isa Array{Int8,0} + + QS = similar(Q, ()) + @test QS isa Array{eltype(Q),0} + end end end # module diff --git a/stdlib/LinearAlgebra/test/lu.jl b/stdlib/LinearAlgebra/test/lu.jl index a4cbdbe3eb9b9..0cb45047a118c 100644 --- a/stdlib/LinearAlgebra/test/lu.jl +++ b/stdlib/LinearAlgebra/test/lu.jl @@ -486,4 +486,17 @@ end LinearAlgebra.generic_lufact!(fill(Inf, 2, 2), check=false) end +@testset "lu for empty matrices" begin + for T in (Float64, BigFloat) + A = fill(T(0.0), 0, 0) + v = fill(T(1.0), 0, 10) + @test A \ v โ‰ˆ lu(A) \ v + vt = permutedims(v) + @test vt / A โ‰ˆ vt / lu(A) + B = UpperTriangular(transpose(fill(complex(T(0.0)), 0, 0)')) + @test B \ v โ‰ˆ v + @test vt / B โ‰ˆ vt + end +end + end # module TestLU diff --git a/stdlib/LinearAlgebra/test/symmetric.jl b/stdlib/LinearAlgebra/test/symmetric.jl index 4d9fce18cf5a6..b2fc9214f1ca4 100644 --- a/stdlib/LinearAlgebra/test/symmetric.jl +++ b/stdlib/LinearAlgebra/test/symmetric.jl @@ -223,8 +223,8 @@ end @testset "linalg unary ops" begin @testset "tr" begin - @test tr(asym) == tr(Symmetric(asym)) - @test tr(aherm) == tr(Hermitian(aherm)) + @test tr(asym) โ‰ˆ tr(Symmetric(asym)) + @test tr(aherm) โ‰ˆ tr(Hermitian(aherm)) end @testset "isposdef[!]" begin diff --git a/stdlib/Makefile b/stdlib/Makefile index ebc40c9db2b12..d478d2ad4c188 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -48,7 +48,6 @@ STDLIBS = Artifacts Base64 CRC32c Dates FileWatching \ STDLIBS_EXT = Pkg Statistics LazyArtifacts LibCURL DelimitedFiles Downloads ArgTools \ Tar NetworkOptions SuiteSparse SparseArrays StyledStrings SHA Distributed \ - JuliaSyntaxHighlighting $(foreach module, $(STDLIBS_EXT), $(eval $(call stdlib-external,$(module),$(shell echo $(module) | tr a-z A-Z)))) diff --git a/stdlib/Manifest.toml b/stdlib/Manifest.toml index e3d57ccb020a8..c34e4424a2c87 100644 --- a/stdlib/Manifest.toml +++ b/stdlib/Manifest.toml @@ -65,11 +65,6 @@ deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" version = "1.11.0" -[[deps.JuliaSyntaxHighlighting]] -deps = ["StyledStrings"] -uuid = "dc6e5ff7-fb65-4e79-a425-ec3bc9c03011" -version = "1.11.0" - [[deps.LLD_jll]] deps = ["Artifacts", "Libdl", "Zlib_jll", "libLLVM_jll"] uuid = "d55e3150-da41-5e91-b323-ecfd1eec6109" @@ -242,7 +237,7 @@ version = "1.11.0" [[deps.SuiteSparse_jll]] deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.6.0+0" +version = "7.7.0+0" [[deps.TOML]] deps = ["Dates"] diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index 81fcdb434fc92..0ee27e8dfbc03 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ PKG_BRANCH = release-1.11 -PKG_SHA1 = 280f702c1ace34b51cd4551ed448b19516c36849 +PKG_SHA1 = 8457d3eff518f75bbff2d8b183e66e44ae5c47f1 PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 diff --git a/stdlib/Project.toml b/stdlib/Project.toml index cc7ba99dd4e4f..0cfdfab02bf60 100644 --- a/stdlib/Project.toml +++ b/stdlib/Project.toml @@ -12,7 +12,6 @@ FileWatching = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" Future = "9fa8497b-333b-5362-9e8d-4d0656e87820" GMP_jll = "781609d7-10c4-51f6-84f2-b8444358ff6d" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" -JuliaSyntaxHighlighting = "dc6e5ff7-fb65-4e79-a425-ec3bc9c03011" LLD_jll = "d55e3150-da41-5e91-b323-ecfd1eec6109" LLVMLibUnwind_jll = "47c5dbc3-30ba-59ef-96a6-123e260183d9" LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3" diff --git a/stdlib/SuiteSparse_jll/Project.toml b/stdlib/SuiteSparse_jll/Project.toml index 24d2e42dbaea9..314208ffc344c 100644 --- a/stdlib/SuiteSparse_jll/Project.toml +++ b/stdlib/SuiteSparse_jll/Project.toml @@ -1,6 +1,6 @@ name = "SuiteSparse_jll" uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.6.0+0" +version = "7.7.0+0" [deps] libblastrampoline_jll = "8e850b90-86db-534c-a0d3-1478176c7d93" diff --git a/stdlib/TOML/src/print.jl b/stdlib/TOML/src/print.jl index 168a7f63c6b5b..63f65b017d393 100644 --- a/stdlib/TOML/src/print.jl +++ b/stdlib/TOML/src/print.jl @@ -101,9 +101,10 @@ function printvalue(f::MbyFunc, io::IO, value::TOMLValue, sorted::Bool) value isa AbstractFloat ? Base.print(io, isnan(value) ? "nan" : isinf(value) ? string(value > 0 ? "+" : "-", "inf") : Float64(value)) : # TOML specifies IEEE 754 binary64 for float - value isa AbstractString ? (Base.print(io, "\""); + value isa AbstractString ? (qmark = Base.contains(value, "\n") ? "\"\"\"" : "\""; + Base.print(io, qmark); print_toml_escaped(io, value); - Base.print(io, "\"")) : + Base.print(io, qmark)) : value isa AbstractDict ? print_inline_table(f, io, value, sorted) : error("internal error in TOML printing, unhandled value") end diff --git a/stdlib/TOML/test/print.jl b/stdlib/TOML/test/print.jl index 79a87b9f0f13f..8fba1b1c1df10 100644 --- a/stdlib/TOML/test/print.jl +++ b/stdlib/TOML/test/print.jl @@ -195,3 +195,13 @@ LocalPkg = {path = "LocalPkg"} """ @test toml_str(d; sorted=true, inline_tables) == s @test roundtrip(s) + +# multiline strings (#55083) +s = """ +a = \"\"\"lorem ipsum + + + +alpha\"\"\" +""" +@test roundtrip(s) diff --git a/stdlib/libblastrampoline_jll/Project.toml b/stdlib/libblastrampoline_jll/Project.toml index 6ee704bc7e1c4..97ee9bb32eeb1 100644 --- a/stdlib/libblastrampoline_jll/Project.toml +++ b/stdlib/libblastrampoline_jll/Project.toml @@ -1,6 +1,6 @@ name = "libblastrampoline_jll" uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.8.0+1" +version = "5.10.1+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" diff --git a/stdlib/stdlib.mk b/stdlib/stdlib.mk index b79059d3368b1..021639ec0bad0 100644 --- a/stdlib/stdlib.mk +++ b/stdlib/stdlib.mk @@ -4,7 +4,7 @@ STDLIBS_WITHIN_SYSIMG := \ INDEPENDENT_STDLIBS := \ ArgTools Base64 CRC32c Dates DelimitedFiles Distributed Downloads Future \ - InteractiveUtils JuliaSyntaxHighlighting LazyArtifacts LibGit2 LibCURL Logging \ + InteractiveUtils LazyArtifacts LibGit2 LibCURL Logging \ Markdown Mmap NetworkOptions Profile Printf Pkg REPL Serialization SharedArrays \ SparseArrays Statistics StyledStrings SuiteSparse_jll Tar Test TOML Unicode UUIDs \ dSFMT_jll GMP_jll libLLVM_jll LLD_jll LLVMLibUnwind_jll LibUnwind_jll LibUV_jll \ diff --git a/test/RelocationTestPkg2/src/RelocationTestPkg2.jl b/test/RelocationTestPkg2/src/RelocationTestPkg2.jl index dc36a06cb48d4..4b1fd2708a727 100644 --- a/test/RelocationTestPkg2/src/RelocationTestPkg2.jl +++ b/test/RelocationTestPkg2/src/RelocationTestPkg2.jl @@ -1,7 +1,7 @@ module RelocationTestPkg2 -include_dependency("foo.txt") -include_dependency("foodir") +include_dependency("foo.txt", track_content=false) +include_dependency("foodir", track_content=false) greet() = print("Hello World!") end # module RelocationTestPkg2 diff --git a/test/abstractarray.jl b/test/abstractarray.jl index 732ffba85ae84..0d5ad2f7282df 100644 --- a/test/abstractarray.jl +++ b/test/abstractarray.jl @@ -1212,7 +1212,7 @@ function Base.getindex(S::Strider{<:Any,N}, I::Vararg{Int,N}) where {N} end Base.strides(S::Strider) = S.strides Base.elsize(::Type{<:Strider{T}}) where {T} = Base.elsize(Vector{T}) -Base.cconvert(::Type{Ptr{T}}, S::Strider{T}) where {T} = MemoryRef(S.data.ref, S.offset) +Base.cconvert(::Type{Ptr{T}}, S::Strider{T}) where {T} = memoryref(S.data.ref, S.offset) @testset "Simple 3d strided views and permutes" for sz in ((5, 3, 2), (7, 11, 13)) A = collect(reshape(1:prod(sz), sz)) diff --git a/test/arrayops.jl b/test/arrayops.jl index 0659cebca1e86..d86faf6f96004 100644 --- a/test/arrayops.jl +++ b/test/arrayops.jl @@ -3189,7 +3189,7 @@ end @testset "Wrapping Memory into Arrays" begin mem = Memory{Int}(undef, 10) .= 1 - memref = MemoryRef(mem) + memref = memoryref(mem) @test_throws DimensionMismatch Base.wrap(Array, mem, (10, 10)) @test Base.wrap(Array, mem, (5,)) == ones(Int, 5) @test Base.wrap(Array, mem, 2) == ones(Int, 2) @@ -3197,7 +3197,7 @@ end @test Base.wrap(Array, memref, (2,2,2)) == ones(Int,2,2,2) @test Base.wrap(Array, mem, (5, 2)) == ones(Int, 5, 2) - memref2 = MemoryRef(mem, 3) + memref2 = memoryref(mem, 3) @test Base.wrap(Array, memref2, (5,)) == ones(Int, 5) @test Base.wrap(Array, memref2, 2) == ones(Int, 2) @test Base.wrap(Array, memref2, (2,2,2)) == ones(Int,2,2,2) diff --git a/test/compiler/effects.jl b/test/compiler/effects.jl index 0b458905e4217..b48d00b048d42 100644 --- a/test/compiler/effects.jl +++ b/test/compiler/effects.jl @@ -1215,22 +1215,22 @@ callgetfield_inbounds(x, f) = @inbounds callgetfield2(x, f) Core.Compiler.ALWAYS_FALSE # noub modeling for memory ops -let (memoryref, memoryrefget, memoryref_isassigned, memoryrefset!) = - (Core.memoryref, Core.memoryrefget, Core.memoryref_isassigned, Core.memoryrefset!) +let (memoryrefnew, memoryrefget, memoryref_isassigned, memoryrefset!) = + (Core.memoryrefnew, Core.memoryrefget, Core.memoryref_isassigned, Core.memoryrefset!) function builtin_effects(@nospecialize xs...) interp = Core.Compiler.NativeInterpreter() ๐•ƒ = Core.Compiler.typeinf_lattice(interp) rt = Core.Compiler.builtin_tfunction(interp, xs..., nothing) return Core.Compiler.builtin_effects(๐•ƒ, xs..., rt) end - @test Core.Compiler.is_noub(builtin_effects(memoryref, Any[Memory,])) - @test Core.Compiler.is_noub(builtin_effects(memoryref, Any[MemoryRef,Int])) - @test Core.Compiler.is_noub(builtin_effects(memoryref, Any[MemoryRef,Int,Core.Const(true)])) - @test !Core.Compiler.is_noub(builtin_effects(memoryref, Any[MemoryRef,Int,Core.Const(false)])) - @test !Core.Compiler.is_noub(builtin_effects(memoryref, Any[MemoryRef,Int,Bool])) - @test Core.Compiler.is_noub(builtin_effects(memoryref, Any[MemoryRef,Int,Int])) - @test !Core.Compiler.is_noub(builtin_effects(memoryref, Any[MemoryRef,Int,Vararg{Bool}])) - @test !Core.Compiler.is_noub(builtin_effects(memoryref, Any[MemoryRef,Vararg{Any}])) + @test Core.Compiler.is_noub(builtin_effects(memoryrefnew, Any[Memory,])) + @test Core.Compiler.is_noub(builtin_effects(memoryrefnew, Any[MemoryRef,Int])) + @test Core.Compiler.is_noub(builtin_effects(memoryrefnew, Any[MemoryRef,Int,Core.Const(true)])) + @test !Core.Compiler.is_noub(builtin_effects(memoryrefnew, Any[MemoryRef,Int,Core.Const(false)])) + @test !Core.Compiler.is_noub(builtin_effects(memoryrefnew, Any[MemoryRef,Int,Bool])) + @test Core.Compiler.is_noub(builtin_effects(memoryrefnew, Any[MemoryRef,Int,Int])) + @test !Core.Compiler.is_noub(builtin_effects(memoryrefnew, Any[MemoryRef,Int,Vararg{Bool}])) + @test !Core.Compiler.is_noub(builtin_effects(memoryrefnew, Any[MemoryRef,Vararg{Any}])) @test Core.Compiler.is_noub(builtin_effects(memoryrefget, Any[MemoryRef,Symbol,Core.Const(true)])) @test !Core.Compiler.is_noub(builtin_effects(memoryrefget, Any[MemoryRef,Symbol,Core.Const(false)])) @test !Core.Compiler.is_noub(builtin_effects(memoryrefget, Any[MemoryRef,Symbol,Bool])) @@ -1251,7 +1251,7 @@ let (memoryref, memoryrefget, memoryref_isassigned, memoryrefset!) = @test !Core.Compiler.is_noub(builtin_effects(memoryrefset!, Any[MemoryRef,Vararg{Any}])) # `:boundscheck` taint should be refined by post-opt analysis @test Base.infer_effects() do xs::Vector{Any}, i::Int - memoryrefget(memoryref(getfield(xs, :ref), i, Base.@_boundscheck), :not_atomic, Base.@_boundscheck) + memoryrefget(memoryrefnew(getfield(xs, :ref), i, Base.@_boundscheck), :not_atomic, Base.@_boundscheck) end |> Core.Compiler.is_noub_if_noinbounds end diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index b661fcc384268..f203d411a4424 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -2569,6 +2569,14 @@ Base.return_types(intermustalias_edgecase, (Any,); interp=MustAliasInterpreter() intermustalias_edgecase(x) end |> only === Core.Compiler.InterMustAlias +@test Base.infer_return_type((AliasableField,Integer,); interp=MustAliasInterpreter()) do a, x + s = (;x) + if getfield(a, :f) isa Symbol + return getfield(s, getfield(a, :f)) + end + return 0 +end == Integer + function f25579(g) h = g[] t = (h === nothing) diff --git a/test/copy.jl b/test/copy.jl index 14a8adadccab9..9faba839c98e0 100644 --- a/test/copy.jl +++ b/test/copy.jl @@ -49,6 +49,15 @@ chnlprod(x) = Channel(c->for i in x; put!(c,i); end) @test_throws Union{BoundsError, ArgumentError} copyto!(dest, 1, src(), 2, 2) end + + v = rand(Float32, 4) + a = Memory{Float32}(v) + b = similar(a) + copyto!(b, a) + @test a == b + + c = Memory{Float32}(undef, 3) + @test_throws BoundsError copyto!(c, a) end @testset "with CartesianIndices" begin diff --git a/test/core.jl b/test/core.jl index 1d8e260fe4a0a..9efe3063c1797 100644 --- a/test/core.jl +++ b/test/core.jl @@ -6776,14 +6776,14 @@ primitive type TypeWith24Bits 24 end TypeWith24Bits(x::UInt32) = Core.Intrinsics.trunc_int(TypeWith24Bits, x) let x = TypeWith24Bits(0x112233), y = TypeWith24Bits(0x445566), z = TypeWith24Bits(0x778899) a = [x, x] - Core.memoryrefset!(Core.memoryref(a.ref, 2, true), y, :not_atomic, true) + Core.memoryrefset!(Core.memoryrefnew(a.ref, 2, true), y, :not_atomic, true) @test a == [x, y] a[2] = z @test a == [x, z] @test pointer(a, 2) - pointer(a, 1) == 4 b = [(x, x), (x, x)] - Core.memoryrefset!(Core.memoryref(b.ref, 2, true), (x, y), :not_atomic, true) + Core.memoryrefset!(Core.memoryrefnew(b.ref, 2, true), (x, y), :not_atomic, true) @test b == [(x, x), (x, y)] b[2] = (y, z) @test b == [(x, x), (y, z)] diff --git a/test/loading.jl b/test/loading.jl index cda7139e2d875..9207294a205b5 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -1206,36 +1206,42 @@ end empty!(Base.DEPOT_PATH) append!(Base.DEPOT_PATH, original_depot_path) +module loaded_pkgid1 end +module loaded_pkgid2 end +module loaded_pkgid3 end +module loaded_pkgid4 end + @testset "loading deadlock detector" begin pkid1 = Base.PkgId("pkgid1") pkid2 = Base.PkgId("pkgid2") pkid3 = Base.PkgId("pkgid3") pkid4 = Base.PkgId("pkgid4") + build_id = UInt128(0) e = Base.Event() - @test nothing === @lock Base.require_lock Base.start_loading(pkid4) # module pkgid4 - @test nothing === @lock Base.require_lock Base.start_loading(pkid1) # module pkgid1 + @test nothing === @lock Base.require_lock Base.start_loading(pkid4, build_id, false) # module pkgid4 + @test nothing === @lock Base.require_lock Base.start_loading(pkid1, build_id, false) # module pkgid1 t1 = @async begin - @test nothing === @lock Base.require_lock Base.start_loading(pkid2) # @async module pkgid2; using pkgid1; end + @test nothing === @lock Base.require_lock Base.start_loading(pkid2, build_id, false) # @async module pkgid2; using pkgid1; end notify(e) - @test "loaded_pkgid1" == @lock Base.require_lock Base.start_loading(pkid1) - @lock Base.require_lock Base.end_loading(pkid2, "loaded_pkgid2") + @test loaded_pkgid1 == @lock Base.require_lock Base.start_loading(pkid1, build_id, false) + @lock Base.require_lock Base.end_loading(pkid2, loaded_pkgid2) end wait(e) reset(e) t2 = @async begin - @test nothing === @lock Base.require_lock Base.start_loading(pkid3) # @async module pkgid3; using pkgid2; end + @test nothing === @lock Base.require_lock Base.start_loading(pkid3, build_id, false) # @async module pkgid3; using pkgid2; end notify(e) - @test "loaded_pkgid2" == @lock Base.require_lock Base.start_loading(pkid2) - @lock Base.require_lock Base.end_loading(pkid3, "loaded_pkgid3") + @test loaded_pkgid2 == @lock Base.require_lock Base.start_loading(pkid2, build_id, false) + @lock Base.require_lock Base.end_loading(pkid3, loaded_pkgid3) end wait(e) reset(e) @test_throws(ConcurrencyViolationError("deadlock detected in loading pkgid3 -> pkgid2 -> pkgid1 -> pkgid3 && pkgid4"), - @lock Base.require_lock Base.start_loading(pkid3)).value # try using pkgid3 + @lock Base.require_lock Base.start_loading(pkid3, build_id, false)).value # try using pkgid3 @test_throws(ConcurrencyViolationError("deadlock detected in loading pkgid4 -> pkgid4 && pkgid1"), - @lock Base.require_lock Base.start_loading(pkid4)).value # try using pkgid4 - @lock Base.require_lock Base.end_loading(pkid1, "loaded_pkgid1") # end - @lock Base.require_lock Base.end_loading(pkid4, "loaded_pkgid4") # end + @lock Base.require_lock Base.start_loading(pkid4, build_id, false)).value # try using pkgid4 + @lock Base.require_lock Base.end_loading(pkid1, loaded_pkgid1) # end + @lock Base.require_lock Base.end_loading(pkid4, loaded_pkgid4) # end wait(t2) wait(t1) end @@ -1541,7 +1547,29 @@ end end file = joinpath(depot, "dev", "non-existent.jl") - @test_throws SystemError("opening file $(repr(file))") include(file) + @test try + include(file); false + catch e + @test e isa SystemError + @test e.prefix == "opening file $(repr(file))" + true + end + touch(file) + @test include_dependency(file) === nothing + chmod(file, 0x000) + + # same for include_dependency: #52063 + dir = mktempdir() do dir + @test include_dependency(dir) === nothing + dir + end + @test try + include_dependency(dir); false + catch e + @test e isa SystemError + @test e.prefix == "opening file or folder $(repr(dir))" + true + end end end diff --git a/test/misc.jl b/test/misc.jl index d3c583faf8520..a257b0e79a4ac 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -1540,9 +1540,29 @@ end @testset "Base docstrings" begin undoc = Docs.undocumented_names(Base) @test_broken isempty(undoc) - @test undoc == [:BufferStream, :CanonicalIndexError, :CapturedException, :Filesystem, :IOServer, :InvalidStateException, :Order, :PipeEndpoint, :Sort, :TTY] + @test undoc == [:BufferStream, :CanonicalIndexError, :CapturedException, :Filesystem, :IOServer, :InvalidStateException, :Order, :PipeEndpoint, :ScopedValues, :Sort, :TTY] end @testset "Base.Libc docstrings" begin @test isempty(Docs.undocumented_names(Libc)) end + +@testset "Silenced missed transformations" begin + # Ensure the WarnMissedTransformationsPass is not on by default + src = """ + @noinline iteration(i) = (@show(i); return nothing) + @eval function loop_unroll_full_fail(N) + for i in 1:N + iteration(i) + \$(Expr(:loopinfo, (Symbol("llvm.loop.unroll.full"), 1))) + end + end + loop_unroll_full_fail(3) + """ + out_err = mktemp() do _, f + run(`$(Base.julia_cmd()) -e "$src"`, devnull, devnull, f) + seekstart(f) + read(f, String) + end + @test !occursin("loop not unrolled", out_err) +end diff --git a/test/precompile.jl b/test/precompile.jl index bc6a791627616..be894e5d26133 100644 --- a/test/precompile.jl +++ b/test/precompile.jl @@ -7,6 +7,8 @@ using Test, Distributed, Random, Logging using REPL # doc lookup function Foo_module = :Foo4b3a94a1a081a8cb +foo_incl_dep = :foo4b3a94a1a081a8cb +bar_incl_dep = :bar4b3a94a1a081a8cb Foo2_module = :F2oo4b3a94a1a081a8cb FooBase_module = :FooBase4b3a94a1a081a8cb @eval module ConflictingBindings @@ -102,6 +104,8 @@ precompile_test_harness(false) do dir Foo_file = joinpath(dir, "$Foo_module.jl") Foo2_file = joinpath(dir, "$Foo2_module.jl") FooBase_file = joinpath(dir, "$FooBase_module.jl") + foo_file = joinpath(dir, "$foo_incl_dep.jl") + bar_file = joinpath(dir, "$bar_incl_dep.jl") write(FooBase_file, """ @@ -150,11 +154,11 @@ precompile_test_harness(false) do dir # test that docs get reconnected @doc "foo function" foo(x) = x + 1 - include_dependency("foo.jl") - include_dependency("foo.jl") + include_dependency("$foo_incl_dep.jl") + include_dependency("$foo_incl_dep.jl") module Bar public bar - include_dependency("bar.jl") + include_dependency("$bar_incl_dep.jl") end @doc "Bar module" Bar # this needs to define the META dictionary via eval @eval Bar @doc "bar function" bar(x) = x + 2 @@ -297,6 +301,8 @@ precompile_test_harness(false) do dir oid_mat_int = objectid(a_mat_int) end """) + # Issue #52063 + touch(foo_file); touch(bar_file) # Issue #12623 @test __precompile__(false) === nothing @@ -436,8 +442,7 @@ precompile_test_harness(false) do dir modules, (deps, _, requires), required_modules, _... = Base.parse_cache_header(cachefile) discard_module = mod_fl_mt -> mod_fl_mt.filename @test modules == [ Base.PkgId(Foo) => Base.module_build_id(Foo) % UInt64 ] - # foo.jl and bar.jl are never written to disk, so they are not relocatable - @test map(x -> x.filename, deps) == [ Foo_file, joinpath("@depot", "foo.jl"), joinpath("@depot", "bar.jl") ] + @test map(x -> x.filename, deps) == [ Foo_file, joinpath("@depot", foo_file), joinpath("@depot", bar_file) ] @test requires == [ Base.PkgId(Foo) => Base.PkgId(string(FooBase_module)), Base.PkgId(Foo) => Base.PkgId(Foo2), Base.PkgId(Foo) => Base.PkgId(Test), @@ -446,7 +451,7 @@ precompile_test_harness(false) do dir @test !isempty(srctxt) && srctxt == read(Foo_file, String) @test_throws ErrorException Base.read_dependency_src(cachefile, "/tmp/nonexistent.txt") # dependencies declared with `include_dependency` should not be stored - @test_throws ErrorException Base.read_dependency_src(cachefile, joinpath(dir, "foo.jl")) + @test_throws ErrorException Base.read_dependency_src(cachefile, joinpath(dir, foo_file)) modules, deps1 = Base.cache_dependencies(cachefile) modules_ok = merge( @@ -634,13 +639,13 @@ precompile_test_harness(false) do dir empty_prefs_hash = Base.get_preferences_hash(nothing, String[]) @test cachefile == Base.compilecache_path(Base.PkgId("FooBar"), empty_prefs_hash) @test isfile(joinpath(cachedir, "FooBar.ji")) - Tsc = Bool(Base.JLOptions().use_pkgimages) ? Tuple{<:Vector, String} : Tuple{<:Vector, Nothing} + Tsc = Bool(Base.JLOptions().use_pkgimages) ? Tuple{<:Vector, String, UInt128} : Tuple{<:Vector, Nothing, UInt128} @test Base.stale_cachefile(FooBar_file, joinpath(cachedir, "FooBar.ji")) isa Tsc @test !isdefined(Main, :FooBar) @test !isdefined(Main, :FooBar1) relFooBar_file = joinpath(dir, "subfolder", "..", "FooBar.jl") - @test Base.stale_cachefile(relFooBar_file, joinpath(cachedir, "FooBar.ji")) isa (Sys.iswindows() ? Tuple{<:Vector, String} : Bool) # `..` is not a symlink on Windows + @test Base.stale_cachefile(relFooBar_file, joinpath(cachedir, "FooBar.ji")) isa (Sys.iswindows() ? Tuple{<:Vector, String, UInt128} : Bool) # `..` is not a symlink on Windows mkdir(joinpath(dir, "subfolder")) @test Base.stale_cachefile(relFooBar_file, joinpath(cachedir, "FooBar.ji")) isa Tsc @@ -1541,6 +1546,7 @@ precompile_test_harness("Issue #26028") do load_path module Foo26028 module Bar26028 x = 0 + y = 0 end function __init__() include(joinpath(@__DIR__, "Baz26028.jl")) @@ -1550,7 +1556,10 @@ precompile_test_harness("Issue #26028") do load_path write(joinpath(load_path, "Baz26028.jl"), """ module Baz26028 - import Foo26028.Bar26028.x + using Test + @test_throws(ConcurrencyViolationError("deadlock detected in loading Foo26028 -> Foo26028"), + @eval import Foo26028.Bar26028.x) + import ..Foo26028.Bar26028.y end """) Base.compilecache(Base.PkgId("Foo26028")) @@ -2111,6 +2120,46 @@ precompile_test_harness("Test flags") do load_path @test !Base.isprecompiled(id, ;flags=current_flags) end +precompile_test_harness("Issue #52063") do load_path + fname = joinpath(load_path, "i_do_not_exist.jl") + @test try + include_dependency(fname); false + catch e + @test e isa SystemError + @test e.prefix == "opening file or folder $(repr(fname))" + true + end + touch(fname) + @test include_dependency(fname) === nothing + chmod(fname, 0x000) + @test try + include_dependency(fname); false + catch e + @test e isa SystemError + @test e.prefix == "opening file or folder $(repr(fname))" + true + end broken=Sys.iswindows() + dir = mktempdir() do dir + @test include_dependency(dir) === nothing + chmod(dir, 0x000) + @test try + include_dependency(dir); false + catch e + @test e isa SystemError + @test e.prefix == "opening file or folder $(repr(dir))" + true + end broken=Sys.iswindows() + dir + end + @test try + include_dependency(dir); false + catch e + @test e isa SystemError + @test e.prefix == "opening file or folder $(repr(dir))" + true + end +end + empty!(Base.DEPOT_PATH) append!(Base.DEPOT_PATH, original_depot_path) empty!(Base.LOAD_PATH) diff --git a/test/reflection.jl b/test/reflection.jl index c4e941fa7bb1a..7a0fc9575f952 100644 --- a/test/reflection.jl +++ b/test/reflection.jl @@ -1193,3 +1193,5 @@ end @test Base.isexported(Mod52812, :b) @test Base.ispublic(Mod52812, :a) @test Base.ispublic(Mod52812, :b) + +@test methods(Union{}) == Any[m.method for m in Base._methods_by_ftype(Tuple{Core.TypeofBottom, Vararg}, 1, Base.get_world_counter())] # issue #55187 diff --git a/test/strings/annotated.jl b/test/strings/annotated.jl index 222d9addc910c..944608fa8c4a9 100644 --- a/test/strings/annotated.jl +++ b/test/strings/annotated.jl @@ -215,6 +215,12 @@ end @test write(aio2, Base.AnnotatedChar('c', [:b => 2, :c => 3, :d => 4])) == 1 @test Base.annotations(aio2) == [(1:2, :a => 1), (1:3, :b => 2), (3:3, :c => 3), (3:3, :d => 4)] end + let aio2 = Base.AnnotatedIOBuffer() + @test write(aio2, Base.AnnotatedChar('a', [:b => 1])) == 1 + @test write(aio2, Base.AnnotatedChar('b', [:a => 1, :b => 1])) == 1 + @test read(seekstart(aio2), Base.AnnotatedString) == + Base.AnnotatedString("ab", [(1:1, :b => 1), (2:2, :a => 1), (2:2, :b => 1)]) + end # Working through an IOContext aio = Base.AnnotatedIOBuffer() wrapio = IOContext(aio) diff --git a/test/syntax.jl b/test/syntax.jl index 2933ae1db1dfa..1a2d61e821ef1 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -3690,3 +3690,10 @@ begin Foreign54607.bar = 9 end @test Foreign54607.bar == 9 + +# Test that globals can be `using`'d even if they are not yet defined +module UndefGlobal54954 + global theglobal54954::Int +end +using .UndefGlobal54954: theglobal54954 +@test Core.get_binding_type(@__MODULE__, :theglobal54954) === Int diff --git a/test/threads_exec.jl b/test/threads_exec.jl index e18e4ad8809fb..9234aad1cf337 100644 --- a/test/threads_exec.jl +++ b/test/threads_exec.jl @@ -1122,23 +1122,25 @@ end # issue #41546, thread-safe package loading @testset "package loading" begin - ch = Channel{Bool}(threadpoolsize()) + ntasks = max(threadpoolsize(), 4) + ch = Channel{Bool}(ntasks) barrier = Base.Event() old_act_proj = Base.ACTIVE_PROJECT[] try pushfirst!(LOAD_PATH, "@") Base.ACTIVE_PROJECT[] = joinpath(@__DIR__, "TestPkg") @sync begin - for _ in 1:threadpoolsize() + for _ in 1:ntasks Threads.@spawn begin put!(ch, true) wait(barrier) @eval using TestPkg end end - for _ in 1:threadpoolsize() + for _ in 1:ntasks take!(ch) end + close(ch) notify(barrier) end @test Base.root_module(@__MODULE__, :TestPkg) isa Module