Skip to content

Commit c981a57

Browse files
authored
Merge pull request #38949 from JuliaLang/backports-release-1.6
Backports 1.6-beta
2 parents de69b02 + f34a4d8 commit c981a57

File tree

1,085 files changed

+1868
-1476
lines changed
  • base
  • cli
  • contrib
  • deps/checksums
    • Clang.v11.0.0+5.aarch64-apple-darwin.tar.gz
    • Clang.v11.0.0+5.aarch64-linux-gnu-cxx03.tar.gz
    • Clang.v11.0.0+5.aarch64-linux-gnu-cxx11.tar.gz
    • Clang.v11.0.0+5.aarch64-linux-musl-cxx03.tar.gz
    • Clang.v11.0.0+5.aarch64-linux-musl-cxx11.tar.gz
    • Clang.v11.0.0+5.armv6l-linux-gnueabihf-cxx03.tar.gz
    • Clang.v11.0.0+5.armv6l-linux-gnueabihf-cxx11.tar.gz
    • Clang.v11.0.0+5.armv6l-linux-musleabihf-cxx03.tar.gz
    • Clang.v11.0.0+5.armv6l-linux-musleabihf-cxx11.tar.gz
    • Clang.v11.0.0+5.armv7l-linux-gnueabihf-cxx03.tar.gz
    • Clang.v11.0.0+5.armv7l-linux-gnueabihf-cxx11.tar.gz
    • Clang.v11.0.0+5.armv7l-linux-musleabihf-cxx03.tar.gz
    • Clang.v11.0.0+5.armv7l-linux-musleabihf-cxx11.tar.gz
    • Clang.v11.0.0+5.i686-linux-gnu-cxx03.tar.gz
    • Clang.v11.0.0+5.i686-linux-gnu-cxx11.tar.gz
    • Clang.v11.0.0+5.i686-linux-musl-cxx03.tar.gz
    • Clang.v11.0.0+5.i686-linux-musl-cxx11.tar.gz
    • Clang.v11.0.0+5.i686-w64-mingw32-cxx03.tar.gz
    • Clang.v11.0.0+5.i686-w64-mingw32-cxx11.tar.gz
    • Clang.v11.0.0+5.powerpc64le-linux-gnu-cxx03.tar.gz
    • Clang.v11.0.0+5.powerpc64le-linux-gnu-cxx11.tar.gz
    • Clang.v11.0.0+5.x86_64-apple-darwin.tar.gz
    • Clang.v11.0.0+5.x86_64-linux-gnu-cxx03.tar.gz
    • Clang.v11.0.0+5.x86_64-linux-gnu-cxx11.tar.gz
    • Clang.v11.0.0+5.x86_64-linux-musl-cxx03.tar.gz
    • Clang.v11.0.0+5.x86_64-linux-musl-cxx11.tar.gz
    • Clang.v11.0.0+5.x86_64-unknown-freebsd.tar.gz
    • Clang.v11.0.0+5.x86_64-w64-mingw32-cxx03.tar.gz
    • Clang.v11.0.0+5.x86_64-w64-mingw32-cxx11.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.aarch64-apple-darwin-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.aarch64-linux-gnu-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.aarch64-linux-gnu-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.aarch64-linux-gnu-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.aarch64-linux-musl-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.aarch64-linux-musl-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.aarch64-linux-musl-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv6l-linux-gnueabihf-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv6l-linux-gnueabihf-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv6l-linux-gnueabihf-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv6l-linux-musleabihf-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv6l-linux-musleabihf-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv6l-linux-musleabihf-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv7l-linux-gnueabihf-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv7l-linux-gnueabihf-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv7l-linux-gnueabihf-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv7l-linux-musleabihf-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv7l-linux-musleabihf-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.armv7l-linux-musleabihf-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.i686-linux-gnu-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.i686-linux-gnu-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.i686-linux-gnu-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.i686-linux-musl-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.i686-linux-musl-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.i686-linux-musl-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.i686-w64-mingw32-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.i686-w64-mingw32-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.i686-w64-mingw32-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.powerpc64le-linux-gnu-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.powerpc64le-linux-gnu-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.powerpc64le-linux-gnu-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-apple-darwin-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-apple-darwin-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-apple-darwin-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-linux-gnu-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-linux-gnu-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-linux-gnu-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-linux-musl-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-linux-musl-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-linux-musl-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-unknown-freebsd-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-unknown-freebsd-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-unknown-freebsd-libgfortran5.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-w64-mingw32-libgfortran3.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-w64-mingw32-libgfortran4.tar.gz
    • CompilerSupportLibraries.v0.3.6+1.x86_64-w64-mingw32-libgfortran5.tar.gz
    • GMP.v6.2.0+5.aarch64-apple-darwin.tar.gz
    • GMP.v6.2.0+5.aarch64-linux-gnu-cxx03.tar.gz
    • GMP.v6.2.0+5.aarch64-linux-gnu-cxx11.tar.gz
    • GMP.v6.2.0+5.aarch64-linux-musl-cxx03.tar.gz
    • GMP.v6.2.0+5.aarch64-linux-musl-cxx11.tar.gz
    • GMP.v6.2.0+5.armv6l-linux-gnueabihf-cxx03.tar.gz
    • GMP.v6.2.0+5.armv6l-linux-gnueabihf-cxx11.tar.gz
    • GMP.v6.2.0+5.armv6l-linux-musleabihf-cxx03.tar.gz
    • GMP.v6.2.0+5.armv6l-linux-musleabihf-cxx11.tar.gz
    • GMP.v6.2.0+5.armv7l-linux-gnueabihf-cxx03.tar.gz
    • GMP.v6.2.0+5.armv7l-linux-gnueabihf-cxx11.tar.gz
    • GMP.v6.2.0+5.armv7l-linux-musleabihf-cxx03.tar.gz
    • GMP.v6.2.0+5.armv7l-linux-musleabihf-cxx11.tar.gz
    • GMP.v6.2.0+5.i686-linux-gnu-cxx03.tar.gz
    • GMP.v6.2.0+5.i686-linux-gnu-cxx11.tar.gz
    • GMP.v6.2.0+5.i686-linux-musl-cxx03.tar.gz
    • GMP.v6.2.0+5.i686-linux-musl-cxx11.tar.gz
    • GMP.v6.2.0+5.i686-w64-mingw32-cxx03.tar.gz
    • GMP.v6.2.0+5.i686-w64-mingw32-cxx11.tar.gz
    • GMP.v6.2.0+5.powerpc64le-linux-gnu-cxx03.tar.gz
    • GMP.v6.2.0+5.powerpc64le-linux-gnu-cxx11.tar.gz
    • GMP.v6.2.0+5.x86_64-apple-darwin.tar.gz
    • GMP.v6.2.0+5.x86_64-linux-gnu-cxx03.tar.gz
    • GMP.v6.2.0+5.x86_64-linux-gnu-cxx11.tar.gz
    • GMP.v6.2.0+5.x86_64-linux-musl-cxx03.tar.gz
    • GMP.v6.2.0+5.x86_64-linux-musl-cxx11.tar.gz
    • GMP.v6.2.0+5.x86_64-unknown-freebsd.tar.gz
    • GMP.v6.2.0+5.x86_64-w64-mingw32-cxx03.tar.gz
    • GMP.v6.2.0+5.x86_64-w64-mingw32-cxx11.tar.gz
    • LLVM.v11.0.0+6.aarch64-apple-darwin.tar.gz
    • LLVM.v11.0.0+6.aarch64-linux-gnu-cxx03.tar.gz
    • LLVM.v11.0.0+6.aarch64-linux-gnu-cxx11.tar.gz
    • LLVM.v11.0.0+6.aarch64-linux-musl-cxx03.tar.gz
    • LLVM.v11.0.0+6.aarch64-linux-musl-cxx11.tar.gz
    • LLVM.v11.0.0+6.armv6l-linux-gnueabihf-cxx03.tar.gz
    • LLVM.v11.0.0+6.armv6l-linux-gnueabihf-cxx11.tar.gz
    • LLVM.v11.0.0+6.armv6l-linux-musleabihf-cxx03.tar.gz
    • LLVM.v11.0.0+6.armv6l-linux-musleabihf-cxx11.tar.gz
    • LLVM.v11.0.0+6.armv7l-linux-gnueabihf-cxx03.tar.gz
    • LLVM.v11.0.0+6.armv7l-linux-gnueabihf-cxx11.tar.gz
    • LLVM.v11.0.0+6.armv7l-linux-musleabihf-cxx03.tar.gz
    • LLVM.v11.0.0+6.armv7l-linux-musleabihf-cxx11.tar.gz
    • LLVM.v11.0.0+6.i686-linux-gnu-cxx03.tar.gz
    • LLVM.v11.0.0+6.i686-linux-gnu-cxx11.tar.gz
    • LLVM.v11.0.0+6.i686-linux-musl-cxx03.tar.gz
    • LLVM.v11.0.0+6.i686-linux-musl-cxx11.tar.gz
    • LLVM.v11.0.0+6.i686-w64-mingw32-cxx03.tar.gz
    • LLVM.v11.0.0+6.i686-w64-mingw32-cxx11.tar.gz
    • LLVM.v11.0.0+6.powerpc64le-linux-gnu-cxx03.tar.gz
    • LLVM.v11.0.0+6.powerpc64le-linux-gnu-cxx11.tar.gz
    • LLVM.v11.0.0+6.x86_64-apple-darwin.tar.gz
    • LLVM.v11.0.0+6.x86_64-linux-gnu-cxx03.tar.gz
    • LLVM.v11.0.0+6.x86_64-linux-gnu-cxx11.tar.gz
    • LLVM.v11.0.0+6.x86_64-linux-musl-cxx03.tar.gz
    • LLVM.v11.0.0+6.x86_64-linux-musl-cxx11.tar.gz
    • LLVM.v11.0.0+6.x86_64-unknown-freebsd.tar.gz
    • LLVM.v11.0.0+6.x86_64-w64-mingw32-cxx03.tar.gz
    • LLVM.v11.0.0+6.x86_64-w64-mingw32-cxx11.tar.gz
    • LibCURL-8310487053915d5c995513f569ad85ba65c3544f.tar.gz
    • LibCURL.v7.73.0+3.aarch64-apple-darwin.tar.gz
    • LibCURL.v7.73.0+3.aarch64-linux-gnu.tar.gz
    • LibCURL.v7.73.0+3.aarch64-linux-musl.tar.gz
    • LibCURL.v7.73.0+3.armv6l-linux-gnueabihf.tar.gz
    • LibCURL.v7.73.0+3.armv6l-linux-musleabihf.tar.gz

Some content is hidden

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

1,085 files changed

+1868
-1476
lines changed

Make.inc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ endef
328328
$(foreach D,libdir private_libdir datarootdir libexecdir docdir sysconfdir includedir,$(eval $(call cache_rel_path,$(D),$(bindir))))
329329
$(foreach D,build_libdir build_private_libdir,$(eval $(call cache_rel_path,$(D),$(build_bindir))))
330330

331+
# Save a special one: reverse_private_libdir_rel: usually just `../`, but good to be general:
332+
reverse_private_libdir_rel_eval = $(call rel_path,$(private_libdir),$(libdir))
333+
reverse_private_libdir_rel = $(call hit_cache,reverse_private_libdir_rel_eval)
334+
331335
INSTALL_F := $(JULIAHOME)/contrib/install.sh 644
332336
INSTALL_M := $(JULIAHOME)/contrib/install.sh 755
333337

@@ -662,6 +666,7 @@ endif
662666
# put the version number before the .dylib. Otherwise, put it after.
663667
ifeq ($(OS), WINNT)
664668
JL_MAJOR_MINOR_SHLIB_EXT := $(SHLIB_EXT)
669+
JL_MAJOR_SHLIB_EXT := $(SHLIB_EXT)
665670
else
666671
ifeq ($(OS), Darwin)
667672
JL_MAJOR_MINOR_SHLIB_EXT := $(SOMAJOR).$(SOMINOR).$(SHLIB_EXT)
@@ -795,6 +800,11 @@ XC_HOST := $(ARCH)$(shell echo $(BUILD_MACHINE) | sed "s/[^-]*\(.*\)$$/\1/")
795800
endif
796801
endif
797802

803+
# Normalize ppc64le to powerpc64le
804+
ifeq ($(ARCH), ppc64le)
805+
override ARCH := powerpc64le
806+
endif
807+
798808
ifeq ($(ARCH),mingw32)
799809
$(error "the mingw32 compiler you are using fails the openblas testsuite. please see the README.windows document for a replacement")
800810
else ifeq (cygwin, $(shell $(CC) -dumpmachine | cut -d\- -f3))
@@ -1528,11 +1538,11 @@ define dep_lib_path
15281538
$$($(PYTHON) $(call python_cygpath,$(JULIAHOME)/contrib/relative_path.py) $(1) $(2))
15291539
endef
15301540

1531-
LIBJULIAINTERNAL_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/libjulia-internal.$(JL_MAJOR_MINOR_SHLIB_EXT))
1532-
LIBJULIAINTERNAL_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/libjulia-internal.$(JL_MAJOR_MINOR_SHLIB_EXT))
1541+
LIBJULIAINTERNAL_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/libjulia-internal.$(JL_MAJOR_SHLIB_EXT))
1542+
LIBJULIAINTERNAL_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/libjulia-internal.$(JL_MAJOR_SHLIB_EXT))
15331543

1534-
LIBJULIAINTERNAL_DEBUG_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/libjulia-internal-debug.$(JL_MAJOR_MINOR_SHLIB_EXT))
1535-
LIBJULIAINTERNAL_DEBUG_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/libjulia-internal-debug.$(JL_MAJOR_MINOR_SHLIB_EXT))
1544+
LIBJULIAINTERNAL_DEBUG_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/libjulia-internal-debug.$(JL_MAJOR_SHLIB_EXT))
1545+
LIBJULIAINTERNAL_DEBUG_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/libjulia-internal-debug.$(JL_MAJOR_SHLIB_EXT))
15361546

15371547
ifeq ($(OS),WINNT)
15381548
ifeq ($(BINARY),32)

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ julia-sysimg-bc : julia-stdlib julia-base julia-cli-$(JULIA_BUILD_MODE) julia-sr
8787
julia-sysimg-release julia-sysimg-debug : julia-sysimg-% : julia-sysimg-ji julia-cli-%
8888
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-$*
8989

90-
julia-debug julia-release : julia-% : julia-sysimg-% julia-symlink julia-libccalltest julia-libllvmcalltest julia-base-cache
90+
julia-debug julia-release : julia-% : julia-sysimg-% julia-src-% julia-symlink julia-libccalltest julia-libllvmcalltest julia-base-cache
9191

9292
debug release : % : julia-%
9393

@@ -163,7 +163,7 @@ endif
163163
# private libraries, that are installed in $(prefix)/lib/julia
164164
JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest libjulia-internal
165165
ifeq ($(BUNDLE_DEBUG_LIBS),1)
166-
JL_TARGETS += libjulia-internal-debug
166+
JL_PRIVATE_LIBS-0 += libjulia-internal-debug
167167
endif
168168
ifeq ($(USE_GPL_LIBS), 1)
169169
JL_PRIVATE_LIBS-0 += libsuitesparse_wrapper
@@ -357,6 +357,15 @@ endif
357357
$(call stringreplace,$${DEBUG_TARGET},sys-debug.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys-debug.$(SHLIB_EXT)); \
358358
fi;
359359
endif
360+
361+
# Set rpath for libjulia-internal, which is moving from `../lib` to `../lib/julia`. We only need to do this for Linux/FreeBSD
362+
ifneq (,$(findstring $(OS),Linux FreeBSD))
363+
$(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal.$(SHLIB_EXT)
364+
ifeq ($(BUNDLE_DEBUG_LIBS),1)
365+
$(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal-debug.$(SHLIB_EXT)
366+
endif
367+
endif
368+
360369

361370
ifneq ($(LOADER_BUILD_DEP_LIBS),$(LOADER_INSTALL_DEP_LIBS))
362371
# Next, overwrite relative path to libjulia-internal in our loader if $(LOADER_BUILD_DEP_LIBS) != $(LOADER_INSTALL_DEP_LIBS)
@@ -442,6 +451,7 @@ endif
442451
# Download all stdlibs and include the tarball filenames in light-source-dist.tmp
443452
@$(MAKE) -C stdlib getall NO_GIT=1
444453
-ls stdlib/srccache/*.tar.gz >> light-source-dist.tmp
454+
-ls stdlib/*/StdlibArtifacts.toml >> light-source-dist.tmp
445455

446456
# Exclude git, github and CI config files
447457
git ls-files | sed -E -e '/^\..+/d' -e '/\/\..+/d' -e '/appveyor.yml/d' >> light-source-dist.tmp

base/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ $(BUILDDIR)/errno_h.jl:
4242
$(BUILDDIR)/file_constants.jl: $(SRCDIR)/../src/file_constants.h
4343
@$(call PRINT_PERL, $(CPP_STDOUT) -DJULIA $< | perl -nle 'print "$$1 0o$$2" if /^(\s*const\s+[A-z_]+\s+=)\s+(0[0-9]*)\s*$$/; print "$$1" if /^\s*(const\s+[A-z_]+\s+=\s+([1-9]|0x)[0-9A-z]*)\s*$$/' > $@)
4444

45-
$(BUILDDIR)/uv_constants.jl: $(SRCDIR)/../src/uv_constants.h $(build_includedir)/uv/errno.h
45+
$(BUILDDIR)/uv_constants.jl: $(SRCDIR)/../src/uv_constants.h $(LIBUV_INC)/uv/errno.h
4646
@$(call PRINT_PERL, $(CPP_STDOUT) "-I$(LIBUV_INC)" -DJULIA $< | tail -n 16 > $@)
4747

4848
$(BUILDDIR)/build_h.jl.phony:

base/abstractarray.jl

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ julia> axes(A)
8686
"""
8787
function axes(A)
8888
@_inline_meta
89-
map(OneTo, size(A))
89+
map(oneto, size(A))
9090
end
9191

9292
"""
@@ -107,10 +107,10 @@ require_one_based_indexing(A...) = !has_offset_axes(A...) || throw(ArgumentError
107107
# in other applications.
108108
axes1(A::AbstractArray{<:Any,0}) = OneTo(1)
109109
axes1(A::AbstractArray) = (@_inline_meta; axes(A)[1])
110-
axes1(iter) = OneTo(length(iter))
110+
axes1(iter) = oneto(length(iter))
111111

112112
unsafe_indices(A) = axes(A)
113-
unsafe_indices(r::AbstractRange) = (OneTo(unsafe_length(r)),) # Ranges use checked_sub for size
113+
unsafe_indices(r::AbstractRange) = (oneto(unsafe_length(r)),) # Ranges use checked_sub for size
114114

115115
keys(a::AbstractArray) = CartesianIndices(axes(a))
116116
keys(a::AbstractVector) = LinearIndices(a)
@@ -308,7 +308,7 @@ function eachindex(A::AbstractArray, B::AbstractArray...)
308308
@_inline_meta
309309
eachindex(IndexStyle(A,B...), A, B...)
310310
end
311-
eachindex(::IndexLinear, A::AbstractArray) = (@_inline_meta; OneTo(length(A)))
311+
eachindex(::IndexLinear, A::AbstractArray) = (@_inline_meta; oneto(length(A)))
312312
eachindex(::IndexLinear, A::AbstractVector) = (@_inline_meta; axes1(A))
313313
function eachindex(::IndexLinear, A::AbstractArray, B::AbstractArray...)
314314
@_inline_meta
@@ -1481,12 +1481,11 @@ vcat(V::AbstractVector{T}...) where {T} = typed_vcat(T, V...)
14811481
# but that solution currently fails (see #27188 and #27224)
14821482
AbstractVecOrTuple{T} = Union{AbstractVector{<:T}, Tuple{Vararg{T}}}
14831483

1484-
function _typed_vcat(::Type{T}, V::AbstractVecOrTuple{AbstractVector}) where T
1485-
n = 0
1486-
for Vk in V
1487-
n += Int(length(Vk))::Int
1488-
end
1489-
a = similar(V[1], T, n)
1484+
_typed_vcat_similar(V, T, n) = similar(V[1], T, n)
1485+
_typed_vcat(::Type{T}, V::AbstractVecOrTuple{AbstractVector}) where T =
1486+
_typed_vcat!(_typed_vcat_similar(V, T, mapreduce(length, +, V)), V)
1487+
1488+
function _typed_vcat!(a::AbstractVector{T}, V::AbstractVecOrTuple{AbstractVector}) where T
14901489
pos = 1
14911490
for k=1:Int(length(V))::Int
14921491
Vk = V[k]
@@ -1632,15 +1631,15 @@ _cat(dims, X...) = cat_t(promote_eltypeof(X...), X...; dims=dims)
16321631
@inline cat_t(::Type{T}, X...; dims) where {T} = _cat_t(dims, T, X...)
16331632
@inline function _cat_t(dims, ::Type{T}, X...) where {T}
16341633
catdims = dims2cat(dims)
1635-
shape = cat_shape(catdims, map(cat_size, X)::Tuple{Vararg{Union{Int,Dims}}})::Dims
1634+
shape = cat_shape(catdims, map(cat_size, X))
16361635
A = cat_similar(X[1], T, shape)
16371636
if count(!iszero, catdims)::Int > 1
16381637
fill!(A, zero(T))
16391638
end
16401639
return __cat(A, shape, catdims, X...)
16411640
end
16421641

1643-
function __cat(A, shape::NTuple{M,Int}, catdims, X...) where M
1642+
function __cat(A, shape::NTuple{M}, catdims, X...) where M
16441643
N = M::Int
16451644
offsets = zeros(Int, N)
16461645
inds = Vector{UnitRange{Int}}(undef, N)

base/arrayshow.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ Alignment is reported as a vector of (left,right) tuples, one for each
5858
column going across the screen.
5959
"""
6060
function alignment(io::IO, X::AbstractVecOrMat,
61-
rows::AbstractVector, cols::AbstractVector,
62-
cols_if_complete::Integer, cols_otherwise::Integer, sep::Integer)
63-
a = Tuple{Int, Int}[]
61+
rows::AbstractVector{T}, cols::AbstractVector{V},
62+
cols_if_complete::Integer, cols_otherwise::Integer, sep::Integer) where {T,V}
63+
a = Tuple{T, V}[]
6464
for j in cols # need to go down each column one at a time
6565
l = r = 0
6666
for i in rows # plumb down and see what largest element sizes are
@@ -166,6 +166,11 @@ function print_matrix(io::IO, @nospecialize(X::AbstractVecOrMat),
166166
vdots::AbstractString = "\u22ee",
167167
ddots::AbstractString = " \u22f1 ",
168168
hmod::Integer = 5, vmod::Integer = 5)
169+
# use invokelatest to avoid backtracing in type invalidation, ref #37741
170+
invokelatest(_print_matrix, io, X, pre, sep, post, hdots, vdots, ddots, hmod, vmod, unitrange(axes(X,1)), unitrange(axes(X,2)))
171+
end
172+
173+
function _print_matrix(io, @nospecialize(X::AbstractVecOrMat), pre, sep, post, hdots, vdots, ddots, hmod, vmod, rowsA, colsA)
169174
hmod, vmod = Int(hmod)::Int, Int(vmod)::Int
170175
if !(get(io, :limit, false)::Bool)
171176
screenheight = screenwidth = typemax(Int)
@@ -178,7 +183,6 @@ function print_matrix(io::IO, @nospecialize(X::AbstractVecOrMat),
178183
postsp = ""
179184
@assert textwidth(hdots) == textwidth(ddots)
180185
sepsize = length(sep)::Int
181-
rowsA, colsA = UnitRange{Int}(axes(X,1)), UnitRange{Int}(axes(X,2))
182186
m, n = length(rowsA), length(colsA)
183187
# To figure out alignments, only need to look at as many rows as could
184188
# fit down screen. If screen has at least as many rows as A, look at A.

base/compiler/utilities.jl

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,45 @@ end
139139
const nonfunction_mt = typename(SimpleVector).mt
140140

141141
function get_compileable_sig(method::Method, @nospecialize(atypes), sparams::SimpleVector)
142-
isa(atypes, DataType) || return Nothing
142+
isa(atypes, DataType) || return nothing
143143
mt = ccall(:jl_method_table_for, Any, (Any,), atypes)
144144
mt === nothing && return nothing
145145
return ccall(:jl_normalize_to_compilable_sig, Any, (Any, Any, Any, Any),
146146
mt, atypes, sparams, method)
147147
end
148148

149+
# eliminate UnionAll vars that might be degenerate due to having identical bounds,
150+
# or a concrete upper bound and appearing covariantly.
151+
function subst_trivial_bounds(@nospecialize(atypes))
152+
if !isa(atypes, UnionAll)
153+
return atypes
154+
end
155+
v = atypes.var
156+
if isconcretetype(v.ub) || v.lb === v.ub
157+
return subst_trivial_bounds(atypes{v.ub})
158+
end
159+
return UnionAll(v, subst_trivial_bounds(atypes.body))
160+
end
161+
162+
# If removing trivial vars from atypes results in an equivalent type, use that
163+
# instead. Otherwise we can get a case like issue #38888, where a signature like
164+
# f(x::S) where S<:Int
165+
# gets cached and matches a concrete dispatch case.
166+
function normalize_typevars(method::Method, @nospecialize(atypes), sparams::SimpleVector)
167+
at2 = subst_trivial_bounds(atypes)
168+
if at2 !== atypes && at2 == atypes
169+
atypes = at2
170+
sp_ = ccall(:jl_type_intersection_with_env, Any, (Any, Any), at2, method.sig)::SimpleVector
171+
sparams = sp_[2]::SimpleVector
172+
end
173+
return atypes, sparams
174+
end
175+
149176
# get a handle to the unique specialization object representing a particular instantiation of a call
150177
function specialize_method(method::Method, @nospecialize(atypes), sparams::SimpleVector, preexisting::Bool=false, compilesig::Bool=false)
178+
if isa(atypes, UnionAll)
179+
atypes, sparams = normalize_typevars(method, atypes, sparams)
180+
end
151181
if compilesig
152182
new_atypes = get_compileable_sig(method, atypes, sparams)
153183
new_atypes === nothing && return nothing

base/loading.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ function project_deps_get(env::String, name::String)::Union{Nothing,PkgId}
360360
end
361361

362362
function manifest_deps_get(env::String, where::PkgId, name::String)::Union{Nothing,PkgId}
363-
@assert where.uuid !== nothing
363+
uuid = where.uuid
364+
@assert uuid !== nothing
364365
project_file = env_project_file(env)
365366
if project_file isa String
366367
# first check if `where` names the Project itself
@@ -371,7 +372,7 @@ function manifest_deps_get(env::String, where::PkgId, name::String)::Union{Nothi
371372
return PkgId(pkg_uuid, name)
372373
end
373374
# look for manifest file and `where` stanza
374-
return explicit_manifest_deps_get(project_file, where.uuid, name)
375+
return explicit_manifest_deps_get(project_file, uuid, name)
375376
elseif project_file
376377
# if env names a directory, search it
377378
return implicit_manifest_deps_get(env, where, name)

base/meta.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ function _partially_inline!(@nospecialize(x), slot_replacements::Vector{Any},
354354
return Core.GotoIfNot(
355355
_partially_inline!(x.cond, slot_replacements, type_signature, static_param_values,
356356
slot_offset, statement_offset, boundscheck),
357-
x.dest,
357+
x.dest + statement_offset,
358358
)
359359
end
360360
if isa(x, Expr)

base/options.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct JLOptions
4545
image_file_specified::Int8
4646
warn_scope::Int8
4747
image_codegen::Int8
48+
rr_detach::Int8
4849
end
4950

5051
# This runs early in the sysimage != is not defined yet

base/range.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ unitrange_last(start::T, stop::T) where {T} =
295295
ifelse(stop >= start, convert(T,start+floor(stop-start)),
296296
convert(T,start-oneunit(stop-start)))
297297

298+
unitrange(x) = UnitRange(x)
299+
298300
if isdefined(Main, :Base)
299301
# Constant-fold-able indexing into tuples to functionally expose Base.tail and Base.front
300302
function getindex(@nospecialize(t::Tuple), r::UnitRange)
@@ -332,6 +334,7 @@ struct OneTo{T<:Integer} <: AbstractUnitRange{T}
332334
end
333335
OneTo(stop::T) where {T<:Integer} = OneTo{T}(stop)
334336
OneTo(r::AbstractRange{T}) where {T<:Integer} = OneTo{T}(r)
337+
oneto(r) = OneTo(r)
335338

336339
## Step ranges parameterized by length
337340

base/reshapedarray.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ rdims(out::Tuple{}, inds::NTuple{M,Any}) where {M} = ()
153153
rdims(out::Tuple{Any}, inds::Tuple{}) = out # N == 1, M == 0
154154
rdims(out::NTuple{N,Any}, inds::Tuple{}) where {N} = out # N > 1, M == 0
155155
rdims(out::Tuple{Any}, inds::Tuple{Any}) = inds # N == 1, M == 1
156-
rdims(out::Tuple{Any}, inds::NTuple{M,Any}) where {M} = (OneTo(rdims_trailing(inds...)),) # N == 1, M > 1
156+
rdims(out::Tuple{Any}, inds::NTuple{M,Any}) where {M} = (oneto(rdims_trailing(inds...)),) # N == 1, M > 1
157157
rdims(out::NTuple{N,Any}, inds::NTuple{N,Any}) where {N} = inds # N > 1, M == N
158158
rdims(out::NTuple{N,Any}, inds::NTuple{M,Any}) where {N,M} = (first(inds), rdims(tail(out), tail(inds))...) # N > 1, M > 1, M != N
159159

@@ -207,7 +207,7 @@ size(A::ReshapedArray) = A.dims
207207
similar(A::ReshapedArray, eltype::Type, dims::Dims) = similar(parent(A), eltype, dims)
208208
IndexStyle(::Type{<:ReshapedArrayLF}) = IndexLinear()
209209
parent(A::ReshapedArray) = A.parent
210-
parentindices(A::ReshapedArray) = map(OneTo, size(parent(A)))
210+
parentindices(A::ReshapedArray) = map(oneto, size(parent(A)))
211211
reinterpret(::Type{T}, A::ReshapedArray, dims::Dims) where {T} = reinterpret(T, parent(A), dims)
212212
elsize(::Type{<:ReshapedArray{<:Any,<:Any,P}}) where {P} = elsize(P)
213213

base/subarray.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ viewindexing(I::Tuple{Vararg{Any}}) = IndexCartesian()
6060
viewindexing(I::Tuple{AbstractArray, Vararg{Any}}) = IndexCartesian()
6161

6262
# Simple utilities
63-
size(V::SubArray) = (@_inline_meta; map(n->Int(unsafe_length(n)), axes(V)))
63+
size(V::SubArray) = (@_inline_meta; map(unsafe_length, axes(V)))
6464

6565
similar(V::SubArray, T::Type, dims::Dims) = similar(V.parent, T, dims)
6666

@@ -90,7 +90,7 @@ julia> parentindices(V)
9090
(1, Base.Slice(Base.OneTo(2)))
9191
```
9292
"""
93-
parentindices(a::AbstractArray) = map(OneTo, size(a))
93+
parentindices(a::AbstractArray) = map(oneto, size(a))
9494

9595
## Aliasing detection
9696
dataids(A::SubArray) = (dataids(A.parent)..., _splatmap(dataids, A.indices)...)
@@ -107,7 +107,7 @@ function unaliascopy(V::SubArray{T,N,A,I,LD}) where {T,N,A<:Array,I<:Tuple{Varar
107107
end
108108
# Transform indices to be "dense"
109109
_trimmedindex(i::Real) = oftype(i, 1)
110-
_trimmedindex(i::AbstractUnitRange) = oftype(i, OneTo(length(i)))
110+
_trimmedindex(i::AbstractUnitRange) = oftype(i, oneto(length(i)))
111111
_trimmedindex(i::AbstractArray) = oftype(i, reshape(eachindex(IndexLinear(), i), axes(i)))
112112

113113
## SubArray creation

0 commit comments

Comments
 (0)