Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports release 1.10 #51563

Merged
merged 46 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9c4cedc
Use rr-safe `nopl; rdtsc` sequence (#50975)
Keno Aug 20, 2023
b248b6b
Avoid infinite loop when doing SIGTRAP in arm64-apple (#51284)
gbaraldi Sep 14, 2023
4f6a4f4
[Random] Add s4 field to Xoshiro type (#51332)
nhz2 Sep 15, 2023
0c39aef
call Pkg precompile hook in latest world (#51397)
KristofferC Sep 20, 2023
77b74c3
Remove fallback that assigns a module to inlined frames. (#51405)
BioTurboNick Sep 28, 2023
765c1af
Throw clearer ArgumentError for strip with two string args (#51491)
IanButterworth Sep 28, 2023
4dc08dc
fix `_tryonce_download_from_cache` (busybox.exe download error) (#51531)
IanButterworth Sep 30, 2023
0e9addd
Fix string index error in tab completion code, fixes #51540 (#51541)
jakobnissen Oct 2, 2023
e1f1cc8
Don't mark nonlocal symbols as hidden (#51530)
pchintalapudi Oct 2, 2023
37a1b6f
make `hash(::Xoshiro)` compatible with `==` (#51376)
rfourquet Sep 22, 2023
510550b
Fix last startup & shutdown precompiles (#51557)
IanButterworth Oct 4, 2023
8cb3197
complete false & true more generally as vals (#51326)
IanButterworth Sep 15, 2023
ddec9e4
Revert "Don't mark nonlocal symbols as hidden (#51530)"
IanButterworth Oct 4, 2023
674f440
avoid limiting Type{Any} to Type (#51512)
vtjnash Oct 5, 2023
1e95bf8
reset `maxprobe` on `empty!` (#51595)
oscardssmith Oct 5, 2023
8c387e3
Aggressive constprop in LinearAlgebra.wrap (#51582)
jishnub Oct 5, 2023
b3898c3
correctly track element pointer in heap snapshot (#51592)
d-netto Oct 5, 2023
2523d15
fix annotations on `sym_in` (#51573)
JeffBezanson Oct 4, 2023
b01e7e5
Merge branch 'release-1.10' into backports-release-1.10
IanButterworth Oct 11, 2023
d117058
[LibCURL_jll] Upgrade to v8.4.0 (#51667)
KristofferC Oct 11, 2023
110e9ba
Handle infix operators in REPL completion (#51366)
Liozou Oct 12, 2023
d4809e5
Upgrade SuiteSparse to 7.2.1
ViralBShah Oct 16, 2023
3b97715
Test for reverting back to 1.8 GC heuristics (#51661)
d-netto Oct 20, 2023
f2c447d
bump SparseArrays to latest release-1.10
Oct 23, 2023
4d3022e
Handle `AbstractQ` in concatenation (#51132)
dkarrasch Sep 27, 2023
78b7a21
Allow tab after key name in TOML.parse (#51622)
jaakkor2 Oct 11, 2023
5f8f33b
Allow using `ReturnNode()` in `@generated` code (#51715)
Pangoraw Oct 16, 2023
516725d
Lower Pidfile stale_age multiplier. Add pidfile to cache log message.…
IanButterworth Oct 16, 2023
8329725
codegen: fix gc rooting bug (#51744)
vtjnash Oct 18, 2023
c426095
limit TimeType subtraction (#51743)
JeffBezanson Oct 18, 2023
bd99491
fix unicode indexing in parse(Complex, string) (#51758)
stevengj Oct 20, 2023
d2a66d8
Don't make pkgimages global editable (#51781)
gbaraldi Oct 23, 2023
e862940
Revert "bump SparseArrays to latest release-1.10"
Oct 23, 2023
5ded9ab
bump SparseArrays to latest release-1.10
Oct 24, 2023
be97eb7
Fix typo in range display (#51832)
LilithHafner Oct 24, 2023
7ae1535
Make local scope for `else` blocks in `try`/`catch`/`else` (#51785)
Pangoraw Oct 24, 2023
4e1759c
fix eltype for partition iterators of substrings (#51773)
KristofferC Oct 23, 2023
a599ed4
[release 1.10] trigger a full sweep if beyond max total memory (#51843)
d-netto Oct 24, 2023
ac2593a
inference: fix infinite recursion of nested Generators (#51845)
vtjnash Oct 25, 2023
f3e683d
LLVM: Activate typed pointers through the API instead of a global opt…
maleadt Oct 25, 2023
1977e1f
fixup to #51743, timetype subtraction
JeffBezanson Oct 26, 2023
1fe4e26
Backport LLVM 15.0.7-9 to 1.10 (#51882)
vchuravy Oct 27, 2023
cba88c1
Backport "Fix Expr(:loopinfo) codegen" (#51883)
vchuravy Oct 28, 2023
0edde83
fixup to #51743, timetype subtraction
JeffBezanson Oct 26, 2023
4770eea
remove chmodding the pkgimages (#51885)
KristofferC Oct 31, 2023
81d8c12
🤖 [backports-release-1.10] Bump the Pkg stdlib from 9261a54d3 to e63c…
DilumAluthgeBot Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1811,17 +1811,16 @@ function __cat_offset1!(A, shape, catdims, offsets, x)
inds = ntuple(length(offsets)) do i
(i <= length(catdims) && catdims[i]) ? offsets[i] .+ cat_indices(x, i) : 1:shape[i]
end
if x isa AbstractArray
A[inds...] = x
else
fill!(view(A, inds...), x)
end
_copy_or_fill!(A, inds, x)
newoffsets = ntuple(length(offsets)) do i
(i <= length(catdims) && catdims[i]) ? offsets[i] + cat_size(x, i) : offsets[i]
end
return newoffsets
end

_copy_or_fill!(A, inds, x) = fill!(view(A, inds...), x)
_copy_or_fill!(A, inds, x::AbstractArray) = (A[inds...] = x)

"""
vcat(A...)

Expand Down
15 changes: 1 addition & 14 deletions base/compiler/typelimits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ function _limit_type_size(@nospecialize(t), @nospecialize(c), sources::SimpleVec
ct = Union{}
end
Qt = __limit_type_size(tt, ct, sources, depth + 1, 0)
Qt === Any && return Type
Qt === tt && return t
Qt === Any && return Type
# Can't form Type{<:Qt} just yet, without first make sure we limited the depth
# enough, since this moves Qt outside of Type for is_derived_type_from_any
Qt = __limit_type_size(tt, ct, sources, depth + 2, 0)
Expand Down Expand Up @@ -277,22 +277,9 @@ function type_more_complex(@nospecialize(t), @nospecialize(c), sources::SimpleVe
else
tupledepth = 0
end
isgenerator = (t.name.name === :Generator && t.name.module === _topmod(t.name.module))
for i = 1:length(tP)
tPi = tP[i]
cPi = cP[i + ntail]
if isgenerator
let tPi = unwrap_unionall(tPi),
cPi = unwrap_unionall(cPi)
if isa(tPi, DataType) && isa(cPi, DataType) &&
!isabstracttype(tPi) && !isabstracttype(cPi) &&
sym_isless(cPi.name.name, tPi.name.name)
# allow collect on (anonymous) Generators to nest, provided that their functions are appropriately ordered
# TODO: is there a better way?
continue
end
end
end
type_more_complex(tPi, cPi, sources, depth + 1, tupledepth, 0) && return true
end
return false
Expand Down
3 changes: 1 addition & 2 deletions base/compiler/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ end
is_meta_expr_head(head::Symbol) = head === :boundscheck || head === :meta || head === :loopinfo
is_meta_expr(@nospecialize x) = isa(x, Expr) && is_meta_expr_head(x.head)

sym_isless(a::Symbol, b::Symbol) = ccall(:strcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}), a, b) < 0

function is_self_quoting(@nospecialize(x))
return isa(x,Number) || isa(x,AbstractString) || isa(x,Tuple) || isa(x,Type) ||
isa(x,Char) || x === nothing || isa(x,Function)
Expand Down Expand Up @@ -390,6 +388,7 @@ function find_ssavalue_uses(body::Vector{Any}, nvals::Int)
for line in 1:length(body)
e = body[line]
if isa(e, ReturnNode)
isdefined(e, :val) || continue
e = e.val
elseif isa(e, GotoIfNot)
e = e.cond
Expand Down
2 changes: 2 additions & 0 deletions base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ end
resize!(h.keys, newsz)
resize!(h.vals, newsz)
h.ndel = 0
h.maxprobe = 0
return h
end

Expand Down Expand Up @@ -251,6 +252,7 @@ function empty!(h::Dict{K,V}) where V where K
resize!(h.vals, sz)
h.ndel = 0
h.count = 0
h.maxprobe = 0
h.age += 1
h.idxfloor = sz
return h
Expand Down
27 changes: 12 additions & 15 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ function _require(pkg::PkgId, env=nothing)
pkg_precompile_attempted = true
unlock(require_lock)
try
PKG_PRECOMPILE_HOOK[](pkg.name, _from_loading = true)
@invokelatest PKG_PRECOMPILE_HOOK[](pkg.name, _from_loading = true)
finally
lock(require_lock)
end
Expand Down Expand Up @@ -2398,12 +2398,6 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in

# inherit permission from the source file (and make them writable)
chmod(tmppath, filemode(path) & 0o777 | 0o200)
if cache_objects
# Ensure that the user can execute the `.so` we're generating
# Note that on windows, `filemode(path)` typically returns `0o666`, so this
# addition of the execute bit for the user is doubly needed.
chmod(tmppath_so, filemode(path) & 0o777 | 0o333)
end

# prune the directory with cache files
if pkg.uuid !== nothing
Expand Down Expand Up @@ -2967,24 +2961,27 @@ global parse_pidfile_hook
# the same package cannot be precompiled from different projects and/or different preferences at the same time.
compilecache_pidfile_path(pkg::PkgId) = compilecache_path(pkg, UInt64(0); project="") * ".pidfile"

const compilecache_pidlock_stale_age = 10

# Allows processes to wait if another process is precompiling a given source already.
# The lock file mtime will be updated when held every `stale_age/2` seconds.
# The lock file mtime will be updated when held at most every `stale_age/2` seconds, with expected
# variance of 10 seconds or more being infrequent but not unusual.
# After `stale_age` seconds beyond the mtime of the lock file, the lock file is deleted and
# precompilation will proceed if
# - the locking process no longer exists
# - the lock is held by another host, since processes cannot be checked remotely
# or after `stale_age * 25` seconds if the process does still exist.
function maybe_cachefile_lock(f, pkg::PkgId, srcpath::String; stale_age=10)
# precompilation will proceed if the locking process no longer exists or after `stale_age * 5`
# seconds if the process does still exist.
# If the lock is held by another host, it will conservatively wait `stale_age * 5`
# seconds since processes cannot be checked remotely
function maybe_cachefile_lock(f, pkg::PkgId, srcpath::String; stale_age=compilecache_pidlock_stale_age)
if @isdefined(mkpidlock_hook) && @isdefined(trymkpidlock_hook) && @isdefined(parse_pidfile_hook)
pidfile = compilecache_pidfile_path(pkg)
cachefile = invokelatest(trymkpidlock_hook, f, pidfile; stale_age)
if cachefile === false
pid, hostname, age = invokelatest(parse_pidfile_hook, pidfile)
verbosity = isinteractive() ? CoreLogging.Info : CoreLogging.Debug
if isempty(hostname) || hostname == gethostname()
@logmsg verbosity "Waiting for another process (pid: $pid) to finish precompiling $pkg"
@logmsg verbosity "Waiting for another process (pid: $pid) to finish precompiling $pkg. Pidfile: $pidfile"
else
@logmsg verbosity "Waiting for another machine (hostname: $hostname, pid: $pid) to finish precompiling $pkg"
@logmsg verbosity "Waiting for another machine (hostname: $hostname, pid: $pid) to finish precompiling $pkg. Pidfile: $pidfile"
end
# wait until the lock is available, but don't actually acquire it
# returning nothing indicates a process waited for another
Expand Down
10 changes: 5 additions & 5 deletions base/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@ function tryparse_internal(::Type{Complex{T}}, s::Union{String,SubString{String}
if i₊ == i # leading ± sign
i₊ = something(findnext(in(('+','-')), s, i₊+1), 0)
end
if i₊ != 0 && s[i₊-1] in ('e','E') # exponent sign
if i₊ != 0 && s[prevind(s, i₊)] in ('e','E') # exponent sign
i₊ = something(findnext(in(('+','-')), s, i₊+1), 0)
end

# find trailing im/i/j
iᵢ = something(findprev(in(('m','i','j')), s, e), 0)
if iᵢ > 0 && s[iᵢ] == 'm' # im
iᵢ -= 1
iᵢ = prevind(s, iᵢ)
if s[iᵢ] != 'i'
raise && throw(ArgumentError("expected trailing \"im\", found only \"m\""))
return nothing
Expand All @@ -337,7 +337,7 @@ function tryparse_internal(::Type{Complex{T}}, s::Union{String,SubString{String}

if i₊ == 0 # purely real or imaginary value
if iᵢ > i && !(iᵢ == i+1 && s[i] in ('+','-')) # purely imaginary (not "±inf")
x = tryparse_internal(T, s, i, iᵢ-1, raise)
x = tryparse_internal(T, s, i, prevind(s, iᵢ), raise)
x === nothing && return nothing
return Complex{T}(zero(x),x)
else # purely real
Expand All @@ -353,11 +353,11 @@ function tryparse_internal(::Type{Complex{T}}, s::Union{String,SubString{String}
end

# parse real part
re = tryparse_internal(T, s, i, i₊-1, raise)
re = tryparse_internal(T, s, i, prevind(s, i₊), raise)
re === nothing && return nothing

# parse imaginary part
im = tryparse_internal(T, s, i₊+1, iᵢ-1, raise)
im = tryparse_internal(T, s, i₊+1, prevind(s, iᵢ), raise)
im === nothing && return nothing

return Complex{T}(re, s[i₊]=='-' ? -im : im)
Expand Down
2 changes: 1 addition & 1 deletion base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ function show(io::IO, r::LinRange{T}) where {T}
print(io, "LinRange{")
show(io, T)
print(io, "}(")
ioc = IOContext(io, :typeinto=>T)
ioc = IOContext(io, :typeinfo=>T)
show(ioc, first(r))
print(io, ", ")
show(ioc, last(r))
Expand Down
1 change: 0 additions & 1 deletion base/stacktraces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ Base.@constprop :none function lookup(pointer::Ptr{Cvoid})
elseif miroots !== nothing
linfo = lookup_inline_frame_info(func, file, miroots)
end
linfo = linfo === nothing ? parentmodule(res[i + 1]) : linfo # e.g. `macro expansion`
end
res[i] = StackFrame(func, file, linenum, linfo, info[5]::Bool, info[6]::Bool, pointer)
end
Expand Down
6 changes: 6 additions & 0 deletions base/strings/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ function lstrip(f, s::AbstractString)
end
lstrip(s::AbstractString) = lstrip(isspace, s)
lstrip(s::AbstractString, chars::Chars) = lstrip(in(chars), s)
lstrip(::AbstractString, ::AbstractString) = throw(ArgumentError("Both arguments are strings. The second argument should be a `Char` or collection of `Char`s"))

"""
rstrip([pred=isspace,] str::AbstractString) -> SubString
Expand Down Expand Up @@ -402,6 +403,8 @@ function rstrip(f, s::AbstractString)
end
rstrip(s::AbstractString) = rstrip(isspace, s)
rstrip(s::AbstractString, chars::Chars) = rstrip(in(chars), s)
rstrip(::AbstractString, ::AbstractString) = throw(ArgumentError("Both arguments are strings. The second argument should be a `Char` or collection of `Char`s"))


"""
strip([pred=isspace,] str::AbstractString) -> SubString
Expand Down Expand Up @@ -429,6 +432,7 @@ julia> strip("{3, 5}\\n", ['{', '}', '\\n'])
"""
strip(s::AbstractString) = lstrip(rstrip(s))
strip(s::AbstractString, chars::Chars) = lstrip(rstrip(s, chars), chars)
strip(::AbstractString, ::AbstractString) = throw(ArgumentError("Both arguments are strings. The second argument should be a `Char` or collection of `Char`s"))
strip(f, s::AbstractString) = lstrip(f, rstrip(f, s))

## string padding functions ##
Expand Down Expand Up @@ -567,6 +571,8 @@ end

# Specialization for partition(s,n) to return a SubString
eltype(::Type{PartitionIterator{T}}) where {T<:AbstractString} = SubString{T}
# SubStrings do not nest
eltype(::Type{PartitionIterator{T}}) where {T<:SubString} = T

function iterate(itr::PartitionIterator{<:AbstractString}, state = firstindex(itr.c))
state > ncodeunits(itr.c) && return nothing
Expand Down
2 changes: 1 addition & 1 deletion base/toml_parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ function _parse_key(l::Parser)
else
set_marker!(l)
if accept_batch(l, isvalid_barekey_char)
if !(peek(l) == '.' || peek(l) == ' ' || peek(l) == ']' || peek(l) == '=')
if !(peek(l) == '.' || iswhitespace(peek(l)) || peek(l) == ']' || peek(l) == '=')
c = eat_char(l)
return ParserError(ErrInvalidBareKeyCharacter, c)
end
Expand Down
5 changes: 3 additions & 2 deletions base/tuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -606,14 +606,15 @@ any(x::Tuple{Bool, Bool}) = x[1]|x[2]
any(x::Tuple{Bool, Bool, Bool}) = x[1]|x[2]|x[3]

# a version of `in` esp. for NamedTuple, to make it pure, and not compiled for each tuple length
function sym_in(x::Symbol, @nospecialize itr::Tuple{Vararg{Symbol}})
function sym_in(x::Symbol, itr::Tuple{Vararg{Symbol}})
@noinline
@_total_meta
for y in itr
y === x && return true
end
return false
end
in(x::Symbol, @nospecialize itr::Tuple{Vararg{Symbol}}) = sym_in(x, itr)
in(x::Symbol, itr::Tuple{Vararg{Symbol}}) = sym_in(x, itr)


"""
Expand Down
4 changes: 3 additions & 1 deletion contrib/generate_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const fancyprint = (stdout isa Base.TTY) && Base.get_bool_env("CI", false) !== t
##

CTRL_C = '\x03'
CTRL_D = '\x04'
CTRL_R = '\x12'
UP_ARROW = "\e[A"
DOWN_ARROW = "\e[B"
Expand All @@ -44,6 +45,7 @@ precompile(Tuple{typeof(delete!), Dict{Base.PkgId,Vector{Function}}, Base.PkgId}
precompile(Tuple{typeof(push!), Vector{Function}, Function})

# miscellaneous
precompile(Tuple{typeof(Base.exit)})
precompile(Tuple{typeof(Base.require), Base.PkgId})
precompile(Tuple{typeof(Base.recursive_prefs_merge), Base.Dict{String, Any}})
precompile(Tuple{typeof(Base.recursive_prefs_merge), Base.Dict{String, Any}, Base.Dict{String, Any}, Vararg{Base.Dict{String, Any}}})
Expand Down Expand Up @@ -373,7 +375,7 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
end
end
end
write(ptm, "exit()\n")
write(ptm, "$CTRL_D")
wait(tee)
success(p) || Base.pipeline_error(p)
close(ptm)
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a68258944ba3c7b8a31864ad5dc6e320
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e7ea74323f873e6ff0b92b19d368a16df768f21474222ef38918d36d827c92a5597e7fa243e9ef985b02f3bcf65d41904cfeeae9aca64612fdfbb9483c3cbd12

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
85c5dcb49f11bce2d6bb75ef620ea892
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a1810991895650263c33c3e9c2b3089c66948b86b4de16c4c06ed49841cf5500814641576a6b735d5cf3841991684e908c4828a56ee218be216424e6aa9d5f43
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
46541001073d1c3c85e18d910f8308f3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f7470a447b934ca9315e216a07b97e363f11bc93186f9aa057b20b2d05092c58ae4f1b733de362de4a0730861c00be4ca5588d0b3ba65f018c1798b9122b9672
Loading