Skip to content

Commit

Permalink
Merge pull request #45319 from JuliaLang/backports-release-1.6
Browse files Browse the repository at this point in the history
release-1.6: Backports for 1.6.7
  • Loading branch information
KristofferC authored Jul 5, 2022
2 parents aafae8a + 443c321 commit a03fa67
Show file tree
Hide file tree
Showing 92 changed files with 2,976 additions and 1,122 deletions.
1 change: 1 addition & 0 deletions .buildkite/pipelines/main/misc/doctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ agents:
# Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing
sandbox.jl: "true"
os: "linux"
arch: "x86_64"
steps:
- label: "doctest"
key: doctest
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pipelines/main/misc/embedding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ agents:
# Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing
sandbox.jl: "true"
os: "linux"
arch: "x86_64"
steps:
- label: "embedding"
key: "embedding"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pipelines/main/misc/llvmpasses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ agents:
# Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing
sandbox.jl: "true"
os: "linux"
arch: "x86_64"
steps:
- label: "analyzegc"
key: "analyzegc"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pipelines/main/misc/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ agents:
# Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing
sandbox.jl: "true"
os: "linux"
arch: "x86_64"
steps:
- label: "asan"
key: "asan"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pipelines/main/misc/whitespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ agents:
# Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing
sandbox.jl: "true"
os: "linux"
arch: "x86_64"
steps:
- label: "whitespace"
key: "whitespace"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pipelines/main/platforms/package_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ agents:
# Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing
sandbox.jl: "true"
os: "linux"
arch: "x86_64"
steps:
- label: "package_${PLATFORM?}${LABEL?}"
key: package_${PLATFORM?}${LABEL?}
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pipelines/main/platforms/tester_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ agents:
# Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing
sandbox.jl: "true"
os: "linux"
arch: "x86_64"
steps:
- label: "tester_${PLATFORM?}${LABEL?}"
key: tester_${PLATFORM?}${LABEL?}
Expand Down
9 changes: 7 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ New library functions
* New function `Base.rest` for taking the rest of a collection, starting from a specific
iteration state, in a generic way ([#37410]).

New library features
--------------------
Library changes
---------------

* A known concurrency issue of `iterate` methods on `Dict` and other derived objects such
as `keys(::Dict)`, `values(::Dict)`, and `Set` is fixed. These methods of `iterate` can
now be called on a dictionary or set shared by arbitrary tasks provided that there are no
tasks mutating the dictionary or set ([#44534]).

* The `redirect_*` functions now accept `devnull` to discard all output redirected to it, and as an empty
input ([#36146]).
Expand Down
2 changes: 1 addition & 1 deletion base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ end

@propagate_inbounds _iterate(t::Dict{K,V}, i) where {K,V} = i == 0 ? nothing : (Pair{K,V}(t.keys[i],t.vals[i]), i == typemax(Int) ? 0 : i+1)
@propagate_inbounds function iterate(t::Dict)
_iterate(t, skip_deleted_floor!(t))
_iterate(t, skip_deleted(t, t.idxfloor))
end
@propagate_inbounds iterate(t::Dict, i) = _iterate(t, skip_deleted(t, i))

Expand Down
2 changes: 1 addition & 1 deletion base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ element `i` of array `A` is skipped to improve performance.
```julia
function sum(A::AbstractArray)
r = zero(eltype(A))
for i = 1:length(A)
for i in eachindex(A)
@inbounds r += A[i]
end
return r
Expand Down
3 changes: 1 addition & 2 deletions base/floatfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ julia> round(357.913; sigdigits=4, base=2)
Rounding to specified digits in bases other than 2 can be inexact when
operating on binary floating point numbers. For example, the [`Float64`](@ref)
value represented by `1.15` is actually *less* than 1.15, yet will be
rounded to 1.2.
rounded to 1.2. For example:
# Examples
```jldoctest; setup = :(using Printf)
julia> x = 1.15
1.15
Expand Down
2 changes: 1 addition & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
cachefiles = filter!(x -> startswith(x, entryfile * "_"), readdir(cachepath))
if length(cachefiles) >= MAX_NUM_PRECOMPILE_FILES[]
idx = findmin(mtime.(joinpath.(cachepath, cachefiles)))[2]
rm(joinpath(cachepath, cachefiles[idx]))
rm(joinpath(cachepath, cachefiles[idx]); force=true)
end
end

Expand Down
9 changes: 8 additions & 1 deletion base/mpfr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,14 @@ function round(::Type{T}, x::BigFloat, r::Union{RoundingMode, MPFRRoundingMode})
end
return unsafe_trunc(T, res)
end
round(::Type{BigInt}, x::BigFloat, r::Union{RoundingMode, MPFRRoundingMode}) = _unchecked_cast(BigInt, x, r)

function round(::Type{BigInt}, x::BigFloat, r::Union{RoundingMode, MPFRRoundingMode})
clear_flags()
res = _unchecked_cast(BigInt, x, r)
had_range_exception() && throw(InexactError(:round, BigInt, x))
return res
end

round(::Type{T}, x::BigFloat, r::RoundingMode) where T<:Union{Signed, Unsigned} =
invoke(round, Tuple{Type{<:Union{Signed, Unsigned}}, BigFloat, Union{RoundingMode, MPFRRoundingMode}}, T, x, r)
round(::Type{BigInt}, x::BigFloat, r::RoundingMode) =
Expand Down
12 changes: 7 additions & 5 deletions base/multidimensional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1076,16 +1076,18 @@ function copyto!(dest::AbstractArray{T1,N}, Rdest::CartesianIndices{N},
checkbounds(src, first(Rsrc))
checkbounds(src, last(Rsrc))
src′ = unalias(dest, src)
ΔI = first(Rdest) - first(Rsrc)
CRdest = CartesianIndices(Rdest)
CRsrc = CartesianIndices(Rsrc)
ΔI = first(CRdest) - first(CRsrc)
if @generated
quote
@nloops $N i (n->Rsrc.indices[n]) begin
@inbounds @nref($N,dest,n->i_n+ΔI[n]) = @nref($N,src′,i)
@nloops $N i (n->CRsrc.indices[n]) begin
@inbounds @nref($N,dest,n->Rdest.indices[n][i_n+ΔI[n]]) = @nref($N,src′,n->Rsrc.indices[n][i_n])
end
end
else
for I in Rsrc
@inbounds dest[I + ΔI] = src′[I]
for I in CRsrc
@inbounds dest[Rdest[I + ΔI]] = src′[Rsrc[I]]
end
end
dest
Expand Down
37 changes: 36 additions & 1 deletion base/task.jl
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,12 @@ isolating the asynchronous code from changes to the variable's value in the curr
Interpolating values via `\$` is available as of Julia 1.4.
"""
macro async(expr)
do_async_macro(expr)
end

# generate the code for @async, possibly wrapping the task in something before
# pushing it to the wait queue.
function do_async_macro(expr; wrap=identity)
letargs = Base._lift_one_interp!(expr)

thunk = esc(:(()->($expr)))
Expand All @@ -414,14 +420,43 @@ macro async(expr)
let $(letargs...)
local task = Task($thunk)
if $(Expr(:islocal, var))
put!($var, task)
put!($var, $(wrap(:task)))
end
schedule(task)
task
end
end
end

# task wrapper that doesn't create exceptions wrapped in TaskFailedException
struct UnwrapTaskFailedException
task::Task
end

# common code for wait&fetch for UnwrapTaskFailedException
function unwrap_task_failed(f::Function, t::UnwrapTaskFailedException)
try
f(t.task)
catch ex
if ex isa TaskFailedException
throw(ex.task.exception)
else
rethrow()
end
end
end

# the unwrapping for above task wrapper (gets triggered in sync_end())
wait(t::UnwrapTaskFailedException) = unwrap_task_failed(wait, t)

# same for fetching the tasks, for convenience
fetch(t::UnwrapTaskFailedException) = unwrap_task_failed(fetch, t)

# macro for running async code that doesn't throw wrapped exceptions
macro async_unwrap(expr)
do_async_macro(expr, wrap=task->:(Base.UnwrapTaskFailedException($task)))
end

# Capture interpolated variables in $() and move them to let-block
function _lift_one_interp!(e)
letargs = Any[] # store the new gensymed arguments
Expand Down
4 changes: 2 additions & 2 deletions base/version_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd $1
if [ "$#" = "2" -a "$2" = "NO_GIT" ]; then
# this comment is used in base/Makefile to distinguish boilerplate
echo "# Default output if git is not available."
echo "const GIT_VERSION_INFO = GitVersionInfo(\"\" ,\"\" ,\"\" ,0 ,\"\" ,true ,0 ,0.)"
echo 'const GIT_VERSION_INFO = GitVersionInfo("", "", "", 0, "", true, 0, 0.0, "", "")'
exit 0
fi
# Collect temporary variables
Expand Down Expand Up @@ -101,7 +101,7 @@ echo " $build_number,"
echo " \"$date_string\","
echo " $tagged_commit,"
echo " $fork_master_distance,"
echo " $fork_master_timestamp.,"
echo " $fork_master_timestamp.0,"
echo " \"$build_system_commit\","
echo " \"$build_system_commit_short\","
echo ")"
4 changes: 4 additions & 0 deletions cli/loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#define realloc loader_realloc
#endif

#include <stdint.h>

#ifdef _OS_WINDOWS_
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
Expand Down Expand Up @@ -105,3 +107,5 @@ int wchar_to_utf8(const wchar_t * wstr, char *str, size_t maxlen);
int utf8_to_wchar(const char * str, wchar_t *wstr, size_t maxlen);
void setup_stdio(void);
#endif

#include "../src/jloptions.h"
4 changes: 4 additions & 0 deletions cli/loader_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ __attribute__((constructor)) void jl_load_libjulia_internal(void) {
for (unsigned int symbol_idx=0; jl_exported_func_names[symbol_idx] != NULL; ++symbol_idx) {
(*jl_exported_func_addrs[symbol_idx]) = lookup_symbol(libjulia_internal, jl_exported_func_names[symbol_idx]);
}

// jl_options must be initialized very early, in case an embedder sets some
// values there before calling jl_init
((void (*)(void))jl_init_options_addr)();
}

// Load libjulia and run the REPL with the given arguments (in UTF-8 format)
Expand Down
8 changes: 4 additions & 4 deletions deps/Versions.make
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DSFMT_VER := 2.2.4
DSFMT_JLL_NAME := dSFMT

# GMP
GMP_VER := 6.2.0
GMP_VER := 6.2.1
GMP_JLL_NAME := GMP

# LibCURL
Expand Down Expand Up @@ -87,11 +87,11 @@ OSXUNWIND_JLL_VER := 0.0.6+1
PATCHELF_VER := 0.9

# p7zip
P7ZIP_VER := 16.2.0
P7ZIP_VER := 17.04
P7ZIP_JLL_NAME := p7zip

# PCRE
PCRE_VER := 10.36
PCRE_VER := 10.40
PCRE_JLL_NAME := PCRE2

# SuiteSparse
Expand All @@ -104,7 +104,7 @@ UNWIND_JLL_NAME := LibUnwind
UNWIND_JLL_VER := 1.3.2+6

# zlib
ZLIB_VER := 1.2.11
ZLIB_VER := 1.2.12
ZLIB_JLL_NAME := Zlib

# Specify the version of the Mozilla CA Certificate Store to obtain.
Expand Down
4 changes: 2 additions & 2 deletions deps/blas.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ endif
ifeq ($(USE_BLAS64), 1)
OPENBLAS_BUILD_OPTS += INTERFACE64=1 SYMBOLSUFFIX="$(OPENBLAS_SYMBOLSUFFIX)" LIBPREFIX="libopenblas$(OPENBLAS_LIBNAMESUFFIX)"
ifeq ($(OS), Darwin)
OPENBLAS_BUILD_OPTS += OBJCONV=$(abspath $(BUILDDIR)/objconv/objconv)
$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-compiled: | $(BUILDDIR)/objconv/build-compiled
OPENBLAS_BUILD_OPTS += OBJCONV=$(abspath $(build_depsbindir)/objconv)
$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-compiled: | $(build_prefix)/manifest/objconv
endif
endif

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7a68069fd63b0152c9a494a0866a25c7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
829d7524d0750f4c57fbf0557b4db0e029c07c7dfb0fbb0c772d1d983df4da6b1693cb653b0b615fec2e1c8ef8e4b1a52ad0ef0cee04527e72ac4a4500982cc8

This file was deleted.

This file was deleted.

Loading

0 comments on commit a03fa67

Please sign in to comment.