Skip to content

Commit 213bf5f

Browse files
authored
Merge pull request #43084 from JuliaLang/backports-release-1.7
release-1.7: Backports for 1.7.0/1.7.0-rc4
2 parents 3348de4 + 7f29663 commit 213bf5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+535
-179
lines changed

.buildkite/pipelines/main/platforms/tester_linux.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ steps:
6969
export NETWORK_RELATED_TESTS="Artifacts Downloads download LazyArtifacts LibGit2/online Pkg"
7070
7171
if [[ "${GROUP?}" == "all" ]]; then
72-
export TESTS="all LibGit2/online --force-net"
72+
export TESTS="all LibGit2/online --ci"
7373
elif [[ "${GROUP?}" == "all_except_pkg" ]]; then
74-
export TESTS="all LibGit2/online --force-net --skip Pkg"
74+
export TESTS="all LibGit2/online --ci --skip Pkg"
7575
elif [[ "${GROUP?}" == "g1" ]]; then
7676
# Group 1: ALL tests EXCEPT the network-related tests.
77-
export TESTS="all --force-net --skip $${NETWORK_RELATED_TESTS:?}"
77+
export TESTS="all --ci --skip $${NETWORK_RELATED_TESTS:?}"
7878
elif [[ "${GROUP?}" == "g2" ]]; then
7979
# Group 2: ONLY the network-related tests.
8080
# In Group 2, we use whatever the default setting is with regards to the Pkg server.
81-
export TESTS="$${NETWORK_RELATED_TESTS:?} --force-net"
81+
export TESTS="$${NETWORK_RELATED_TESTS:?} --ci"
8282
elif [[ "${GROUP?}" == "g3" ]]; then
8383
# Group 3: only Pkg.
8484
# In Group 3, we explicitly opt-out of the Pkg server.
8585
# The purpose of group 3 is to test the non-Pkg-server codepaths of Pkg.
86-
export TESTS="Pkg --force-net"
86+
export TESTS="Pkg --ci"
8787
export JULIA_PKG_SERVER=""
8888
else
8989
echo "Invalid value for GROUP: ${GROUP?}"

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,10 @@ endif
461461
-ls stdlib/srccache/*.tar.gz >> light-source-dist.tmp
462462
-ls stdlib/*/StdlibArtifacts.toml >> light-source-dist.tmp
463463

464-
# Exclude git, github and CI config files
465-
git ls-files | sed -E -e '/^\..+/d' -e '/\/\..+/d' -e '/appveyor.yml/d' >> light-source-dist.tmp
464+
# Include all git-tracked filenames
465+
git ls-files >> light-source-dist.tmp
466+
467+
# Include documentation filenames
466468
find doc/_build/html >> light-source-dist.tmp
467469

468470
# Make tarball with only Julia code + stdlib tarballs

base/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,19 @@ SYMLINK_SYSTEM_LIBRARIES += symlink_$2
185185
endif
186186
endef
187187

188+
# libexec executables
189+
symlink_p7zip: $(build_bindir)/7z$(EXE)
190+
191+
ifneq ($(USE_SYSTEM_P7ZIP),0)
192+
SYMLINK_SYSTEM_LIBRARIES += symlink_p7zip
193+
7Z_PATH := $(shell which 7z$(EXE))
194+
endif
195+
196+
$(build_bindir)/7z$(EXE):
197+
[ -e "$(7Z_PATH)" ] && \
198+
([ ! -e "$@" ] || rm "$@") && \
199+
ln -svf "$(7Z_PATH)" "$@"
200+
188201
# the following excludes: libuv.a, libutf8proc.a
189202

190203
ifneq ($(USE_SYSTEM_LIBM),0)

base/compiler/abstractinterpretation.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,9 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f),
12531253
return abstract_modifyfield!(interp, argtypes, sv)
12541254
end
12551255
return CallMeta(abstract_call_builtin(interp, f, fargs, argtypes, sv, max_methods), false)
1256+
elseif isa(f, Core.OpaqueClosure)
1257+
# calling an OpaqueClosure about which we have no information returns no information
1258+
return CallMeta(Any, false)
12561259
elseif f === Core.kwfunc
12571260
if la == 2
12581261
aty = argtypes[2]
@@ -1380,8 +1383,8 @@ function abstract_call(interp::AbstractInterpreter, fargs::Union{Nothing,Vector{
13801383
f = argtype_to_function(ft)
13811384
if isa(ft, PartialOpaque)
13821385
return abstract_call_opaque_closure(interp, ft, argtypes[2:end], sv)
1383-
elseif (uft = unwrap_unionall(ft); isa(uft, DataType) && uft.name === typename(Core.OpaqueClosure))
1384-
return CallMeta(rewrap_unionall((uft::DataType).parameters[2], ft), false)
1386+
elseif (uft = unwrap_unionall(widenconst(ft)); isa(uft, DataType) && uft.name === typename(Core.OpaqueClosure))
1387+
return CallMeta(rewrap_unionall((uft::DataType).parameters[2], widenconst(ft)), false)
13851388
elseif f === nothing
13861389
# non-constant function, but the number of arguments is known
13871390
# and the ft is not a Builtin or IntrinsicFunction

base/compiler/ssair/show.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function print_stmt(io::IO, idx::Int, @nospecialize(stmt), used::BitSet, maxleng
4747
# XXX: this is wrong if `sig` is not a concretetype method
4848
# more correct would be to use `fieldtype(sig, i)`, but that would obscure / discard Varargs information in show
4949
sig = linfo.specTypes == Tuple ? Core.svec() : Base.unwrap_unionall(linfo.specTypes).parameters::Core.SimpleVector
50-
print_arg(i) = sprint() do io
50+
print_arg(i) = sprint(; context=io) do io
5151
show_unquoted(io, stmt.args[i], indent)
5252
if (i - 1) <= length(sig)
5353
print(io, "::", sig[i - 1])
@@ -82,7 +82,7 @@ function show_unquoted_phinode(io::IO, stmt::PhiNode, indent::Int, prefix::Strin
8282
args = String[let
8383
e = stmt.edges[i]
8484
v = !isassigned(stmt.values, i) ? "#undef" :
85-
sprint() do io′
85+
sprint(; context=io) do io′
8686
show_unquoted(io′, stmt.values[i], indent)
8787
end
8888
"$prefix$e => $v"

base/loading.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,8 +1866,9 @@ function stale_cachefile(modpath::String, cachefile::String; ignore_loaded = fal
18661866
f, ftime_req = chi.filename, chi.mtime
18671867
# Issue #13606: compensate for Docker images rounding mtimes
18681868
# Issue #20837: compensate for GlusterFS truncating mtimes to microseconds
1869+
# The `ftime != 1.0` condition below provides compatibility with Nix mtime.
18691870
ftime = mtime(f)
1870-
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6)
1871+
if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) && ftime != 1.0
18711872
@debug "Rejecting stale cache file $cachefile (mtime $ftime_req) because file $f (mtime $ftime) has changed"
18721873
return true
18731874
end

base/mpfr.jl

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,23 @@ Float64(x::BigFloat, r::RoundingMode) = Float64(x, convert(MPFRRoundingMode, r))
337337
Float32(x::BigFloat, r::MPFRRoundingMode=ROUNDING_MODE[]) =
338338
_cpynansgn(ccall((:mpfr_get_flt,:libmpfr), Float32, (Ref{BigFloat}, MPFRRoundingMode), x, r), x)
339339
Float32(x::BigFloat, r::RoundingMode) = Float32(x, convert(MPFRRoundingMode, r))
340-
341-
# TODO: avoid double rounding
342-
Float16(x::BigFloat) = Float16(Float64(x))
340+
function Float16(x::BigFloat) :: Float16
341+
res = Float32(x)
342+
resi = reinterpret(UInt32, res)
343+
if (resi&0x7fffffff) < 0x38800000 # if Float16(res) is subnormal
344+
#shift so that the mantissa lines up where it would for normal Float16
345+
shift = 113-((resi & 0x7f800000)>>23)
346+
if shift<23
347+
resi |= 0x0080_0000 # set implicit bit
348+
resi >>= shift
349+
end
350+
end
351+
if (resi & 0x1fff == 0x1000) # if we are halfway between 2 Float16 values
352+
# adjust the value by 1 ULP in the direction that will make Float16(res) give the right answer
353+
res = nextfloat(res, cmp(x, res))
354+
end
355+
return res
356+
end
343357

344358
promote_rule(::Type{BigFloat}, ::Type{<:Real}) = BigFloat
345359
promote_rule(::Type{BigInt}, ::Type{<:AbstractFloat}) = BigFloat

base/promotion.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,17 @@ function promote_typejoin_union(::Type{T}) where T
168168
return Any # TODO: compute more precise bounds
169169
elseif T isa Union
170170
return promote_typejoin(promote_typejoin_union(T.a), promote_typejoin_union(T.b))
171-
elseif T <: Tuple
172-
return typejoin_union_tuple(T)
173-
else
171+
elseif T isa DataType
172+
T <: Tuple && return typejoin_union_tuple(T)
174173
return T
174+
else
175+
error("unreachable") # not a type??
175176
end
176177
end
177178

178-
function typejoin_union_tuple(T::Type)
179+
function typejoin_union_tuple(T::DataType)
179180
@_pure_meta
180181
u = Base.unwrap_unionall(T)
181-
u isa Union && return typejoin(
182-
typejoin_union_tuple(Base.rewrap_unionall(u.a, T)),
183-
typejoin_union_tuple(Base.rewrap_unionall(u.b, T)))
184182
p = (u::DataType).parameters
185183
lr = length(p)::Int
186184
if lr == 0
@@ -194,8 +192,10 @@ function typejoin_union_tuple(T::Type)
194192
ci = Union{}
195193
elseif U isa Union
196194
ci = typejoin(U.a, U.b)
195+
elseif U isa UnionAll
196+
return Any # TODO: compute more precise bounds
197197
else
198-
ci = U
198+
ci = promote_typejoin_union(U)
199199
end
200200
if i == lr && Core.Compiler.isvarargtype(pi)
201201
c[i] = isdefined(pi, :N) ? Vararg{ci, pi.N} : Vararg{ci}

base/range.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,12 @@ let smallints = (Int === Int64 ?
754754
Union{Int8, UInt8, Int16, UInt16})
755755
global length, checked_length
756756
# n.b. !(step isa T)
757-
length(r::OrdinalRange{<:smallints}) = div(Int(last(r)) - Int(first(r)), step(r)) + 1
757+
function length(r::OrdinalRange{<:smallints})
758+
s = step(r)
759+
s == zero(s) && return 0 # unreachable, by construction, but avoids the error case here later
760+
isempty(r) && return 0
761+
return div(Int(last(r)) - Int(first(r)), s) + 1
762+
end
758763
length(r::AbstractUnitRange{<:smallints}) = Int(last(r)) - Int(first(r)) + 1
759764
length(r::OneTo{<:smallints}) = Int(r.stop)
760765
checked_length(r::OrdinalRange{<:smallints}) = length(r)

base/version_git.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ echo " date_string::String"
1313
echo " tagged_commit::Bool"
1414
echo " fork_master_distance::Int"
1515
echo " fork_master_timestamp::Float64"
16+
echo " build_system_commit::String"
17+
echo " build_system_commit_short::String"
1618
echo "end"
1719
echo ""
1820

@@ -82,6 +84,16 @@ if [ -z "$fork_master_timestamp" ]; then
8284
fork_master_timestamp="0"
8385
fi
8486

87+
build_system_directory="../.buildkite"
88+
if [[ -d "${build_system_directory}/.git" ]]; then
89+
build_system_commit=$(git -C "${build_system_directory}" rev-parse HEAD)
90+
build_system_commit_short=$(git -C "${build_system_directory}" rev-parse --short HEAD)
91+
else
92+
echo "Warning: The build system directory does not exist or is not a Git repo: ${build_system_directory}" >&2
93+
build_system_commit=""
94+
build_system_commit_short=""
95+
fi
96+
8597
echo "const GIT_VERSION_INFO = GitVersionInfo("
8698
echo " \"$commit\","
8799
echo " \"$commit_short\","
@@ -90,5 +102,7 @@ echo " $build_number,"
90102
echo " \"$date_string\","
91103
echo " $tagged_commit,"
92104
echo " $fork_master_distance,"
93-
echo " $fork_master_timestamp."
105+
echo " $fork_master_timestamp.,"
106+
echo " \"$build_system_commit\","
107+
echo " \"$build_system_commit_short\","
94108
echo ")"

0 commit comments

Comments
 (0)