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 for 1.11.2 #56228

Open
wants to merge 29 commits into
base: release-1.11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
32bee7c
irrationals: restrict assume effects annotations to known types (#55886)
nsajko Oct 10, 2024
4fe24a2
update `hash` doc string: `widen` not required any more (#55867)
nsajko Oct 10, 2024
7c8fbbc
slightly improve inference in precompilation code (#56084)
KristofferC Oct 10, 2024
a36ea4c
make `Base.ANSIIterator` have a concrete field (#56088)
KristofferC Oct 11, 2024
7f6a080
Fix `JULIA_CPU_TARGET` being propagated to workers precompiling stdli…
KristofferC Oct 15, 2024
709e31c
Fix markdown list in installation.md (#56165)
abhro Oct 15, 2024
276e66c
Make loading work when stdlib deps are missing in the manifest (#56148)
IanButterworth Oct 15, 2024
b53bbe5
Fix implicit `convert(String, ...)` in several places (#56174)
topolarity Oct 16, 2024
b27d83e
Include default user depot when JULIA_DEPOT_PATH has leading empty en…
IanButterworth Oct 17, 2024
0bd77f5
[REPL] fix lock ordering mistake in load_pkg (#56215)
vtjnash Oct 17, 2024
9dda314
Add invalidation barriers for `displaysize` and `implicit_typeinfo` (…
topolarity Oct 15, 2024
415294a
Call `MulAddMul` instead of multiplication in _generic_matmatmul! (#5…
jishnub Oct 15, 2024
e20cc3e
Change annotation type to a NamedTuple
tecosaur Sep 11, 2024
b28fbd0
Bump StyledStrings
tecosaur Sep 20, 2024
48e1a72
Do not call `rand` during sysimage precompilation (#56227)
giordano Oct 18, 2024
581e65d
stream: fix reading LibuvStream into array (#56092)
vtjnash Oct 18, 2024
a10b94f
fix infinite recursion in `promote_type` for `Irrational` (#55870)
nsajko Oct 18, 2024
7d3cbd8
rename: invalid -> incompatible cache header (#56240)
IanButterworth Oct 19, 2024
6fadf5a
Restore support for checking for UndefVarError variable name in at-te…
nickrobinson251 Oct 19, 2024
aea077b
fix functional assert statements (#53737)
JeffBezanson Mar 18, 2024
d59df0b
Fix some typos in comments (#54149)
alongdate Apr 19, 2024
e91b8be
REPL: run repl hint generation for modeswitch chars when not switchin…
IanButterworth Oct 20, 2024
1f5c07f
🤖 [backports-release-1.11] Bump the Pkg stdlib from aba90d22b to 9438…
DilumAluthgeBot Oct 21, 2024
168f7e7
Specialize adding/subtracting mixed Upper/LowerTriangular (#56149)
jishnub Oct 21, 2024
cb575ab
Remove llvm-muladd pass and move it's functionality to to llvm-simdlo…
gbaraldi Oct 15, 2024
592152c
fix precompile process flag propagation (#56214)
vtjnash Oct 18, 2024
9c8e43b
Actually setup jit targets when compiling packageimages instead of ta…
IanButterworth Oct 21, 2024
0f09b9b
Make ASAN build not be debug, following clangs recommendation (#54094)
gbaraldi May 17, 2024
df61bb1
add Pkg 1.11 NEWS
IanButterworth Oct 21, 2024
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
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ Standard library changes
`length(::Stateful)` method. The last type parameter of `Stateful` is gone, too. Issue: ([#47790]),
PR: ([#51747]).

#### Package Manager

* It is now possible to specify "sources" for packages in a `[sources]` section in Project.toml.
This can be used to add non-registered normal or test dependencies.
* Pkg now obeys `[compat]` bounds for `julia` and raises an error if the version of the running Julia binary is incompatible with the bounds in `Project.toml`.
Pkg has always obeyed this compat when working with Registry packages. This change affects mostly local packages
* `pkg> add` and `Pkg.add` will now add compat entries for new direct dependencies if the active environment is a
package (has a `name` and `uuid` entry).
* Dependencies can now be directly added as weak deps or extras via the `pkg> add --weak/extra Foo` or
`Pkg.add("Foo", target=:weakdeps/:extras)` forms.

#### StyledStrings

* A new standard library for handling styling in a more comprehensive and structured way ([#49586]).
Expand Down
2 changes: 1 addition & 1 deletion base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ include("deepcopy.jl")
include("download.jl")
include("summarysize.jl")
include("errorshow.jl")
include("util.jl")

include("initdefs.jl")
Filesystem.__postinit__()
Expand All @@ -524,7 +525,6 @@ include("loading.jl")

# misc useful functions & macros
include("timing.jl")
include("util.jl")
include("client.jl")
include("asyncmap.jl")

Expand Down
11 changes: 11 additions & 0 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,17 @@ copy
return $(Expr(:new, :(typeof(a)), :(memoryref(newmem)), :(a.size)))
end

# a mutating version of copyto! that results in dst aliasing src afterwards
function _take!(dst::Array{T,N}, src::Array{T,N}) where {T,N}
if getfield(dst, :ref) !== getfield(src, :ref)
setfield!(dst, :ref, getfield(src, :ref))
end
if getfield(dst, :size) !== getfield(src, :size)
setfield!(dst, :size, getfield(src, :size))
end
return dst
end

## Constructors ##

similar(a::Array{T,1}) where {T} = Vector{T}(undef, size(a,1))
Expand Down
16 changes: 11 additions & 5 deletions base/arrayshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,12 @@ typeinfo_eltype(typeinfo::Type{<:AbstractArray{T}}) where {T} = eltype(typeinfo)
typeinfo_eltype(typeinfo::Type{<:AbstractDict{K,V}}) where {K,V} = eltype(typeinfo)
typeinfo_eltype(typeinfo::Type{<:AbstractSet{T}}) where {T} = eltype(typeinfo)

# This is a fancy way to make de-specialize a call to `typeinfo_implicit(T)`
# which is unfortunately invalidated by Dates
# (https://github.com/JuliaLang/julia/issues/56080)
#
# This makes the call less efficient, but avoids being invalidated by Dates.
_typeinfo_implicit(@nospecialize(T)) = Base.invoke_in_world(Base.tls_world_age(), typeinfo_implicit, T)::Bool

# types that can be parsed back accurately from their un-decorated representations
function typeinfo_implicit(@nospecialize(T))
Expand All @@ -553,9 +559,9 @@ function typeinfo_implicit(@nospecialize(T))
return true
end
return isconcretetype(T) &&
((T <: Array && typeinfo_implicit(eltype(T))) ||
((T <: Tuple || T <: Pair) && all(typeinfo_implicit, fieldtypes(T))) ||
(T <: AbstractDict && typeinfo_implicit(keytype(T)) && typeinfo_implicit(valtype(T))))
((T <: Array && _typeinfo_implicit(eltype(T))) ||
((T <: Tuple || T <: Pair) && all(_typeinfo_implicit, fieldtypes(T))) ||
(T <: AbstractDict && _typeinfo_implicit(keytype(T)) && _typeinfo_implicit(valtype(T))))
end

# X not constrained, can be any iterable (cf. show_vector)
Expand All @@ -573,7 +579,7 @@ function typeinfo_prefix(io::IO, X)
if X isa AbstractDict
if eltype_X == eltype_ctx
sprint(show_type_name, typeof(X).name; context=io), false
elseif !isempty(X) && typeinfo_implicit(keytype(X)) && typeinfo_implicit(valtype(X))
elseif !isempty(X) && _typeinfo_implicit(keytype(X)) && _typeinfo_implicit(valtype(X))
sprint(show_type_name, typeof(X).name; context=io), true
else
sprint(print, typeof(X); context=io), false
Expand All @@ -582,7 +588,7 @@ function typeinfo_prefix(io::IO, X)
# Types hard-coded here are those which are created by default for a given syntax
if eltype_X == eltype_ctx
"", false
elseif !isempty(X) && typeinfo_implicit(eltype_X)
elseif !isempty(X) && _typeinfo_implicit(eltype_X)
"", true
elseif print_without_params(eltype_X)
sprint(show_type_name, unwrap_unionall(eltype_X).name; context=io), false # Print "Array" rather than "Array{T,N}"
Expand Down
4 changes: 1 addition & 3 deletions base/hashing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ optional second argument `h` is another hash code to be mixed with the result.
New types should implement the 2-argument form, typically by calling the 2-argument `hash`
method recursively in order to mix hashes of the contents with each other (and with `h`).
Typically, any type that implements `hash` should also implement its own [`==`](@ref) (hence
[`isequal`](@ref)) to guarantee the property mentioned above. Types supporting subtraction
(operator `-`) should also implement [`widen`](@ref), which is required to hash
values inside heterogeneous arrays.
[`isequal`](@ref)) to guarantee the property mentioned above.

The hash value may change when a new Julia process is started.

Expand Down
11 changes: 7 additions & 4 deletions base/initdefs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,23 @@ function init_depot_path()

# otherwise, populate the depot path with the entries in JULIA_DEPOT_PATH,
# expanding empty strings to the bundled depot
populated = false
for path in eachsplit(str, Sys.iswindows() ? ';' : ':')
pushfirst_default = true
for (i, path) in enumerate(eachsplit(str, Sys.iswindows() ? ';' : ':'))
if isempty(path)
append_bundled_depot_path!(DEPOT_PATH)
else
path = expanduser(path)
path in DEPOT_PATH || push!(DEPOT_PATH, path)
populated = true
if i == 1
# if a first entry is given, don't add the default depot at the start
pushfirst_default = false
end
end
end

# backwards compatibility: if JULIA_DEPOT_PATH only contains empty entries
# (e.g., JULIA_DEPOT_PATH=':'), make sure to use the default depot
if !populated
if pushfirst_default
pushfirst!(DEPOT_PATH, joinpath(homedir(), ".julia"))
end
else
Expand Down
33 changes: 24 additions & 9 deletions base/irrationals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,22 @@ promote_rule(::Type{<:AbstractIrrational}, ::Type{Float16}) = Float16
promote_rule(::Type{<:AbstractIrrational}, ::Type{Float32}) = Float32
promote_rule(::Type{<:AbstractIrrational}, ::Type{<:AbstractIrrational}) = Float64
promote_rule(::Type{<:AbstractIrrational}, ::Type{T}) where {T<:Real} = promote_type(Float64, T)
promote_rule(::Type{S}, ::Type{T}) where {S<:AbstractIrrational,T<:Number} = promote_type(promote_type(S, real(T)), T)

function promote_rule(::Type{S}, ::Type{T}) where {S<:AbstractIrrational,T<:Number}
U = promote_type(S, real(T))
if S <: U
# prevent infinite recursion
promote_type(Float64, T)
else
promote_type(U, T)
end
end

AbstractFloat(x::AbstractIrrational) = Float64(x)::Float64
Float16(x::AbstractIrrational) = Float16(Float32(x)::Float32)
Complex{T}(x::AbstractIrrational) where {T<:Real} = Complex{T}(T(x))

# XXX this may change `DEFAULT_PRECISION`, thus not effect free
@assume_effects :total function Rational{T}(x::AbstractIrrational) where T<:Integer
function _irrational_to_rational(::Type{T}, x::AbstractIrrational) where T<:Integer
o = precision(BigFloat)
p = 256
while true
Expand All @@ -66,13 +74,16 @@ Complex{T}(x::AbstractIrrational) where {T<:Real} = Complex{T}(T(x))
p += 32
end
end
Rational{BigInt}(x::AbstractIrrational) = throw(ArgumentError("Cannot convert an AbstractIrrational to a Rational{BigInt}: use rationalize(BigInt, x) instead"))
Rational{T}(x::AbstractIrrational) where {T<:Integer} = _irrational_to_rational(T, x)
_throw_argument_error_irrational_to_rational_bigint() = throw(ArgumentError("Cannot convert an AbstractIrrational to a Rational{BigInt}: use rationalize(BigInt, x) instead"))
Rational{BigInt}(::AbstractIrrational) = _throw_argument_error_irrational_to_rational_bigint()

@assume_effects :total function (t::Type{T})(x::AbstractIrrational, r::RoundingMode) where T<:Union{Float32,Float64}
function _irrational_to_float(::Type{T}, x::AbstractIrrational, r::RoundingMode) where T<:Union{Float32,Float64}
setprecision(BigFloat, 256) do
T(BigFloat(x)::BigFloat, r)
end
end
(::Type{T})(x::AbstractIrrational, r::RoundingMode) where {T<:Union{Float32,Float64}} = _irrational_to_float(T, x, r)

float(::Type{<:AbstractIrrational}) = Float64

Expand Down Expand Up @@ -110,14 +121,18 @@ end
<=(x::AbstractFloat, y::AbstractIrrational) = x < y

# Irrational vs Rational
@assume_effects :total function rationalize(::Type{T}, x::AbstractIrrational; tol::Real=0) where T
function _rationalize_irrational(::Type{T}, x::AbstractIrrational, tol::Real) where {T<:Integer}
return rationalize(T, big(x), tol=tol)
end
@assume_effects :total function lessrational(rx::Rational{<:Integer}, x::AbstractIrrational)
# an @assume_effects :total version of `<` for determining if the rationalization of
# an irrational number required rounding up or down
function rationalize(::Type{T}, x::AbstractIrrational; tol::Real=0) where {T<:Integer}
return _rationalize_irrational(T, x, tol)
end
function _lessrational(rx::Rational, x::AbstractIrrational)
return rx < big(x)
end
function lessrational(rx::Rational, x::AbstractIrrational)
return _lessrational(rx, x)
end
function <(x::AbstractIrrational, y::Rational{T}) where T
T <: Unsigned && x < 0.0 && return true
rx = rationalize(T, x)
Expand Down
Loading