Skip to content

Commit

Permalink
Merge pull request #36899 from JuliaLang/backports-release-1.5
Browse files Browse the repository at this point in the history
Backports 1.5.1
  • Loading branch information
KristofferC authored Aug 19, 2020
2 parents f0b8c76 + a197786 commit 21e0f04
Show file tree
Hide file tree
Showing 215 changed files with 1,547 additions and 398 deletions.
10 changes: 5 additions & 5 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -928,17 +928,17 @@ LIBUNWIND:=
else
ifeq ($(USE_SYSTEM_LIBUNWIND), 1)
ifneq ($(OS),Darwin)
LIBUNWIND:=-lunwind-generic -lunwind
LIBUNWIND:=-lunwind
# Only for linux since we want to use not yet released libunwind features
JCFLAGS+=-DSYSTEM_LIBUNWIND
JCPPFLAGS+=-DSYSTEM_LIBUNWIND
endif
else
ifeq ($(OS),Darwin)
LIBUNWIND:=$(build_libdir)/libosxunwind.a
LIBUNWIND:=-losxunwind
JCPPFLAGS+=-DLIBOSXUNWIND
else
LIBUNWIND:=$(build_libdir)/libunwind-generic.a $(build_libdir)/libunwind.a
LIBUNWIND:=-lunwind
endif
endif
endif
Expand Down Expand Up @@ -1194,12 +1194,12 @@ OSLIBS += -lelf -lkvm -lrt -lpthread
OSLIBS += -lgcc_s

OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \
$(NO_WHOLE_ARCHIVE) $(LIBUNWIND)
$(NO_WHOLE_ARCHIVE)
endif

ifeq ($(OS), Darwin)
SHLIB_EXT := dylib
OSLIBS += -framework CoreFoundation $(LIBUNWIND)
OSLIBS += -framework CoreFoundation
WHOLE_ARCHIVE := -Xlinker -all_load
NO_WHOLE_ARCHIVE :=
JLDFLAGS :=
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ endif
ifeq ($(USE_LLVM_SHLIB),1)
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-9jl
endif
ifeq ($(OS),Darwin)
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libosxunwind
else
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libunwind
endif

ifeq ($(USE_SYSTEM_LIBM),0)
JL_PRIVATE_LIBS-$(USE_SYSTEM_OPENLIBM) += libopenlibm
Expand Down
5 changes: 2 additions & 3 deletions base/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -890,12 +890,11 @@ function unlink(p::AbstractString)
end

# For move command
function rename(src::AbstractString, dst::AbstractString)
function rename(src::AbstractString, dst::AbstractString; force::Bool=false)
err = ccall(:jl_fs_rename, Int32, (Cstring, Cstring), src, dst)
# on error, default to cp && rm
if err < 0
# force: is already done in the mv function
cp(src, dst; force=false, follow_symlinks=false)
cp(src, dst; force=force, follow_symlinks=false)
rm(src; recursive=true)
end
nothing
Expand Down
34 changes: 24 additions & 10 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1256,9 +1256,9 @@ const MAX_NUM_PRECOMPILE_FILES = 10
function compilecache(pkg::PkgId, path::String)
# decide where to put the resulting cache file
cachefile = compilecache_path(pkg)
cachepath = dirname(cachefile)
# prune the directory with cache files
if pkg.uuid !== nothing
cachepath = dirname(cachefile)
entrypath, entryfile = cache_file_entry(pkg)
cachefiles = filter!(x -> startswith(x, entryfile * "_"), readdir(cachepath))
if length(cachefiles) >= MAX_NUM_PRECOMPILE_FILES
Expand All @@ -1276,20 +1276,34 @@ function compilecache(pkg::PkgId, path::String)
# run the expression and cache the result
verbosity = isinteractive() ? CoreLogging.Info : CoreLogging.Debug
@logmsg verbosity "Precompiling $pkg"
p = create_expr_cache(path, cachefile, concrete_deps, pkg.uuid)
if success(p)
# append checksum to the end of the .ji file:
open(cachefile, "a+") do f
write(f, _crc32c(seekstart(f)))

# create a temporary file in `cachepath` directory, write the cache in it,
# write the checksum, _and then_ atomically move the file to `cachefile`.
tmppath, tmpio = mktemp(cachepath)
local p
try
close(tmpio)
p = create_expr_cache(path, tmppath, concrete_deps, pkg.uuid)
if success(p)
# append checksum to the end of the .ji file:
open(tmppath, "a+") do f
write(f, _crc32c(seekstart(f)))
end
# inherit permission from the source file
chmod(tmppath, filemode(path) & 0o777)

# this is atomic according to POSIX:
rename(tmppath, cachefile; force=true)
return cachefile
end
# inherit permission from the source file
chmod(cachefile, filemode(path) & 0o777)
elseif p.exitcode == 125
finally
rm(tmppath, force=true)
end
if p.exitcode == 125
return PrecompilableError()
else
error("Failed to precompile $pkg to $cachefile.")
end
return cachefile
end

module_build_id(m::Module) = ccall(:jl_module_build_id, UInt64, (Any,), m)
Expand Down
10 changes: 9 additions & 1 deletion base/reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,15 @@ julia> count([true, false, true, true])
"""
count(itr) = count(identity, itr)

count(f, itr) = mapreduce(_bool(f), add_sum, itr, init=0)
count(f, itr) = _simple_count(f, itr)

function _simple_count(pred, itr)
n = 0
for x in itr
n += pred(x)::Bool
end
return n
end

function count(::typeof(identity), x::Array{Bool})
n = 0
Expand Down
5 changes: 4 additions & 1 deletion base/reducedim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,10 @@ julia> count(<=(2), A, dims=2)
```
"""
count(A::AbstractArrayOrBroadcasted; dims=:) = count(identity, A, dims=dims)
count(f, A::AbstractArrayOrBroadcasted; dims=:) = mapreduce(_bool(f), add_sum, A, dims=dims, init=0)
count(f, A::AbstractArrayOrBroadcasted; dims=:) = _count(f, A, dims)

_count(f, A::AbstractArrayOrBroadcasted, dims::Colon) = _simple_count(f, A)
_count(f, A::AbstractArrayOrBroadcasted, dims) = mapreduce(_bool(f), add_sum, A, dims=dims, init=0)

"""
count!([f=identity,] r, A)
Expand Down
3 changes: 2 additions & 1 deletion base/ryu/shortest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ end
olength = decimallength(output)
exp_form = true
pt = nexp + olength
if -4 < pt <= (precision == -1 ? (T == Float16 ? 3 : 6) : precision)
if -4 < pt <= (precision == -1 ? (T == Float16 ? 3 : 6) : precision) &&
!(pt >= olength && abs(mod(x + 0.05, 10^(pt - olength)) - 0.05) > 0.05)
exp_form = false
if pt <= 0
buf[pos] = UInt8('0')
Expand Down
4 changes: 1 addition & 3 deletions base/set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,7 @@ end

allunique(::Union{AbstractSet,AbstractDict}) = true

allunique(r::AbstractRange{T}) where {T} = (step(r) != zero(T)) || (length(r) <= 1)
allunique(r::StepRange{T,S}) where {T,S} = (step(r) != zero(S)) || (length(r) <= 1)
allunique(r::StepRangeLen{T,R,S}) where {T,R,S} = (step(r) != zero(S)) || (length(r) <= 1)
allunique(r::AbstractRange) = !iszero(step(r)) || length(r) <= 1

filter!(f, s::Set) = unsafe_filter!(f, s)

Expand Down
2 changes: 1 addition & 1 deletion base/strings/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ function replace(str::String, pat_repl::Pair; count::Integer=typemax(Int))
i = k = nextind(str, k)
end
r = something(findnext(pattern,str,k), 0)
r == 0:-1 || n == count && break
r === 0:-1 || n == count && break
j, k = first(r), last(r)
n += 1
end
Expand Down
2 changes: 2 additions & 0 deletions contrib/mac/app/Entitlements.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<dict>
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.cs.get-task-allow</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
Expand Down
6 changes: 6 additions & 0 deletions contrib/refresh_bb_tarballs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ fi
# Get "contrib/" directory path
CONTRIB_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)

# Get the source hash for each project
for proj in ${BB_PROJECTS}; do
PROJ="$(echo ${proj} | tr [a-z] [A-Z])"
make -C "${CONTRIB_DIR}/../deps" USE_BINARYBUILDER_${PROJ}=0 DEPS_GIT=0 extract-${proj}
done

# For each triplet and each project, download the BB tarball and save its hash:
for triplet in ${TRIPLETS}; do
for proj in ${BB_PROJECTS}; do
Expand Down
6 changes: 5 additions & 1 deletion deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ ifneq ($(OS), WINNT)
DEP_LIBS += libwhich
endif

DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper osxunwind,$(DEP_LIBS)) # unlist targets that have not been converted to use the staged-install
# unlist targets that have not been converted to use the staged-install
DEP_LIBS_STAGED := $(filter-out suitesparse-wrapper,$(DEP_LIBS))
ifneq ($(USE_BINARYBUILDER_LIBUNWIND),1)
DEP_LIBS_STAGED := $(filter-out osxunwind,$(DEP_LIBS))
endif


## Common build target prefixes
Expand Down
9 changes: 5 additions & 4 deletions deps/Versions.make
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
LLVM_VER = 9.0.1
LLVM_BB_REL = 6
LLVM_BB_REL = 8
PCRE_VER = 10.31
PCRE_BB_REL = 0
DSFMT_VER = 2.2.3
Expand All @@ -13,12 +13,13 @@ OPENLIBM_VER = 0.7.0
OPENLIBM_BB_REL = 0
UNWIND_VER = 1.3.1
UNWIND_BB_REL = 4
OSXUNWIND_VER = 0.0.5
OSXUNWIND_VER = 0.0.6
OSXUNWIND_BB_REL = 0
GMP_VER = 6.1.2
GMP_BB_REL = 4
MPFR_VER = 4.0.2
MPFR_BB_REL = 2
MPFR_VER = 4.1.0
MPFR_BB_REL = 1
PATCHELF_VER = 0.9
MBEDTLS_VER = 2.16.0
MBEDTLS_BB_REL = 1
Expand All @@ -40,4 +41,4 @@ P7ZIP_BB_REL = 1
# Specify the version of the Mozilla CA Certificate Store to obtain.
# The versions of cacert.pem are identified by the date (YYYY-MM-DD) of their changes.
# See https://curl.haxx.se/docs/caextract.html for more details.
MOZILLA_CACERT_VERSION := 2020-01-01
MOZILLA_CACERT_VERSION := 2020-07-22

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e8024bf7b5a2bf8d60ed833c48d64c30
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
85bee115865a9f015ad30e8c4a24092b3910c22e10e9cf0e4fa7592fc35a102d3d1b864dfd112e0c1c4a83ade9196c7480704fa0893de3dd03e9f7a96427911f
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d3a606fe6e14db4a84dca5681b10cfeb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4d4a0680327b475e3c6fc8f9b8bb48e89c3a4e5b3584e8681a82b0849539645e820181af4eb2317b15c424eaccd7f51a75fd62486bee3121e7f3918593f4f948
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0947966926ca83089aad09d86815b6fa
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
73120f8d846905394d2d9f3a29208afcc8880c8984df88f7afefd1cf14825c721656162bab90332b319a2dad82c7a9f32ce648a458cd5e815bde6d7ffda04d39
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
06469513d1fab1038cc24d2b009eeb97
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d3fa4ff76895ae15abbf6359a045b7942a0d92051b97ac30f38038cd25e9092f745fe75df07cf73015308ba72da85047096264bc26e7f7ebf2c5fe6044b2f5d5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7a94bfae0f955b820b860d8da494f109
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9a119958026e60b269e820ad852801b977a43c82026e21bc10f0c38bd0873d8a0ca4260aa4352696103414b8f44f64f8ab89ab4dc350f3c6b3a1ebd55e3b4a1f
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
39a99af902efcf6df48b1921fe205794
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6181f9d053c739984e25e91015cefcc26b2bbb82ef5379cd79744c708b5ea2cd5cd4ac2bed0b35db72a49b86635c9c5057523421a1194541b5391f16c6a56f1c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
61dc0291bbf721935c63ae575d1245e7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b3c80406388987d401dd924d5b294a6976108f05df00beb856784abe7e4be4b610bf1e0cc4ddee252fe992861bc1aaaf41a466f8ae0b94d9ea7354a45d6418d8
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5d67b7e54d0851534841a3968568eb07
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d5d6cac18ac68f2122eb2624f6b3288b5341c2f9a18fca94dcb0d87fc028c468b553c0c14ab4e139fe313c29b15b48bed601aa896e2408a144d844803730e381
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
622df46f071bd3459c530c6dc00243e9
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1d873a4f344c70d84d7b31273c3e9dbcbe54edf338817ed4f5799712f4569ba3cb965d98d15f684ea1718ee3718d0e7b0acc4bb48bbcd2964fce4e1468a92ec2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
732d2cf660dad8c2166f337275eff3dd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a2808a77f3aee834c1aed4bbcb102037bc3f5c4dbaa50b5c0aec8e1627b281cea6d6225e92a60c94c722873e8520a7c926f34fc3a11e4689dc82b2b7cc2a2b43
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2253fa3009616c7a30f1dd758a3d1427
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1c1b15443d809a6dd08fceb5b8cafbbfa2bcb1a105196d3ca92b43f3fcb454db1e7f31920bef67b52059f5d5ed2d7673f7c609b9dbdca7c5cbd1c1a7ded6c7b7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2cc4df8d06d65b24ece512e3d5e51372
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e12d86b21234c840718592eb3325c97ea7194fe14ffd149249b53d90914064e0749b27359d772475d032becf74047172bc598674bf4d20bc4bd14aad60d033d0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6723ced2c9ba27ca863a2b7f20c27b54
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6c9004560ffd7f1bc56d86e32fa19aec5856117409f0bdc1dc56f2902fb388df98947b58c84c35e806a3776dd33b2e7cb9c740cc6a73605caa68affe1864368b
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
078ff5d48e7363352c1cdec44d2af350
Loading

0 comments on commit 21e0f04

Please sign in to comment.