Skip to content

Commit

Permalink
Merge pull request #40209 from JuliaLang/backports-release-1.6
Browse files Browse the repository at this point in the history
Backports for release 1.6.1
  • Loading branch information
KristofferC authored Apr 17, 2021
2 parents 9283b6c + 23e5f6f commit 7cbb02d
Show file tree
Hide file tree
Showing 75 changed files with 1,775 additions and 758 deletions.
23 changes: 22 additions & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,21 @@ else
SHLIB_EXT := so
endif

ifeq ($(OS),WINNT)
define versioned_libname
$$(if $(2),$(1)-$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
endef
else ifeq ($(OS),Darwin)
define versioned_libname
$$(if $(2),$(1).$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
endef
else
define versioned_libname
$$(if $(2),$(1).$(SHLIB_EXT).$(2),$(1).$(SHLIB_EXT))
endef
endif


ifeq ($(SHLIB_EXT), so)
define SONAME_FLAGS
-Wl,-soname=$1
Expand Down Expand Up @@ -1178,6 +1193,8 @@ BB_TRIPLET_LIBGFORTRAN := $(subst $(SPACE),-,$(filter-out cxx%,$(subst -,$(SPACE
BB_TRIPLET_CXXABI := $(subst $(SPACE),-,$(filter-out libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI))))
BB_TRIPLET := $(subst $(SPACE),-,$(filter-out cxx%,$(filter-out libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI)))))

LIBGFORTRAN_VERSION := $(subst libgfortran,,$(filter libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN))))

# This is the set of projects that BinaryBuilder dependencies are hooked up for.
BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP CSL
define SET_BB_DEFAULT
Expand Down Expand Up @@ -1552,8 +1569,12 @@ ifneq ($(findstring $(OS),Linux FreeBSD),)
LIBGCC_NAME := libgcc_s.$(SHLIB_EXT).1
endif


# USE_SYSTEM_CSL causes it to get symlinked into build_private_shlibdir
ifeq ($(USE_SYSTEM_CSL),1)
LIBGCC_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_private_shlibdir)/$(LIBGCC_NAME))
else
LIBGCC_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/$(LIBGCC_NAME))
endif
LIBGCC_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/$(LIBGCC_NAME))

# USE_SYSTEM_LIBM and USE_SYSTEM_OPENLIBM causes it to get symlinked into build_private_shlibdir
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,11 @@ endif
done \
done
for suffix in $(JL_PRIVATE_LIBS-1) ; do \
lib=$(build_private_libdir)/$${suffix}.$(SHLIB_EXT); \
$(INSTALL_M) $$lib $(DESTDIR)$(private_libdir) ; \
for lib in $(build_private_libdir)/$${suffix}.$(SHLIB_EXT)*; do \
if [ "$${lib##*.}" != "dSYM" ]; then \
$(INSTALL_M) $$lib $(DESTDIR)$(private_libdir) ; \
fi \
done \
done
endif
# Install `7z` into libexec/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Julia. However, most users should use the most recent stable version
of Julia. You can get this version by changing to the Julia directory
and running:

git checkout v1.5.0
git checkout v1.6.0

Now run `make` to build the `julia` executable.

Expand Down
88 changes: 52 additions & 36 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,53 +169,69 @@ endif
# echo "$$P"

define symlink_system_library
symlink_$1: $$(build_private_libdir)/$1.$$(SHLIB_EXT)
$$(build_private_libdir)/$1.$$(SHLIB_EXT):
REALPATH=`$$(call spawn,$$(build_depsbindir)/libwhich) -p $$(notdir $$@)` && \
$$(call resolve_path,REALPATH) && \
[ -e "$$$$REALPATH" ] && \
([ ! -e "$$@" ] || rm "$$@") && \
echo ln -sf "$$$$REALPATH" "$$@" && \
ln -sf "$$$$REALPATH" "$$@"
ifneq ($2,)
ifneq ($$(USE_SYSTEM_$2),0)
SYMLINK_SYSTEM_LIBRARIES += symlink_$1
endif
libname_$2 := $$(notdir $(call versioned_libname,$2,$3))
libpath_$2 := $$(shell $$(call spawn,$$(build_depsbindir)/libwhich) -p $$(libname_$2) 2>/dev/null)
symlink_$2: $$(build_private_libdir)/$$(libname_$2)
$$(build_private_libdir)/$$(libname_$2):
@if [ -e "$$(libpath_$2)" ]; then \
REALPATH=$$(libpath_$2); \
$$(call resolve_path,REALPATH) && \
[ -e "$$$$REALPATH" ] && \
([ ! -e "$$@" ] || rm "$$@") && \
echo ln -sf "$$$$REALPATH" "$$@" && \
ln -sf "$$$$REALPATH" "$$@"; \
else \
if [ "$4" != "ALLOW_FAILURE" ]; then \
echo "System library symlink failure: Unable to locate $$(libname_$2) on your system!" >&2; \
false; \
fi; \
fi
ifneq ($$(USE_SYSTEM_$1),0)
SYMLINK_SYSTEM_LIBRARIES += symlink_$2
endif
endef

# the following excludes: libuv.a, libutf8proc.a

$(eval $(call symlink_system_library,$(LIBMNAME)))
ifneq ($(USE_SYSTEM_LIBM),0)
SYMLINK_SYSTEM_LIBRARIES += symlink_$(LIBMNAME)
$(eval $(call symlink_system_library,LIBM,$(LIBMNAME)))
else ifneq ($(USE_SYSTEM_OPENLIBM),0)
SYMLINK_SYSTEM_LIBRARIES += symlink_$(LIBMNAME)
$(eval $(call symlink_system_library,OPENLIBM,$(LIBMNAME)))
endif

$(eval $(call symlink_system_library,libpcre2-8,PCRE))
$(eval $(call symlink_system_library,libdSFMT,DSFMT))
$(eval $(call symlink_system_library,$(LIBBLASNAME),BLAS))
$(eval $(call symlink_system_library,CSL,libgcc_s,1))
ifneq (,$(LIBGFORTRAN_VERSION))
$(eval $(call symlink_system_library,CSL,libgfortran,$(LIBGFORTRAN_VERSION)))
endif
$(eval $(call symlink_system_library,CSL,libquadmath,0))
$(eval $(call symlink_system_library,CSL,libstdc++,6))
# We allow libssp, libatomic and libgomp to fail as they are not available on all systems
$(eval $(call symlink_system_library,CSL,libssp,0,ALLOW_FAILURE))
$(eval $(call symlink_system_library,CSL,libatomic,1,ALLOW_FAILURE))
$(eval $(call symlink_system_library,CSL,libgomp,1,ALLOW_FAILURE))
$(eval $(call symlink_system_library,PCRE,libpcre2-8))
$(eval $(call symlink_system_library,DSFMT,libdSFMT))
$(eval $(call symlink_system_library,BLAS,$(LIBBLASNAME)))
ifneq ($(LIBLAPACKNAME),$(LIBBLASNAME))
$(eval $(call symlink_system_library,$(LIBLAPACKNAME),LAPACK))
$(eval $(call symlink_system_library,LAPACK,$(LIBLAPACKNAME)))
endif
$(eval $(call symlink_system_library,libgmp,GMP))
$(eval $(call symlink_system_library,libmpfr,MPFR))
$(eval $(call symlink_system_library,libmbedtls,MBEDTLS))
$(eval $(call symlink_system_library,libmbedcrypto,MBEDTLS))
$(eval $(call symlink_system_library,libmbedx509,MBEDTLS))
$(eval $(call symlink_system_library,libssh2,LIBSSH2))
$(eval $(call symlink_system_library,libnghttp2,NGHTTP2))
$(eval $(call symlink_system_library,libcurl,CURL))
$(eval $(call symlink_system_library,libgit2,LIBGIT2))
$(eval $(call symlink_system_library,libamd,SUITESPARSE))
$(eval $(call symlink_system_library,libcamd,SUITESPARSE))
$(eval $(call symlink_system_library,libccolamd,SUITESPARSE))
$(eval $(call symlink_system_library,libcholmod,SUITESPARSE))
$(eval $(call symlink_system_library,libcolamd,SUITESPARSE))
$(eval $(call symlink_system_library,libumfpack,SUITESPARSE))
$(eval $(call symlink_system_library,libspqr,SUITESPARSE))
$(eval $(call symlink_system_library,libsuitesparseconfig,SUITESPARSE))
$(eval $(call symlink_system_library,GMP,libgmp))
$(eval $(call symlink_system_library,MPFR,libmpfr))
$(eval $(call symlink_system_library,MBEDTLS,libmbedtls))
$(eval $(call symlink_system_library,MBEDTLS,libmbedcrypto))
$(eval $(call symlink_system_library,MBEDTLS,libmbedx509))
$(eval $(call symlink_system_library,LIBSSH2,libssh2))
$(eval $(call symlink_system_library,NGHTTP2,libnghttp2))
$(eval $(call symlink_system_library,CURL,libcurl))
$(eval $(call symlink_system_library,LIBGIT2,libgit2))
$(eval $(call symlink_system_library,SUITESPARSE,libamd))
$(eval $(call symlink_system_library,SUITESPARSE,libcamd))
$(eval $(call symlink_system_library,SUITESPARSE,libccolamd))
$(eval $(call symlink_system_library,SUITESPARSE,libcholmod))
$(eval $(call symlink_system_library,SUITESPARSE,libcolamd))
$(eval $(call symlink_system_library,SUITESPARSE,libumfpack))
$(eval $(call symlink_system_library,SUITESPARSE,libspqr))
$(eval $(call symlink_system_library,SUITESPARSE,libsuitesparseconfig))
# EXCLUDED LIBRARIES (installed/used, but not vendored for use with dlopen):
# libunwind
endif # WINNT
Expand Down
4 changes: 2 additions & 2 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ function getindex(A::AbstractArray, I...)
_getindex(IndexStyle(A), A, to_indices(A, I)...)
end
# To avoid invalidations from multidimensional.jl: getindex(A::Array, i1::Union{Integer, CartesianIndex}, I::Union{Integer, CartesianIndex}...)
getindex(A::Array, i1::Integer, I::Integer...) = A[to_indices(A, (i1, I...))...]
@propagate_inbounds getindex(A::Array, i1::Integer, I::Integer...) = A[to_indices(A, (i1, I...))...]

function unsafe_getindex(A::AbstractArray, I...)
@_inline_meta
Expand Down Expand Up @@ -1489,7 +1489,7 @@ AbstractVecOrTuple{T} = Union{AbstractVector{<:T}, Tuple{Vararg{T}}}

_typed_vcat_similar(V, ::Type{T}, n) where T = similar(V[1], T, n)
_typed_vcat(::Type{T}, V::AbstractVecOrTuple{AbstractVector}) where T =
_typed_vcat!(_typed_vcat_similar(V, T, mapreduce(length, +, V)), V)
_typed_vcat!(_typed_vcat_similar(V, T, sum(map(length, V))), V)

function _typed_vcat!(a::AbstractVector{T}, V::AbstractVecOrTuple{AbstractVector}) where T
pos = 1
Expand Down
9 changes: 1 addition & 8 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,6 @@ end
# replace `sf` as needed.
const update_stackframes_callback = Ref{Function}(identity)

function replaceuserpath(str)
str = replace(str, homedir() => "~")
# seems to be necessary for some paths with small letter drive c:// etc
str = replace(str, lowercasefirst(homedir()) => "~")
return str
end

const STACKTRACE_MODULECOLORS = [:magenta, :cyan, :green, :yellow]
const STACKTRACE_FIXEDCOLORS = IdDict(Base => :light_black, Core => :light_black)

Expand Down Expand Up @@ -701,7 +694,7 @@ end
function print_stackframe(io, i, frame::StackFrame, n::Int, digit_align_width, modulecolor)
file, line = string(frame.file), frame.line
stacktrace_expand_basepaths() && (file = something(find_source_file(file), file))
stacktrace_contract_userdir() && (file = replaceuserpath(file))
stacktrace_contract_userdir() && (file = contractuser(file))

# Used by the REPL to make it possible to open
# the location of a stackframe/method in the editor.
Expand Down
28 changes: 22 additions & 6 deletions base/path.jl
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,19 @@ normpath(a::AbstractString, b::AbstractString...) = normpath(joinpath(a,b...))
Convert a path to an absolute path by adding the current directory if necessary.
Also normalizes the path as in [`normpath`](@ref).
"""
abspath(a::String) = normpath(isabspath(a) ? a : joinpath(pwd(),a))
function abspath(a::String)::String
if !isabspath(a)
cwd = pwd()
a_drive, a_nodrive = splitdrive(a)
if a_drive != "" && lowercase(splitdrive(cwd)[1]) != lowercase(a_drive)
cwd = a_drive * path_separator
a = joinpath(cwd, a_nodrive)
else
a = joinpath(cwd, a)
end
end
return normpath(a)
end

"""
abspath(path::AbstractString, paths::AbstractString...) -> String
Expand Down Expand Up @@ -502,12 +514,16 @@ function relpath(path::String, startpath::String = ".")
curdir = "."
pardir = ".."
path == startpath && return curdir
path_drive, path_without_drive = splitdrive(path)
startpath_drive, startpath_without_drive = splitdrive(startpath)
path_arr = split(abspath(path_without_drive), path_separator_re)
start_arr = split(abspath(startpath_without_drive), path_separator_re)
if Sys.iswindows()
lowercase(path_drive) != lowercase(startpath_drive) && return abspath(path)
path_drive, path_without_drive = splitdrive(path)
startpath_drive, startpath_without_drive = splitdrive(startpath)
isempty(startpath_drive) && (startpath_drive = path_drive) # by default assume same as path drive
uppercase(path_drive) == uppercase(startpath_drive) || return abspath(path) # if drives differ return first path
path_arr = split(abspath(path_drive * path_without_drive), path_separator_re)
start_arr = split(abspath(path_drive * startpath_without_drive), path_separator_re)
else
path_arr = split(abspath(path), path_separator_re)
start_arr = split(abspath(startpath), path_separator_re)
end
i = 0
while i < min(length(path_arr), length(start_arr))
Expand Down
4 changes: 2 additions & 2 deletions base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ function argmin(r::AbstractRange)
elseif step(r) > 0
firstindex(r)
else
first(searchsorted(r, last(r)))
lastindex(r)
end
end

Expand All @@ -647,7 +647,7 @@ function argmax(r::AbstractRange)
if isempty(r)
throw(ArgumentError("range must be non-empty"))
elseif step(r) > 0
first(searchsorted(r, last(r)))
lastindex(r)
else
firstindex(r)
end
Expand Down
2 changes: 1 addition & 1 deletion base/ryu/exp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
roundPos = pos
while true
roundPos -= 1
if roundPos == (startpos - 1) || buf[roundPos] == UInt8('-')
if roundPos == (startpos - 1) || buf[roundPos] == UInt8('-') || (plus && buf[roundPos] == UInt8('+')) || (space && buf[roundPos] == UInt8(' '))
buf[roundPos + 1] = UInt8('1')
e += 1
break
Expand Down
2 changes: 1 addition & 1 deletion base/ryu/fixed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
dotPos = 1
while true
roundPos -= 1
if roundPos == (startpos - 1) || (buf[roundPos] == UInt8('-'))
if roundPos == (startpos - 1) || (buf[roundPos] == UInt8('-')) || (plus && buf[roundPos] == UInt8('+')) || (space && buf[roundPos] == UInt8(' '))
buf[roundPos + 1] = UInt8('1')
if dotPos > 1
buf[dotPos] = UInt8('0')
Expand Down
2 changes: 1 addition & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ function show_signature_function(io::IO, @nospecialize(ft), demangle=false, farg
uwf = unwrap_unionall(f)
parens = isa(f, UnionAll) && !(isa(uwf, DataType) && f === uwf.name.wrapper)
parens && print(io, "(")
show(io, f)
print_within_stacktrace(io, f, bold=true)
parens && print(io, ")")
else
if html
Expand Down
Loading

0 comments on commit 7cbb02d

Please sign in to comment.