Skip to content

Commit 7cbb02d

Browse files
authored
Merge pull request #40209 from JuliaLang/backports-release-1.6
Backports for release 1.6.1
2 parents 9283b6c + 23e5f6f commit 7cbb02d

File tree

75 files changed

+1775
-758
lines changed

Some content is hidden

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

75 files changed

+1775
-758
lines changed

Make.inc

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,21 @@ else
626626
SHLIB_EXT := so
627627
endif
628628

629+
ifeq ($(OS),WINNT)
630+
define versioned_libname
631+
$$(if $(2),$(1)-$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
632+
endef
633+
else ifeq ($(OS),Darwin)
634+
define versioned_libname
635+
$$(if $(2),$(1).$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
636+
endef
637+
else
638+
define versioned_libname
639+
$$(if $(2),$(1).$(SHLIB_EXT).$(2),$(1).$(SHLIB_EXT))
640+
endef
641+
endif
642+
643+
629644
ifeq ($(SHLIB_EXT), so)
630645
define SONAME_FLAGS
631646
-Wl,-soname=$1
@@ -1178,6 +1193,8 @@ BB_TRIPLET_LIBGFORTRAN := $(subst $(SPACE),-,$(filter-out cxx%,$(subst -,$(SPACE
11781193
BB_TRIPLET_CXXABI := $(subst $(SPACE),-,$(filter-out libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI))))
11791194
BB_TRIPLET := $(subst $(SPACE),-,$(filter-out cxx%,$(filter-out libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI)))))
11801195

1196+
LIBGFORTRAN_VERSION := $(subst libgfortran,,$(filter libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN))))
1197+
11811198
# This is the set of projects that BinaryBuilder dependencies are hooked up for.
11821199
BB_PROJECTS := OPENBLAS LLVM SUITESPARSE OPENLIBM GMP MBEDTLS LIBSSH2 NGHTTP2 MPFR CURL LIBGIT2 PCRE LIBUV LIBUNWIND DSFMT OBJCONV ZLIB P7ZIP CSL
11831200
define SET_BB_DEFAULT
@@ -1552,8 +1569,12 @@ ifneq ($(findstring $(OS),Linux FreeBSD),)
15521569
LIBGCC_NAME := libgcc_s.$(SHLIB_EXT).1
15531570
endif
15541571

1555-
1572+
# USE_SYSTEM_CSL causes it to get symlinked into build_private_shlibdir
1573+
ifeq ($(USE_SYSTEM_CSL),1)
1574+
LIBGCC_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_private_shlibdir)/$(LIBGCC_NAME))
1575+
else
15561576
LIBGCC_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/$(LIBGCC_NAME))
1577+
endif
15571578
LIBGCC_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/$(LIBGCC_NAME))
15581579

15591580
# USE_SYSTEM_LIBM and USE_SYSTEM_OPENLIBM causes it to get symlinked into build_private_shlibdir

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,11 @@ endif
291291
done \
292292
done
293293
for suffix in $(JL_PRIVATE_LIBS-1) ; do \
294-
lib=$(build_private_libdir)/$${suffix}.$(SHLIB_EXT); \
295-
$(INSTALL_M) $$lib $(DESTDIR)$(private_libdir) ; \
294+
for lib in $(build_private_libdir)/$${suffix}.$(SHLIB_EXT)*; do \
295+
if [ "$${lib##*.}" != "dSYM" ]; then \
296+
$(INSTALL_M) $$lib $(DESTDIR)$(private_libdir) ; \
297+
fi \
298+
done \
296299
done
297300
endif
298301
# Install `7z` into libexec/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Julia. However, most users should use the most recent stable version
8181
of Julia. You can get this version by changing to the Julia directory
8282
and running:
8383

84-
git checkout v1.5.0
84+
git checkout v1.6.0
8585

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

base/Makefile

Lines changed: 52 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -169,53 +169,69 @@ endif
169169
# echo "$$P"
170170

171171
define symlink_system_library
172-
symlink_$1: $$(build_private_libdir)/$1.$$(SHLIB_EXT)
173-
$$(build_private_libdir)/$1.$$(SHLIB_EXT):
174-
REALPATH=`$$(call spawn,$$(build_depsbindir)/libwhich) -p $$(notdir $$@)` && \
175-
$$(call resolve_path,REALPATH) && \
176-
[ -e "$$$$REALPATH" ] && \
177-
([ ! -e "$$@" ] || rm "$$@") && \
178-
echo ln -sf "$$$$REALPATH" "$$@" && \
179-
ln -sf "$$$$REALPATH" "$$@"
180-
ifneq ($2,)
181-
ifneq ($$(USE_SYSTEM_$2),0)
182-
SYMLINK_SYSTEM_LIBRARIES += symlink_$1
183-
endif
172+
libname_$2 := $$(notdir $(call versioned_libname,$2,$3))
173+
libpath_$2 := $$(shell $$(call spawn,$$(build_depsbindir)/libwhich) -p $$(libname_$2) 2>/dev/null)
174+
symlink_$2: $$(build_private_libdir)/$$(libname_$2)
175+
$$(build_private_libdir)/$$(libname_$2):
176+
@if [ -e "$$(libpath_$2)" ]; then \
177+
REALPATH=$$(libpath_$2); \
178+
$$(call resolve_path,REALPATH) && \
179+
[ -e "$$$$REALPATH" ] && \
180+
([ ! -e "$$@" ] || rm "$$@") && \
181+
echo ln -sf "$$$$REALPATH" "$$@" && \
182+
ln -sf "$$$$REALPATH" "$$@"; \
183+
else \
184+
if [ "$4" != "ALLOW_FAILURE" ]; then \
185+
echo "System library symlink failure: Unable to locate $$(libname_$2) on your system!" >&2; \
186+
false; \
187+
fi; \
188+
fi
189+
ifneq ($$(USE_SYSTEM_$1),0)
190+
SYMLINK_SYSTEM_LIBRARIES += symlink_$2
184191
endif
185192
endef
186193

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

189-
$(eval $(call symlink_system_library,$(LIBMNAME)))
190196
ifneq ($(USE_SYSTEM_LIBM),0)
191-
SYMLINK_SYSTEM_LIBRARIES += symlink_$(LIBMNAME)
197+
$(eval $(call symlink_system_library,LIBM,$(LIBMNAME)))
192198
else ifneq ($(USE_SYSTEM_OPENLIBM),0)
193-
SYMLINK_SYSTEM_LIBRARIES += symlink_$(LIBMNAME)
199+
$(eval $(call symlink_system_library,OPENLIBM,$(LIBMNAME)))
194200
endif
195201

196-
$(eval $(call symlink_system_library,libpcre2-8,PCRE))
197-
$(eval $(call symlink_system_library,libdSFMT,DSFMT))
198-
$(eval $(call symlink_system_library,$(LIBBLASNAME),BLAS))
202+
$(eval $(call symlink_system_library,CSL,libgcc_s,1))
203+
ifneq (,$(LIBGFORTRAN_VERSION))
204+
$(eval $(call symlink_system_library,CSL,libgfortran,$(LIBGFORTRAN_VERSION)))
205+
endif
206+
$(eval $(call symlink_system_library,CSL,libquadmath,0))
207+
$(eval $(call symlink_system_library,CSL,libstdc++,6))
208+
# We allow libssp, libatomic and libgomp to fail as they are not available on all systems
209+
$(eval $(call symlink_system_library,CSL,libssp,0,ALLOW_FAILURE))
210+
$(eval $(call symlink_system_library,CSL,libatomic,1,ALLOW_FAILURE))
211+
$(eval $(call symlink_system_library,CSL,libgomp,1,ALLOW_FAILURE))
212+
$(eval $(call symlink_system_library,PCRE,libpcre2-8))
213+
$(eval $(call symlink_system_library,DSFMT,libdSFMT))
214+
$(eval $(call symlink_system_library,BLAS,$(LIBBLASNAME)))
199215
ifneq ($(LIBLAPACKNAME),$(LIBBLASNAME))
200-
$(eval $(call symlink_system_library,$(LIBLAPACKNAME),LAPACK))
216+
$(eval $(call symlink_system_library,LAPACK,$(LIBLAPACKNAME)))
201217
endif
202-
$(eval $(call symlink_system_library,libgmp,GMP))
203-
$(eval $(call symlink_system_library,libmpfr,MPFR))
204-
$(eval $(call symlink_system_library,libmbedtls,MBEDTLS))
205-
$(eval $(call symlink_system_library,libmbedcrypto,MBEDTLS))
206-
$(eval $(call symlink_system_library,libmbedx509,MBEDTLS))
207-
$(eval $(call symlink_system_library,libssh2,LIBSSH2))
208-
$(eval $(call symlink_system_library,libnghttp2,NGHTTP2))
209-
$(eval $(call symlink_system_library,libcurl,CURL))
210-
$(eval $(call symlink_system_library,libgit2,LIBGIT2))
211-
$(eval $(call symlink_system_library,libamd,SUITESPARSE))
212-
$(eval $(call symlink_system_library,libcamd,SUITESPARSE))
213-
$(eval $(call symlink_system_library,libccolamd,SUITESPARSE))
214-
$(eval $(call symlink_system_library,libcholmod,SUITESPARSE))
215-
$(eval $(call symlink_system_library,libcolamd,SUITESPARSE))
216-
$(eval $(call symlink_system_library,libumfpack,SUITESPARSE))
217-
$(eval $(call symlink_system_library,libspqr,SUITESPARSE))
218-
$(eval $(call symlink_system_library,libsuitesparseconfig,SUITESPARSE))
218+
$(eval $(call symlink_system_library,GMP,libgmp))
219+
$(eval $(call symlink_system_library,MPFR,libmpfr))
220+
$(eval $(call symlink_system_library,MBEDTLS,libmbedtls))
221+
$(eval $(call symlink_system_library,MBEDTLS,libmbedcrypto))
222+
$(eval $(call symlink_system_library,MBEDTLS,libmbedx509))
223+
$(eval $(call symlink_system_library,LIBSSH2,libssh2))
224+
$(eval $(call symlink_system_library,NGHTTP2,libnghttp2))
225+
$(eval $(call symlink_system_library,CURL,libcurl))
226+
$(eval $(call symlink_system_library,LIBGIT2,libgit2))
227+
$(eval $(call symlink_system_library,SUITESPARSE,libamd))
228+
$(eval $(call symlink_system_library,SUITESPARSE,libcamd))
229+
$(eval $(call symlink_system_library,SUITESPARSE,libccolamd))
230+
$(eval $(call symlink_system_library,SUITESPARSE,libcholmod))
231+
$(eval $(call symlink_system_library,SUITESPARSE,libcolamd))
232+
$(eval $(call symlink_system_library,SUITESPARSE,libumfpack))
233+
$(eval $(call symlink_system_library,SUITESPARSE,libspqr))
234+
$(eval $(call symlink_system_library,SUITESPARSE,libsuitesparseconfig))
219235
# EXCLUDED LIBRARIES (installed/used, but not vendored for use with dlopen):
220236
# libunwind
221237
endif # WINNT

base/abstractarray.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ function getindex(A::AbstractArray, I...)
11701170
_getindex(IndexStyle(A), A, to_indices(A, I)...)
11711171
end
11721172
# To avoid invalidations from multidimensional.jl: getindex(A::Array, i1::Union{Integer, CartesianIndex}, I::Union{Integer, CartesianIndex}...)
1173-
getindex(A::Array, i1::Integer, I::Integer...) = A[to_indices(A, (i1, I...))...]
1173+
@propagate_inbounds getindex(A::Array, i1::Integer, I::Integer...) = A[to_indices(A, (i1, I...))...]
11741174

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

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

14941494
function _typed_vcat!(a::AbstractVector{T}, V::AbstractVecOrTuple{AbstractVector}) where T
14951495
pos = 1

base/errorshow.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -555,13 +555,6 @@ end
555555
# replace `sf` as needed.
556556
const update_stackframes_callback = Ref{Function}(identity)
557557

558-
function replaceuserpath(str)
559-
str = replace(str, homedir() => "~")
560-
# seems to be necessary for some paths with small letter drive c:// etc
561-
str = replace(str, lowercasefirst(homedir()) => "~")
562-
return str
563-
end
564-
565558
const STACKTRACE_MODULECOLORS = [:magenta, :cyan, :green, :yellow]
566559
const STACKTRACE_FIXEDCOLORS = IdDict(Base => :light_black, Core => :light_black)
567560

@@ -701,7 +694,7 @@ end
701694
function print_stackframe(io, i, frame::StackFrame, n::Int, digit_align_width, modulecolor)
702695
file, line = string(frame.file), frame.line
703696
stacktrace_expand_basepaths() && (file = something(find_source_file(file), file))
704-
stacktrace_contract_userdir() && (file = replaceuserpath(file))
697+
stacktrace_contract_userdir() && (file = contractuser(file))
705698

706699
# Used by the REPL to make it possible to open
707700
# the location of a stackframe/method in the editor.

base/path.jl

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,19 @@ normpath(a::AbstractString, b::AbstractString...) = normpath(joinpath(a,b...))
387387
Convert a path to an absolute path by adding the current directory if necessary.
388388
Also normalizes the path as in [`normpath`](@ref).
389389
"""
390-
abspath(a::String) = normpath(isabspath(a) ? a : joinpath(pwd(),a))
390+
function abspath(a::String)::String
391+
if !isabspath(a)
392+
cwd = pwd()
393+
a_drive, a_nodrive = splitdrive(a)
394+
if a_drive != "" && lowercase(splitdrive(cwd)[1]) != lowercase(a_drive)
395+
cwd = a_drive * path_separator
396+
a = joinpath(cwd, a_nodrive)
397+
else
398+
a = joinpath(cwd, a)
399+
end
400+
end
401+
return normpath(a)
402+
end
391403

392404
"""
393405
abspath(path::AbstractString, paths::AbstractString...) -> String
@@ -502,12 +514,16 @@ function relpath(path::String, startpath::String = ".")
502514
curdir = "."
503515
pardir = ".."
504516
path == startpath && return curdir
505-
path_drive, path_without_drive = splitdrive(path)
506-
startpath_drive, startpath_without_drive = splitdrive(startpath)
507-
path_arr = split(abspath(path_without_drive), path_separator_re)
508-
start_arr = split(abspath(startpath_without_drive), path_separator_re)
509517
if Sys.iswindows()
510-
lowercase(path_drive) != lowercase(startpath_drive) && return abspath(path)
518+
path_drive, path_without_drive = splitdrive(path)
519+
startpath_drive, startpath_without_drive = splitdrive(startpath)
520+
isempty(startpath_drive) && (startpath_drive = path_drive) # by default assume same as path drive
521+
uppercase(path_drive) == uppercase(startpath_drive) || return abspath(path) # if drives differ return first path
522+
path_arr = split(abspath(path_drive * path_without_drive), path_separator_re)
523+
start_arr = split(abspath(path_drive * startpath_without_drive), path_separator_re)
524+
else
525+
path_arr = split(abspath(path), path_separator_re)
526+
start_arr = split(abspath(startpath), path_separator_re)
511527
end
512528
i = 0
513529
while i < min(length(path_arr), length(start_arr))

base/range.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ function argmin(r::AbstractRange)
632632
elseif step(r) > 0
633633
firstindex(r)
634634
else
635-
first(searchsorted(r, last(r)))
635+
lastindex(r)
636636
end
637637
end
638638

@@ -647,7 +647,7 @@ function argmax(r::AbstractRange)
647647
if isempty(r)
648648
throw(ArgumentError("range must be non-empty"))
649649
elseif step(r) > 0
650-
first(searchsorted(r, last(r)))
650+
lastindex(r)
651651
else
652652
firstindex(r)
653653
end

base/ryu/exp.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
roundPos = pos
214214
while true
215215
roundPos -= 1
216-
if roundPos == (startpos - 1) || buf[roundPos] == UInt8('-')
216+
if roundPos == (startpos - 1) || buf[roundPos] == UInt8('-') || (plus && buf[roundPos] == UInt8('+')) || (space && buf[roundPos] == UInt8(' '))
217217
buf[roundPos + 1] = UInt8('1')
218218
e += 1
219219
break

base/ryu/fixed.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
dotPos = 1
167167
while true
168168
roundPos -= 1
169-
if roundPos == (startpos - 1) || (buf[roundPos] == UInt8('-'))
169+
if roundPos == (startpos - 1) || (buf[roundPos] == UInt8('-')) || (plus && buf[roundPos] == UInt8('+')) || (space && buf[roundPos] == UInt8(' '))
170170
buf[roundPos + 1] = UInt8('1')
171171
if dotPos > 1
172172
buf[dotPos] = UInt8('0')

0 commit comments

Comments
 (0)