diff --git a/Make.inc b/Make.inc index 32c3cd4595a20..c2ccf6757e3c9 100644 --- a/Make.inc +++ b/Make.inc @@ -381,6 +381,10 @@ $(foreach D,build_libdir build_private_libdir,$(eval $(call cache_rel_path,$(D), # Save a special one: reverse_private_libdir_rel: usually just `../`, but good to be general: reverse_private_libdir_rel_eval = $(call rel_path,$(private_libdir),$(libdir)) reverse_private_libdir_rel = $(call hit_cache,reverse_private_libdir_rel_eval) +reverse_private_libexecdir_rel_eval = $(call rel_path,$(private_libexecdir),$(libdir)) +reverse_private_libexecdir_rel = $(call hit_cache,reverse_private_libexecdir_rel_eval) +reverse_build_private_libexecdir_rel_eval = $(call rel_path,$(build_private_libexecdir),$(build_libdir)) +reverse_build_private_libexecdir_rel = $(call hit_cache,reverse_build_private_libexecdir_rel_eval) INSTALL_F := $(JULIAHOME)/contrib/install.sh 644 INSTALL_M := $(JULIAHOME)/contrib/install.sh 755 diff --git a/NEWS.md b/NEWS.md index cc3a766305841..f5f68e508bdd9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -29,6 +29,10 @@ New language features * `Threads.@spawn` now takes a `:samepool` argument to specify the same threadpool as the caller. `Threads.@spawn :samepool foo()` which is shorthand for `Threads.@spawn Threads.threadpool() foo()` ([#57109]). * The `@ccall` macro can now take a `gc_safe` argument, that if set to true allows the runtime to run garbage collection concurrently to the `ccall` ([#49933]). +* A single method covering multiple functions is now allowed in more cases. See issue #54620. ([#58131]). +* The character U+1F8B2 🢲 (RIGHTWARDS ARROW WITH LOWER HOOK), newly added by Unicode 16, + is now a valid operator with arrow precedence, accessible as `\hookunderrightarrow` at the REPL. + ([JuliaLang/JuliaSyntax.jl#525], [#57143]). Language changes ---------------- @@ -289,5 +293,8 @@ Tooling Improvements [#57081]: https://github.com/JuliaLang/julia/issues/57081 [#57087]: https://github.com/JuliaLang/julia/issues/57087 [#57109]: https://github.com/JuliaLang/julia/issues/57109 +[#57143]: https://github.com/JuliaLang/julia/issues/57143 [#57253]: https://github.com/JuliaLang/julia/issues/57253 [#57727]: https://github.com/JuliaLang/julia/issues/57727 +[#58131]: https://github.com/JuliaLang/julia/issues/58131 +[JuliaLang/JuliaSyntax.jl#525]: https://github.com/JuliaLang/JuliaSyntax.jl/pull/525 diff --git a/base/Makefile b/base/Makefile index f748295c2e6fc..eb36d6d0a4319 100644 --- a/base/Makefile +++ b/base/Makefile @@ -71,6 +71,7 @@ endif @printf "%s\n" "const PRIVATE_LIBDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(private_libdir_rel)))) >> $@ @printf "%s\n" "const PRIVATE_LIBEXECDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(private_libexecdir_rel)))) >> $@ @printf "%s\n" "const INCLUDEDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(includedir_rel)))) >> $@ + @printf "%s\n" "const SOURCEDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(shell echo $(call cygpath_w,$(JULIAHOME)))))) >> $@ ifeq ($(DARWIN_FRAMEWORK), 1) @printf "%s\n" "const DARWIN_FRAMEWORK = true" >> $@ @printf "%s\n" "const DARWIN_FRAMEWORK_NAME = \"$(FRAMEWORK_NAME)\"" >> $@ diff --git a/base/array.jl b/base/array.jl index 7fe5ff626f448..665934b8a3a11 100644 --- a/base/array.jl +++ b/base/array.jl @@ -1076,10 +1076,10 @@ function _growbeg!(a::Vector, delta::Integer) len = length(a) offset = memoryrefoffset(ref) newlen = len + delta - setfield!(a, :size, (newlen,)) # if offset is far enough advanced to fit data in existing memory without copying if delta <= offset - 1 setfield!(a, :ref, @inbounds memoryref(ref, 1 - delta)) + setfield!(a, :size, (newlen,)) else @noinline (function() @_terminates_locally_meta @@ -1111,6 +1111,7 @@ function _growbeg!(a::Vector, delta::Integer) end setfield!(a, :ref, @inbounds memoryref(newmem, newoffset)) end)() + setfield!(a, :size, (newlen,)) end return end @@ -1125,7 +1126,6 @@ function _growend!(a::Vector, delta::Integer) len = length(a) newlen = len + delta offset = memoryrefoffset(ref) - setfield!(a, :size, (newlen,)) newmemlen = offset + newlen - 1 if memlen < newmemlen @noinline (function() @@ -1156,6 +1156,7 @@ function _growend!(a::Vector, delta::Integer) setfield!(a, :ref, newref) end)() end + setfield!(a, :size, (newlen,)) return end @@ -1173,7 +1174,6 @@ function _growat!(a::Vector, i::Integer, delta::Integer) memlen = length(mem) newlen = len + delta offset = memoryrefoffset(ref) - setfield!(a, :size, (newlen,)) newmemlen = offset + newlen - 1 # which side would we rather grow into? @@ -1183,11 +1183,13 @@ function _growat!(a::Vector, i::Integer, delta::Integer) newref = @inbounds memoryref(mem, offset - delta) unsafe_copyto!(newref, ref, i) setfield!(a, :ref, newref) + setfield!(a, :size, (newlen,)) for j in i:i+delta-1 @inbounds _unsetindex!(a, j) end elseif !prefer_start && memlen >= newmemlen unsafe_copyto!(mem, offset - 1 + delta + i, mem, offset - 1 + i, len - i + 1) + setfield!(a, :size, (newlen,)) for j in i:i+delta-1 @inbounds _unsetindex!(a, j) end @@ -1201,6 +1203,7 @@ function _growat!(a::Vector, i::Integer, delta::Integer) unsafe_copyto!(newref, ref, i-1) unsafe_copyto!(newmem, newoffset + delta + i - 1, mem, offset + i - 1, len - i + 1) setfield!(a, :ref, newref) + setfield!(a, :size, (newlen,)) end end @@ -1213,11 +1216,11 @@ function _deletebeg!(a::Vector, delta::Integer) @inbounds _unsetindex!(a, i) end newlen = len - delta + setfield!(a, :size, (newlen,)) if newlen != 0 # if newlen==0 we could accidentally index past the memory newref = @inbounds memoryref(a.ref, delta + 1) setfield!(a, :ref, newref) end - setfield!(a, :size, (newlen,)) return end function _deleteend!(a::Vector, delta::Integer) diff --git a/base/initdefs.jl b/base/initdefs.jl index afe7578036baa..03c7f14cfa531 100644 --- a/base/initdefs.jl +++ b/base/initdefs.jl @@ -97,7 +97,7 @@ const DEPOT_PATH = String[] function append_bundled_depot_path!(DEPOT_PATH) path = abspath(Sys.BINDIR, "..", "local", "share", "julia") path in DEPOT_PATH || push!(DEPOT_PATH, path) - path = abspath(Sys.BINDIR, "..", "share", "julia") + path = abspath(Sys.BINDIR, Base.DATAROOTDIR, "julia") path in DEPOT_PATH || push!(DEPOT_PATH, path) return DEPOT_PATH end diff --git a/base/loading.jl b/base/loading.jl index 316f652c78fa3..40db7df679b60 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -462,6 +462,8 @@ function locate_package_env(pkg::PkgId, stopenv::Union{String, Nothing}=nothing) path = manifest_uuid_path(env, pkg) # missing is used as a sentinel to stop looking further down in envs if path === missing + # Before stopping, try stdlib fallback + is_stdlib(pkg) && @goto stdlib_fallback path = nothing @goto done end @@ -473,6 +475,7 @@ function locate_package_env(pkg::PkgId, stopenv::Union{String, Nothing}=nothing) stopenv == env && break end end + @label stdlib_fallback # Allow loading of stdlibs if the name/uuid are given # e.g. if they have been explicitly added to the project/manifest mbypath = manifest_uuid_path(Sys.STDLIB, pkg) diff --git a/base/methodshow.jl b/base/methodshow.jl index cae0e9d809225..bd0355735f4fd 100644 --- a/base/methodshow.jl +++ b/base/methodshow.jl @@ -140,7 +140,7 @@ function fixup_stdlib_path(path::String) if isdefined(@__MODULE__, :Core) && isdefined(Core, :Compiler) compiler_folder = dirname(String(Base.moduleloc(Core.Compiler).file)) if dirname(path) == compiler_folder - return abspath(Sys.STDLIB, "..", "..", "Compiler", "src", basename(path)) + return abspath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "Compiler", "src", basename(path)) end end end diff --git a/base/sysinfo.jl b/base/sysinfo.jl index c96c318ec053b..56a3681ae35f7 100644 --- a/base/sysinfo.jl +++ b/base/sysinfo.jl @@ -14,6 +14,7 @@ export BINDIR, MACHINE, KERNEL, JIT, + PAGESIZE, cpu_info, cpu_summary, uptime, @@ -39,7 +40,7 @@ export BINDIR, which, detectwsl -import ..Base: show +import ..Base: DATAROOTDIR, show """ Sys.BINDIR::String @@ -53,12 +54,10 @@ global BINDIR::String = ccall(:jl_get_julia_bindir, Any, ())::String A string containing the full path to the directory containing the `stdlib` packages. """ -global STDLIB::String = "$BINDIR/../share/julia/stdlib/v$(VERSION.major).$(VERSION.minor)" # for bootstrap +global STDLIB::String = "$BINDIR/$DATAROOTDIR/julia/stdlib/v$(VERSION.major).$(VERSION.minor)" # for bootstrap # In case STDLIB change after julia is built, the variable below can be used # to update cached method locations to updated ones. const BUILD_STDLIB_PATH = STDLIB -# Similarly, this is the root of the julia repo directory that julia was built from -const BUILD_ROOT_PATH = "$BINDIR/../.." # helper to avoid triggering precompile warnings @@ -143,6 +142,13 @@ Note: Included in the detailed system information via `versioninfo(verbose=true) """ global JIT::String +""" + Sys.PAGESIZE::Clong + +A number providing the pagesize of the given OS. Common values being 4kb or 64kb on Linux. +""" +global PAGESIZE::Clong + function __init__() env_threads = nothing if haskey(ENV, "JULIA_CPU_THREADS") @@ -161,6 +167,7 @@ function __init__() global SC_CLK_TCK = ccall(:jl_SC_CLK_TCK, Clong, ()) global CPU_NAME = ccall(:jl_get_cpu_name, Ref{String}, ()) global JIT = ccall(:jl_get_JIT, Ref{String}, ()) + global PAGESIZE = Int(Sys.isunix() ? ccall(:jl_getpagesize, Clong, ()) : ccall(:jl_getallocationgranularity, Clong, ())) __init_build() nothing end @@ -169,7 +176,7 @@ end function __init_build() global BINDIR = ccall(:jl_get_julia_bindir, Any, ())::String vers = "v$(string(VERSION.major)).$(string(VERSION.minor))" - global STDLIB = abspath(BINDIR, "..", "share", "julia", "stdlib", vers) + global STDLIB = abspath(BINDIR, DATAROOTDIR, "julia", "stdlib", vers) nothing end diff --git a/contrib/generate_precompile.jl b/contrib/generate_precompile.jl index 88972be56ab4d..998a77e31452a 100644 --- a/contrib/generate_precompile.jl +++ b/contrib/generate_precompile.jl @@ -348,8 +348,8 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe uuid = "$pkguuid" """) touch(joinpath(pkgpath, "Manifest.toml")) - tmp_prec = tempname(prec_path) - tmp_proc = tempname(prec_path) + tmp_prec = tempname(prec_path; cleanup=false) + tmp_proc = tempname(prec_path; cleanup=false) s = """ pushfirst!(DEPOT_PATH, $(repr(joinpath(prec_path,"depot")))); Base.PRECOMPILE_TRACE_COMPILE[] = $(repr(tmp_prec)); diff --git a/contrib/mac/app/Makefile b/contrib/mac/app/Makefile index 81b7e47cdf2cf..70436a857c265 100644 --- a/contrib/mac/app/Makefile +++ b/contrib/mac/app/Makefile @@ -47,8 +47,8 @@ dmg/$(APP_NAME): startup.applescript julia.icns plutil -insert CFBundleVersion -string "$(JULIA_VERSION_OPT_COMMIT)" $@/Contents/Info.plist plutil -insert NSHumanReadableCopyright -string "$(APP_COPYRIGHT)" $@/Contents/Info.plist -mkdir -p $@/Contents/Resources/julia - make -C $(JULIAHOME) binary-dist - tar zxf $(JULIAHOME)/$(JULIA_BINARYDIST_FILENAME).tar.gz -C $@/Contents/Resources/julia --strip-components 1 + $(MAKE) -C $(JULIAHOME) binary-dist + $(TAR) -xzf $(JULIAHOME)/$(JULIA_BINARYDIST_FILENAME).tar.gz -C $@/Contents/Resources/julia --strip-components 1 find $@/Contents/Resources/julia -type f -exec chmod -w {} \; # Even though the tarball may already be signed, we re-sign here to make it easier to add # unsigned executables (like the app launcher) and whatnot, without needing to maintain lists diff --git a/deps/Makefile b/deps/Makefile index 396b1021c2ddd..cc22b709677fb 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -72,10 +72,12 @@ endif endif endif +PATCHELF_MANIFEST := ifneq (,$(findstring $(OS),Linux FreeBSD OpenBSD)) ifeq ($(USE_SYSTEM_PATCHELF), 0) DEP_LIBS += patchelf PATCHELF:=$(build_depsbindir)/patchelf +PATCHELF_MANIFEST:=$(build_prefix)/manifest/patchelf else PATCHELF:=patchelf endif diff --git a/deps/checksums/LinearAlgebra-5567504893591e552f08cc08353b285182a1c8cc.tar.gz/md5 b/deps/checksums/LinearAlgebra-5567504893591e552f08cc08353b285182a1c8cc.tar.gz/md5 deleted file mode 100644 index 0b24489826784..0000000000000 --- a/deps/checksums/LinearAlgebra-5567504893591e552f08cc08353b285182a1c8cc.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -e9b0f2123d80968562e410dab5d18fce diff --git a/deps/checksums/LinearAlgebra-5567504893591e552f08cc08353b285182a1c8cc.tar.gz/sha512 b/deps/checksums/LinearAlgebra-5567504893591e552f08cc08353b285182a1c8cc.tar.gz/sha512 deleted file mode 100644 index 999958331e4a1..0000000000000 --- a/deps/checksums/LinearAlgebra-5567504893591e552f08cc08353b285182a1c8cc.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -b258fb01851417aa0f17615ce4bfcd501aa1ad3add465ca455fb9f2556df9844ad93ba8f946fd44075b2028a929c0155b8ab7e86a000e162f6600332418f23f4 diff --git a/deps/checksums/LinearAlgebra-997c4b7e7664f30645ef8bd51d8a4203e49c4631.tar.gz/md5 b/deps/checksums/LinearAlgebra-997c4b7e7664f30645ef8bd51d8a4203e49c4631.tar.gz/md5 new file mode 100644 index 0000000000000..0981743e0907a --- /dev/null +++ b/deps/checksums/LinearAlgebra-997c4b7e7664f30645ef8bd51d8a4203e49c4631.tar.gz/md5 @@ -0,0 +1 @@ +1cf83c7ea8935ac0804e07ebe8ce7506 diff --git a/deps/checksums/LinearAlgebra-997c4b7e7664f30645ef8bd51d8a4203e49c4631.tar.gz/sha512 b/deps/checksums/LinearAlgebra-997c4b7e7664f30645ef8bd51d8a4203e49c4631.tar.gz/sha512 new file mode 100644 index 0000000000000..971b146eecf64 --- /dev/null +++ b/deps/checksums/LinearAlgebra-997c4b7e7664f30645ef8bd51d8a4203e49c4631.tar.gz/sha512 @@ -0,0 +1 @@ +ec3edd7208e25fb1af0b9cb2324abbfb66e556442b75df619ffdf428f1d59f851055117db896fd3514352a32c34c4c42cf50e1386deca4ebd051de98369d5a3e diff --git a/deps/checksums/Pkg-53b2b5da91c27515ce129635fe184e8bd9afb09f.tar.gz/md5 b/deps/checksums/Pkg-53b2b5da91c27515ce129635fe184e8bd9afb09f.tar.gz/md5 new file mode 100644 index 0000000000000..48b17f7ee32d2 --- /dev/null +++ b/deps/checksums/Pkg-53b2b5da91c27515ce129635fe184e8bd9afb09f.tar.gz/md5 @@ -0,0 +1 @@ +5c898e09839cfa16f80940b08bdebe9f diff --git a/deps/checksums/Pkg-53b2b5da91c27515ce129635fe184e8bd9afb09f.tar.gz/sha512 b/deps/checksums/Pkg-53b2b5da91c27515ce129635fe184e8bd9afb09f.tar.gz/sha512 new file mode 100644 index 0000000000000..7236505c4e9f1 --- /dev/null +++ b/deps/checksums/Pkg-53b2b5da91c27515ce129635fe184e8bd9afb09f.tar.gz/sha512 @@ -0,0 +1 @@ +5202b09eaf172291260bc69a28944986c80a4362a9ef521b05c8ce95c69c9909439b5b2f3a52326ab820f1eff2e1ba2a8ddaa90080d9e29fd2f6e226856bda3e diff --git a/deps/checksums/Pkg-98a52b1ccf470daf6aafa9483e8246eede98292d.tar.gz/md5 b/deps/checksums/Pkg-98a52b1ccf470daf6aafa9483e8246eede98292d.tar.gz/md5 deleted file mode 100644 index 349a481e56cbf..0000000000000 --- a/deps/checksums/Pkg-98a52b1ccf470daf6aafa9483e8246eede98292d.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -91c3111e1d5c6bd5e6327ded2537ef68 diff --git a/deps/checksums/Pkg-98a52b1ccf470daf6aafa9483e8246eede98292d.tar.gz/sha512 b/deps/checksums/Pkg-98a52b1ccf470daf6aafa9483e8246eede98292d.tar.gz/sha512 deleted file mode 100644 index f733ab37373b0..0000000000000 --- a/deps/checksums/Pkg-98a52b1ccf470daf6aafa9483e8246eede98292d.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -c9ca5f0899dbe187b6c009acafd51f067dbb7b86dabceb85d0c65b8f5243d76e3eb9f0c17182049100608b3de726d3c738a323901863443ac09fe6d7baa1ff3f diff --git a/deps/libgit2.mk b/deps/libgit2.mk index 8b17ae6d70424..dd0d883c2e736 100644 --- a/deps/libgit2.mk +++ b/deps/libgit2.mk @@ -4,6 +4,7 @@ ifneq ($(USE_BINARYBUILDER_LIBGIT2),1) LIBGIT2_GIT_URL := https://github.com/libgit2/libgit2.git LIBGIT2_TAR_URL = https://api.github.com/repos/libgit2/libgit2/tarball/$1 $(eval $(call git-external,libgit2,LIBGIT2,CMakeLists.txt,,$(SRCCACHE))) +$(SRCCACHE)/$(LIBGIT2_SRC_DIR)/source-extracted: $(MSYS_NONEXISTENT_SYMLINK_TARGET_FIX) ifeq ($(USE_SYSTEM_LIBSSH2), 0) $(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/libssh2 @@ -13,7 +14,15 @@ ifeq ($(USE_SYSTEM_OPENSSL), 0) $(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/openssl endif -LIBGIT2_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release -DUSE_THREADS=ON -DUSE_BUNDLED_ZLIB=ON -DUSE_SSH=ON -DBUILD_CLI=OFF +ifeq ($(USE_SYSTEM_PCRE), 0) +$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/pcre +endif + +ifeq ($(USE_SYSTEM_ZLIB), 0) +$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/build-configured: | $(build_prefix)/manifest/zlib +endif + +LIBGIT2_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release -DUSE_THREADS=ON -DUSE_BUNDLED_ZLIB=OFF -DUSE_SSH=ON -DREGEX_BACKEND=pcre2 -DBUILD_CLI=OFF -DBUILD_TESTS=OFF ifeq ($(OS),WINNT) LIBGIT2_OPTS += -DWIN32=ON -DMINGW=ON ifeq ($(USE_SYSTEM_LIBSSH2), 0) diff --git a/deps/libssh2.mk b/deps/libssh2.mk index 661e26516c828..05cc12b6e159b 100644 --- a/deps/libssh2.mk +++ b/deps/libssh2.mk @@ -17,9 +17,6 @@ endif ifeq ($(OS),WINNT) LIBSSH2_OPTS += -DCRYPTO_BACKEND=WinCNG -DENABLE_ZLIB_COMPRESSION=OFF -ifeq ($(BUILD_OS),WINNT) -LIBSSH2_OPTS += -G"MSYS Makefiles" -endif else LIBSSH2_OPTS += -DCRYPTO_BACKEND=OpenSSL -DENABLE_ZLIB_COMPRESSION=OFF LIBSSH2_OPTS += -DOPENSSL_ROOT_DIR=$(build_prefix) @@ -38,7 +35,7 @@ LIBSSH2_SRC_PATH := $(SRCCACHE)/$(LIBSSH2_SRC_DIR) $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/build-configured: $(LIBSSH2_SRC_PATH)/source-extracted mkdir -p $(dir $@) cd $(dir $@) && \ - $(CMAKE) $(dir $<) $(LIBSSH2_OPTS) + $(CMAKE) $(CMAKE_GENERATOR_COMMAND) $(dir $<) $(LIBSSH2_OPTS) echo 1 > $@ $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/build-compiled: $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/build-configured diff --git a/deps/libuv.mk b/deps/libuv.mk index eacabac55e34f..993aa4fc144da 100644 --- a/deps/libuv.mk +++ b/deps/libuv.mk @@ -4,7 +4,7 @@ LIBUV_GIT_URL:=https://github.com/JuliaLang/libuv.git LIBUV_TAR_URL=https://api.github.com/repos/JuliaLang/libuv/tarball/$1 $(eval $(call git-external,libuv,LIBUV,configure,,$(SRCCACHE))) -UV_CFLAGS := -O2 +UV_CFLAGS := -O2 -DBUILDING_UV_SHARED=1 UV_FLAGS := LDFLAGS="$(LDFLAGS) $(CLDFLAGS) -v" UV_FLAGS += CFLAGS="$(CFLAGS) $(UV_CFLAGS) $(SANITIZE_OPTS)" diff --git a/deps/llvm.mk b/deps/llvm.mk index 09dd4f187d611..8b823b8664bf2 100644 --- a/deps/llvm.mk +++ b/deps/llvm.mk @@ -7,6 +7,14 @@ ifneq ($(USE_BINARYBUILDER_LLVM), 1) LLVM_GIT_URL:=https://github.com/JuliaLang/llvm-project.git LLVM_TAR_URL=https://api.github.com/repos/JuliaLang/llvm-project/tarball/$1 $(eval $(call git-external,llvm,LLVM,CMakeLists.txt,,$(SRCCACHE))) +# LLVM's tarball contains symlinks to non-existent targets. This breaks the +# the default msys strategy `deepcopy` symlink strategy. To workaround this, +# switch to `native` which tries native windows symlinks (possible if the +# machine is in developer mode) - or if not, falls back to cygwin-style +# symlinks. We don't particularly care either way - we just need to symlinks +# to succeed. We could guard this by a uname check, but it's harmless elsewhere, +# so let's not incur the additional overhead. +$(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted: $(MSYS_NONEXISTENT_SYMLINK_TARGET_FIX) LLVM_BUILDDIR := $(BUILDDIR)/$(LLVM_SRC_DIR) LLVM_BUILDDIR_withtype := $(LLVM_BUILDDIR)/build_$(LLVM_BUILDTYPE) diff --git a/deps/openssl.mk b/deps/openssl.mk index 705303432c2c6..734ddb3274e78 100644 --- a/deps/openssl.mk +++ b/deps/openssl.mk @@ -59,7 +59,7 @@ $(BUILDDIR)/openssl-$(OPENSSL_VER)/build-configured: $(SRCCACHE)/openssl-$(OPENS mkdir -p $(dir $@) cd $(dir $@) && \ CC="$(CC) $(SANITIZE_OPTS)" CXX="$(CXX) $(SANITIZE_OPTS)" LDFLAGS="$(LDFLAGS) $(RPATH_ESCAPED_ORIGIN) $(SANITIZE_LDFLAGS)" \ - $(dir $<)/Configure shared --prefix=$(abspath $(build_prefix)) $(OPENSSL_TARGET) + $(dir $<)/Configure shared --prefix=$(abspath $(build_prefix)) --libdir=$(abspath $(build_libdir)) $(OPENSSL_TARGET) echo 1 > $@ $(BUILDDIR)/openssl-$(OPENSSL_VER)/build-compiled: $(BUILDDIR)/openssl-$(OPENSSL_VER)/build-configured @@ -75,18 +75,16 @@ endif # Override bindir and only install runtime libraries, otherwise they'll go into build_depsbindir. OPENSSL_INSTALL = \ mkdir -p $2$$(build_shlibdir) && \ - $$(MAKE) -C $1 install_dev $$(MAKE_COMMON) bindir=$$(build_shlibdir) $3 DESTDIR="$2" - -OPENSSL_POST_INSTALL := \ - $(WIN_MAKE_HARD_LINK) $(build_bindir)/libcrypto-*.dll $(build_bindir)/libcrypto.dll && \ - $(WIN_MAKE_HARD_LINK) $(build_bindir)/libssl-*.dll $(build_bindir)/libssl.dll && \ - $(INSTALL_NAME_CMD)libcrypto.$(SHLIB_EXT) $(build_shlibdir)/libcrypto.$(SHLIB_EXT) && \ - $(INSTALL_NAME_CMD)libssl.$(SHLIB_EXT) $(build_shlibdir)/libssl.$(SHLIB_EXT) && \ - $(INSTALL_NAME_CHANGE_CMD) $(build_shlibdir)/libcrypto.3.dylib @rpath/libcrypto.$(SHLIB_EXT) $(build_shlibdir)/libssl.$(SHLIB_EXT) + $$(MAKE) -C $1 install_runtime_libs $$(MAKE_COMMON) bindir=$$(build_shlibdir) $3 DESTDIR="$2" $(eval $(call staged-install, \ openssl,openssl-$(OPENSSL_VER), \ - OPENSSL_INSTALL,,,$(OPENSSL_POST_INSTALL))) + OPENSSL_INSTALL,,, \ + $$(WIN_MAKE_HARD_LINK) $(build_bindir)/libcrypto-*.dll $(build_bindir)/libcrypto.dll && \ + $$(WIN_MAKE_HARD_LINK) $(build_bindir)/libssl-*.dll $(build_bindir)/libssl.dll && \ + $$(INSTALL_NAME_CMD)libcrypto.$$(SHLIB_EXT) $$(build_shlibdir)/libcrypto.$$(SHLIB_EXT) && \ + $$(INSTALL_NAME_CMD)libssl.$$(SHLIB_EXT) $$(build_shlibdir)/libssl.$$(SHLIB_EXT) && \ + $$(INSTALL_NAME_CHANGE_CMD) $$(build_shlibdir)/libcrypto.3.dylib @rpath/libcrypto.$$(SHLIB_EXT) $$(build_shlibdir)/libssl.$$(SHLIB_EXT))) clean-openssl: -rm -f $(BUILDDIR)/-openssl-$(OPENSSL_VER)/build-configured $(BUILDDIR)/-openssl-$(OPENSSL_VER)/build-compiled diff --git a/deps/p7zip.mk b/deps/p7zip.mk index 006062f2932a2..5015edbfc2ba3 100644 --- a/deps/p7zip.mk +++ b/deps/p7zip.mk @@ -51,10 +51,14 @@ $(eval $(call bb-install,p7zip,P7ZIP,false)) # move from bindir to shlibdir, where we expect to install it install-p7zip: post-install-p7zip uninstall-p7zip: pre-uninstall-p7zip -post-install-p7zip: $(build_prefix)/manifest/p7zip +post-install-p7zip: $(build_prefix)/manifest/p7zip $(PATCHELF_MANIFEST) mkdir -p $(build_private_libexecdir)/ [ ! -e $(build_bindir)/7z$(EXE) ] || mv $(build_bindir)/7z$(EXE) $(build_private_libexecdir)/7z$(EXE) [ -e $(build_private_libexecdir)/7z$(EXE) ] +ifneq (,$(findstring $(OS),Linux FreeBSD)) + [ -L $(build_private_libexecdir)/7z ] || \ + $(PATCHELF) $(PATCHELF_SET_RPATH_ARG) '$$ORIGIN/$(reverse_build_private_libexecdir_rel)' $(build_private_libexecdir)/7z$(EXE) +endif pre-uninstall-p7zip: -rm -f $(build_private_libexecdir)/7z$(EXE) diff --git a/deps/tools/common.mk b/deps/tools/common.mk index 01b57316f9d1a..212b576fb63f9 100644 --- a/deps/tools/common.mk +++ b/deps/tools/common.mk @@ -59,7 +59,6 @@ CMAKE_COMMON += -DCMAKE_SYSTEM_NAME=Windows CMAKE_COMMON += -DCMAKE_RC_COMPILER="$$(which $(CROSS_COMPILE)windres)" endif -# For now this is LLVM specific, but I expect it won't be in the future ifeq ($(CMAKE_GENERATOR),Ninja) CMAKE_GENERATOR_COMMAND := -G Ninja else ifeq ($(CMAKE_GENERATOR),make) @@ -68,6 +67,27 @@ else $(error Unknown CMake generator '$(CMAKE_GENERATOR)'. Options are 'Ninja' and 'make') endif +ifneq (,$(findstring MINGW,$(RAW_BUILD_OS))) +ifneq (,$(shell ldd $(shell which cmake) | grep msys-2.0.dll)) +# Detect MSYS2 with cygwin CMake rather than MinGW cmake - the former fails to +# properly drive MinGW tools +override CMAKE := echo "ERROR: CMake is Cygwin CMake, not MinGW CMake. Build will fail. Use 'pacman -S mingw-w64-{i686,x86_64}-cmake'."; exit 1; $(CMAKE) +endif +# In our setup, CMAKE_INSTALL_PREFIX is a relative path inside usr-staging. +# We do not want this converted to a windows path, because our make system +# assumes it to be relative to msys `/`. +override CMAKE := MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX" $(CMAKE) +endif + +# Some dependencies' tarballs contains symlinks to non-existent targets. This breaks the +# the default msys strategy `deepcopy` symlink strategy. To workaround this, +# switch to `native` which tries native windows symlinks (possible if the +# machine is in developer mode) - or if not, falls back to cygwin-style +# symlinks. We don't particularly care either way - we just need to symlinks +# to succeed. We could guard this by a uname check, but it's harmless elsewhere, +# so let's not incur the additional overhead. +MSYS_NONEXISTENT_SYMLINK_TARGET_FIX := export MSYS=winsymlinks:native + # If the top-level Makefile is called with environment variables, # they will override the values passed above to ./configure MAKE_COMMON := DESTDIR="" prefix=$(build_prefix) bindir=$(build_depsbindir) libdir=$(build_libdir) shlibdir=$(build_shlibdir) libexecdir=$(build_libexecdir) datarootdir=$(build_datarootdir) includedir=$(build_includedir) sysconfdir=$(build_sysconfdir) O= @@ -144,7 +164,7 @@ upper = $(shell echo $1 | tr a-z A-Z) # this rule ensures that make install is more nearly atomic # so it's harder to get half-installed (or half-reinstalled) dependencies # # and enables sharing deps compiles, uninstall, and fast reinstall -MAKE_INSTALL = +$$(MAKE) -C $1 install $$(MAKE_COMMON) $3 DESTDIR="$2" +MAKE_INSTALL = MSYS2_ARG_CONV_EXCL="prefix=" $$(MAKE) -C $1 install $$(MAKE_COMMON) $3 DESTDIR="$2" define SHLIBFILE_INSTALL mkdir -p $2/$$(build_shlibdir) diff --git a/doc/Manifest.toml b/doc/Manifest.toml index 03723f59149bc..647379062502f 100644 --- a/doc/Manifest.toml +++ b/doc/Manifest.toml @@ -49,9 +49,9 @@ version = "0.9.5" [[deps.Documenter]] deps = ["ANSIColoredPrinters", "AbstractTrees", "Base64", "CodecZlib", "Dates", "DocStringExtensions", "Downloads", "Git", "IOCapture", "InteractiveUtils", "JSON", "Logging", "Markdown", "MarkdownAST", "Pkg", "PrecompileTools", "REPL", "RegistryInstances", "SHA", "TOML", "Test", "Unicode"] -git-tree-sha1 = "70c521ca3a23c576e12655d15963977c9766c26b" +git-tree-sha1 = "b37458ae37d8bdb643d763451585cd8d0e5b4a9e" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "1.16.0" +version = "1.16.1" [[deps.Downloads]] deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] diff --git a/doc/make.jl b/doc/make.jl index 6379bf8dae7bf..193b49097778b 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -4,7 +4,7 @@ empty!(LOAD_PATH) push!(LOAD_PATH, @__DIR__, "@stdlib") empty!(DEPOT_PATH) push!(DEPOT_PATH, joinpath(@__DIR__, "deps")) -push!(DEPOT_PATH, abspath(Sys.BINDIR, "..", "share", "julia")) +push!(DEPOT_PATH, abspath(Sys.BINDIR, Base.DATAROOTDIR, "julia")) using Pkg Pkg.instantiate() @@ -202,6 +202,15 @@ BaseDocs = [ StdlibDocs = [stdlib.targetfile for stdlib in STDLIB_DOCS] +# HACK: get nicer sorting here, even though we don't have the header +# of the .md files at hand. +sort!(StdlibDocs, by=function(x) + x = replace(x, "stdlib/" => "") + startswith(x, "Libdl") && return lowercase("Dynamic Linker") + startswith(x, "Test") && return lowercase("Unit Testing") + return lowercase(x) +end) + DevDocs = [ "Documentation of Julia's Internals" => [ "devdocs/init.md", diff --git a/doc/src/devdocs/EscapeAnalysis.md b/doc/src/devdocs/EscapeAnalysis.md index d8efd759fa131..9c568541ab7c0 100644 --- a/doc/src/devdocs/EscapeAnalysis.md +++ b/doc/src/devdocs/EscapeAnalysis.md @@ -22,7 +22,7 @@ defines the convenience entries `code_escapes` and `@code_escapes` for testing a ```@repl EAUtils # InteractiveUtils.@activate Compiler # to use the stdlib version of the Compiler -let JULIA_DIR = normpath(Sys.BINDIR, "..", "share", "julia") +let JULIA_DIR = normpath(Sys.BINDIR, Base.DATAROOTDIR, "julia") include(normpath(JULIA_DIR, "Compiler", "test", "EAUtils.jl")) using .EAUtils end diff --git a/doc/src/index.md b/doc/src/index.md index 7d781f25b4235..dea0c11dc1c8b 100644 --- a/doc/src/index.md +++ b/doc/src/index.md @@ -32,18 +32,6 @@ Markdown.parse(""" """) ``` -## [Important Links](@id man-important-links) - -Below is a non-exhaustive list of links that will be useful as you learn and use the Julia programming language. - -- [Julia Homepage](https://julialang.org) -- [Install Julia](https://julialang.org/install/) -- [Discussion forum](https://discourse.julialang.org) -- [Julia YouTube](https://www.youtube.com/user/JuliaLanguage) -- [Find Julia Packages](https://julialang.org/packages/) -- [Learning Resources](https://julialang.org/learning/) -- [Read and write blogs on Julia](https://forem.julialang.org) - ## [Introduction](@id man-introduction) Scientific computing has traditionally required the highest performance, yet domain experts have @@ -127,39 +115,13 @@ language. In addition to the above, some advantages of Julia over comparable sys * Powerful shell-like capabilities for managing other processes * Lisp-like macros and other metaprogramming facilities -## [Julia Standard Modules and the Standard Library](@id man-standard-modules-stdlib) - -The Julia runtime comes with [standard modules](@ref standard-modules), -which are essential namespaces that are usually loaded automatically. - -```@docs; canonical=false -Core -Base -``` - -Julia's `Base` module contains various [useful submodules](@ref base-submodules). - -### [The Standard Library](@id man-stdlib) - -The Julia standard library contains additional, commonly used packages that are installed alongside the Julia runtime by default. -To use a standard library package, it is first necessary to load the package with a [`using`](@ref) or [`import`](@ref) statement. -Links to available standard library packages are provided below, -and may also be found in the website sidebar. -Their source code is available in the `Sys.STDLIB` directory of a Julia installation. - -```@eval -import Markdown -list = sort(filter(x -> match(r"_jll$", x) === nothing, readdir(Sys.STDLIB))) -Markdown.parse(join("- [`" .* list .* "`](stdlib/" .* list .* ".html)", "\n")) -``` +## [Important Links](@id man-important-links) -Julia also provides various standard, pre-built binary libraries -of established software that is written in other languages. -By convention, these packages have names that end with `_jll`. -The [`using`](@ref) statement can load symbol names from these binary libraries: +A non-exhaustive list of links that will be useful as you learn and use the Julia programming language: -```@eval -import Markdown -list = sort(filter(x -> match(r"_jll$", x) !== nothing, readdir(Sys.STDLIB))) -Markdown.parse(join("- [`" .* list .* "`](stdlib/" .* list .* ".html)", "\n")) -``` +- [Julia Homepage](https://julialang.org) +- [Install Julia](https://julialang.org/install/) +- [Discussion forum](https://discourse.julialang.org) +- [Julia YouTube](https://www.youtube.com/user/JuliaLanguage) +- [Find Julia Packages](https://julialang.org/packages/) +- [Learning Resources](https://julialang.org/learning/) diff --git a/src/Makefile b/src/Makefile index e859acc765354..6245139592db1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -75,7 +75,7 @@ GC_CODEGEN_SRCS += llvm-late-gc-lowering-stock endif CODEGEN_SRCS := codegen jitlayers aotcompile debuginfo disasm llvm-simdloop \ llvm-pass-helpers llvm-ptls \ - llvm-lower-handlers llvm-propagate-addrspaces null_sysimage \ + llvm-lower-handlers llvm-propagate-addrspaces \ llvm-multiversioning llvm-alloc-opt llvm-alloc-helpers cgmemmgr llvm-remove-addrspaces \ llvm-remove-ni llvm-julia-licm llvm-demote-float16 llvm-cpufeatures pipeline llvm_api \ $(GC_CODEGEN_SRCS) @@ -192,7 +192,9 @@ endif COMMON_LIBPATHS := -L$(build_libdir) -L$(build_shlibdir) RT_LIBS := $(WHOLE_ARCHIVE) $(LIBUV) $(WHOLE_ARCHIVE) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(RT_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI) $(MMTK_LIB) +# NB: CG needs uv_mutex_* symbols, but we expect to export them from libjulia-internal CG_LIBS := $(LIBUNWIND) $(CG_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI) $(MMTK_LIB) + RT_DEBUG_LIBS := $(COMMON_LIBPATHS) $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp-debug.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport-debug.a -ljulia-debug $(RT_LIBS) CG_DEBUG_LIBS := $(COMMON_LIBPATHS) $(CG_LIBS) -ljulia-debug -ljulia-internal-debug RT_RELEASE_LIBS := $(COMMON_LIBPATHS) $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport.a -ljulia $(RT_LIBS) @@ -469,10 +471,10 @@ libjulia-codegen-debug: $(build_shlibdir)/libjulia-codegen-debug.$(JL_MAJOR_MINO libjulia-codegen-debug libjulia-codegen-release: $(PUBLIC_HEADER_TARGETS) # set the exports for the source files based on where they are getting linked -$(OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL -$(DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL -$(CODEGEN_OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN -$(CODEGEN_DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN +$(OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL -DBUILDING_UV_SHARED +$(DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_INTERNAL -DBUILDING_UV_SHARED +$(CODEGEN_OBJS): SHIPFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN -DUSING_UV_SHARED +$(CODEGEN_DOBJS): DEBUGFLAGS += -DJL_LIBRARY_EXPORTS_CODEGEN -DUSING_UV_SHARED clean: -rm -fr $(build_shlibdir)/libjulia-internal* $(build_shlibdir)/libjulia-codegen* $(build_shlibdir)/libccalltest* $(build_shlibdir)/libllvmcalltest* diff --git a/src/cgutils.cpp b/src/cgutils.cpp index 138fa54949cf8..65a01c1355f76 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -2634,10 +2634,12 @@ static jl_cgval_t typed_store(jl_codectx_t &ctx, assert(!isboxed && maybe_null_if_boxed); Value *first_ptr = extract_first_ptr(ctx, realinstr); assert(first_ptr != nullptr); - Done = ctx.builder.CreateIsNotNull(first_ptr); + // Done = Success || first_ptr != NULL + Done = ctx.builder.CreateOr(Success, ctx.builder.CreateIsNotNull(first_ptr)); } else { - // Done = !(!Success && (first_ptr != NULL && oldval == cmp)) + // Done = Success || first_ptr == NULL || oldval == cmpop) + // Done = !(!Success && (first_ptr != NULL && oldval == cmpop)) Done = emit_guarded_test(ctx, ctx.builder.CreateNot(Success), false, [&] { Value *first_ptr = nullptr; if (maybe_null_if_boxed) diff --git a/src/flisp/Makefile b/src/flisp/Makefile index eca1de86e588a..2e902a31dbeed 100644 --- a/src/flisp/Makefile +++ b/src/flisp/Makefile @@ -117,7 +117,7 @@ $(BUILDDIR)/host/Makefile: @printf "%s\n" 'include $(SRCDIR)/Makefile' >> $@ $(BUILDDIR)/host/$(EXENAME): $(BUILDDIR)/host/Makefile | ${BUILDDIR}/host/flisp.boot - make -C $(BUILDDIR)/host $(EXENAME) + $(MAKE) -C $(BUILDDIR)/host $(EXENAME) $(BUILDDIR)/host/flisp.boot: $(SRCDIR)/flisp.boot | $(BUILDDIR)/host/Makefile diff --git a/src/flisp/julia_extensions.c b/src/flisp/julia_extensions.c index 07d074e1fb80b..c39c2edfe0f37 100644 --- a/src/flisp/julia_extensions.c +++ b/src/flisp/julia_extensions.c @@ -130,6 +130,9 @@ JL_DLLEXPORT int jl_id_start_char(uint32_t wc) return 1; if (wc < 0xA1 || wc > 0x10ffff) return 0; + // "Rightwards Arrow with Lower Hook" + if (wc == 0x1f8b2) + return 1; return is_wc_cat_id_start(wc, utf8proc_category((utf8proc_int32_t) wc)); } @@ -147,7 +150,9 @@ JL_DLLEXPORT int jl_id_char(uint32_t wc) cat == UTF8PROC_CATEGORY_SK || cat == UTF8PROC_CATEGORY_ME || cat == UTF8PROC_CATEGORY_NO || // primes (single, double, triple, their reverses, and quadruple) - (wc >= 0x2032 && wc <= 0x2037) || (wc == 0x2057)) + (wc >= 0x2032 && wc <= 0x2037) || (wc == 0x2057) || + // "Rightwards Arrow with Lower Hook" + wc == 0x1f8b2) return 1; return 0; } diff --git a/src/julia-parser.scm b/src/julia-parser.scm index 4415dc8686065..1a11494b5c8e3 100644 --- a/src/julia-parser.scm +++ b/src/julia-parser.scm @@ -10,7 +10,7 @@ ;; comma - higher than assignment outside parentheses, lower when inside (define prec-pair (add-dots '(=>))) (define prec-conditional '(?)) -(define prec-arrow (add-dots '(← → ↔ ↚ ↛ ↞ ↠ ↢ ↣ ↦ ↤ ↮ ⇎ ⇍ ⇏ ⇐ ⇒ ⇔ ⇴ ⇶ ⇷ ⇸ ⇹ ⇺ ⇻ ⇼ ⇽ ⇾ ⇿ ⟵ ⟶ ⟷ ⟹ ⟺ ⟻ ⟼ ⟽ ⟾ ⟿ ⤀ ⤁ ⤂ ⤃ ⤄ ⤅ ⤆ ⤇ ⤌ ⤍ ⤎ ⤏ ⤐ ⤑ ⤔ ⤕ ⤖ ⤗ ⤘ ⤝ ⤞ ⤟ ⤠ ⥄ ⥅ ⥆ ⥇ ⥈ ⥊ ⥋ ⥎ ⥐ ⥒ ⥓ ⥖ ⥗ ⥚ ⥛ ⥞ ⥟ ⥢ ⥤ ⥦ ⥧ ⥨ ⥩ ⥪ ⥫ ⥬ ⥭ ⥰ ⧴ ⬱ ⬰ ⬲ ⬳ ⬴ ⬵ ⬶ ⬷ ⬸ ⬹ ⬺ ⬻ ⬼ ⬽ ⬾ ⬿ ⭀ ⭁ ⭂ ⭃ ⥷ ⭄ ⥺ ⭇ ⭈ ⭉ ⭊ ⭋ ⭌ ← → ⇜ ⇝ ↜ ↝ ↩ ↪ ↫ ↬ ↼ ↽ ⇀ ⇁ ⇄ ⇆ ⇇ ⇉ ⇋ ⇌ ⇚ ⇛ ⇠ ⇢ ↷ ↶ ↺ ↻ --> <-- <-->))) +(define prec-arrow (add-dots '(← → ↔ ↚ ↛ ↞ ↠ ↢ ↣ ↦ ↤ ↮ ⇎ ⇍ ⇏ ⇐ ⇒ ⇔ ⇴ ⇶ ⇷ ⇸ ⇹ ⇺ ⇻ ⇼ ⇽ ⇾ ⇿ ⟵ ⟶ ⟷ ⟹ ⟺ ⟻ ⟼ ⟽ ⟾ ⟿ ⤀ ⤁ ⤂ ⤃ ⤄ ⤅ ⤆ ⤇ ⤌ ⤍ ⤎ ⤏ ⤐ ⤑ ⤔ ⤕ ⤖ ⤗ ⤘ ⤝ ⤞ ⤟ ⤠ ⥄ ⥅ ⥆ ⥇ ⥈ ⥊ ⥋ ⥎ ⥐ ⥒ ⥓ ⥖ ⥗ ⥚ ⥛ ⥞ ⥟ ⥢ ⥤ ⥦ ⥧ ⥨ ⥩ ⥪ ⥫ ⥬ ⥭ ⥰ ⧴ ⬱ ⬰ ⬲ ⬳ ⬴ ⬵ ⬶ ⬷ ⬸ ⬹ ⬺ ⬻ ⬼ ⬽ ⬾ ⬿ ⭀ ⭁ ⭂ ⭃ ⥷ ⭄ ⥺ ⭇ ⭈ ⭉ ⭊ ⭋ ⭌ ← → ⇜ ⇝ ↜ ↝ ↩ ↪ ↫ ↬ ↼ ↽ ⇀ ⇁ ⇄ ⇆ ⇇ ⇉ ⇋ ⇌ ⇚ ⇛ ⇠ ⇢ ↷ ↶ ↺ ↻ --> <-- <--> 🢲))) (define prec-lazy-or (add-dots '(|\|\||))) (define prec-lazy-and (add-dots '(&&))) (define prec-comparison diff --git a/src/llvm-multiversioning.cpp b/src/llvm-multiversioning.cpp index 02f77298513ee..dc63cad14a1cb 100644 --- a/src/llvm-multiversioning.cpp +++ b/src/llvm-multiversioning.cpp @@ -378,6 +378,8 @@ struct CloneCtx { void clone_partial(Group &grp, Target &tgt); uint32_t get_func_id(Function *F) const; std::pair get_reloc_slot(Function *F) const; + + Function *create_trampoline(Function *F, GlobalVariable *slot, bool autoinit=false); void rewrite_alias(GlobalAlias *alias, Function* F); MDNode *tbaa_const; @@ -492,6 +494,53 @@ void CloneCtx::prepare_vmap(ValueToValueMapTy &vmap) } } +Function *CloneCtx::create_trampoline(Function *F, GlobalVariable *slot, bool autoinit) +{ + Function *trampoline = + Function::Create(F->getFunctionType(), GlobalValue::ExternalLinkage, "", &M); + + trampoline->copyAttributesFrom(F); + trampoline->setVisibility(GlobalValue::HiddenVisibility); + trampoline->setDSOLocal(true); + + // drop multiversioning attributes + trampoline->removeFnAttr("julia.mv.reloc"); + trampoline->removeFnAttr("julia.mv.clones"); + + auto BB = BasicBlock::Create(F->getContext(), "top", trampoline); + IRBuilder<> irbuilder(BB); + + if (autoinit) { + irbuilder.CreateCall(F->getParent()->getOrInsertFunction( + XSTR(jl_autoinit_and_adopt_thread), + PointerType::get(F->getContext(), 0) + )); + } + + auto ptr = irbuilder.CreateLoad(F->getType(), slot); + ptr->setMetadata(llvm::LLVMContext::MD_tbaa, tbaa_const); + ptr->setMetadata(llvm::LLVMContext::MD_invariant_load, MDNode::get(F->getContext(), None)); + + SmallVector Args; + for (auto &arg : trampoline->args()) + Args.push_back(&arg); + auto call = irbuilder.CreateCall(F->getFunctionType(), ptr, ArrayRef(Args)); + if (F->isVarArg()) { + assert(!TT.isARM() && !TT.isPPC() && "musttail not supported on ARM/PPC!"); + call->setTailCallKind(CallInst::TCK_MustTail); + } else { + call->setTailCallKind(CallInst::TCK_Tail); + + } + + if (F->getReturnType() == Type::getVoidTy(F->getContext())) + irbuilder.CreateRetVoid(); + else + irbuilder.CreateRet(call); + + return trampoline; +} + void CloneCtx::prepare_slots() { for (auto &F : orig_funcs) { @@ -506,7 +555,12 @@ void CloneCtx::prepare_slots() else { auto id = get_func_id(F); const_relocs[id] = GV; - GV->setInitializer(Constant::getNullValue(F->getType())); + + // Initialize with a single-use trampoline that calls `jl_autoinit_and_adopt_thread`, + // so that auto-initialization works with multi-versioned entrypoints. + Function *trampoline = create_trampoline(F, GV, /* autoinit */ true); + trampoline->setName(F->getName() + ".autoinit_trampoline"); + GV->setInitializer(trampoline); } } } @@ -664,45 +718,21 @@ void CloneCtx::rewrite_alias(GlobalAlias *alias, Function *F) { assert(!is_vector(F->getFunctionType())); - Function *trampoline = - Function::Create(F->getFunctionType(), alias->getLinkage(), "", &M); - trampoline->copyAttributesFrom(F); - trampoline->takeName(alias); - trampoline->setVisibility(alias->getVisibility()); - trampoline->setDSOLocal(alias->isDSOLocal()); - // drop multiversioning attributes, add alias attribute for testing purposes - trampoline->removeFnAttr("julia.mv.reloc"); - trampoline->removeFnAttr("julia.mv.clones"); - trampoline->addFnAttr("julia.mv.alias"); - trampoline->setDLLStorageClass(alias->getDLLStorageClass()); - alias->eraseFromParent(); - uint32_t id; GlobalVariable *slot; std::tie(id, slot) = get_reloc_slot(F); + assert(slot); - auto BB = BasicBlock::Create(F->getContext(), "top", trampoline); - IRBuilder<> irbuilder(BB); + Function *trampoline = create_trampoline(F, slot, /* autoinit */ false); + trampoline->addFnAttr("julia.mv.alias"); // add alias attribute for testing purposes - auto ptr = irbuilder.CreateLoad(F->getType(), slot); - ptr->setMetadata(llvm::LLVMContext::MD_tbaa, tbaa_const); - ptr->setMetadata(llvm::LLVMContext::MD_invariant_load, MDNode::get(F->getContext(), None)); - - SmallVector Args; - for (auto &arg : trampoline->args()) - Args.push_back(&arg); - auto call = irbuilder.CreateCall(F->getFunctionType(), ptr, ArrayRef(Args)); - if (F->isVarArg()) { - assert(!TT.isARM() && !TT.isPPC() && "musttail not supported on ARM/PPC!"); - call->setTailCallKind(CallInst::TCK_MustTail); - } else { - call->setTailCallKind(CallInst::TCK_Tail); - } + trampoline->takeName(alias); + trampoline->setLinkage(alias->getLinkage()); + trampoline->setVisibility(alias->getVisibility()); + trampoline->setDSOLocal(alias->isDSOLocal()); + trampoline->setDLLStorageClass(alias->getDLLStorageClass()); - if (F->getReturnType() == Type::getVoidTy(F->getContext())) - irbuilder.CreateRetVoid(); - else - irbuilder.CreateRet(call); + alias->eraseFromParent(); } void CloneCtx::fix_gv_uses() diff --git a/stdlib/CRC32c/test/runtests.jl b/stdlib/CRC32c/test/runtests.jl index 37b447e6d999a..f4097a919c7bb 100644 --- a/stdlib/CRC32c/test/runtests.jl +++ b/stdlib/CRC32c/test/runtests.jl @@ -3,7 +3,7 @@ using Test, Random using CRC32c -const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test") +const BASE_TEST_PATH = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test") isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($(BASE_TEST_PATH), "testhelpers", "OffsetArrays.jl")) using .Main.OffsetArrays: Origin diff --git a/stdlib/Dates/test/io.jl b/stdlib/Dates/test/io.jl index 98bc610784477..8159b33574bd5 100644 --- a/stdlib/Dates/test/io.jl +++ b/stdlib/Dates/test/io.jl @@ -5,7 +5,7 @@ module IOTests using Test using Dates -const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test") +const BASE_TEST_PATH = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test") include(joinpath(BASE_TEST_PATH, "testhelpers", "withlocales.jl")) @testset "string/show representation of Date" begin diff --git a/stdlib/LibGit2/test/libgit2-tests.jl b/stdlib/LibGit2/test/libgit2-tests.jl index b186f67c65cf1..bc347bb5129dc 100644 --- a/stdlib/LibGit2/test/libgit2-tests.jl +++ b/stdlib/LibGit2/test/libgit2-tests.jl @@ -7,7 +7,7 @@ using LibGit2_jll using Test using Random, Serialization, Sockets -const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test") +const BASE_TEST_PATH = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test") isdefined(Main, :ChallengePrompts) || @eval Main include(joinpath($(BASE_TEST_PATH), "testhelpers", "ChallengePrompts.jl")) using .Main.ChallengePrompts: challenge_prompt as basic_challenge_prompt diff --git a/stdlib/LinearAlgebra.version b/stdlib/LinearAlgebra.version index 7d7904e1f708c..3b1f7cc5847d9 100644 --- a/stdlib/LinearAlgebra.version +++ b/stdlib/LinearAlgebra.version @@ -1,4 +1,4 @@ LINEARALGEBRA_BRANCH = release-1.12 -LINEARALGEBRA_SHA1 = 5567504893591e552f08cc08353b285182a1c8cc +LINEARALGEBRA_SHA1 = 997c4b7e7664f30645ef8bd51d8a4203e49c4631 LINEARALGEBRA_GIT_URL := https://github.com/JuliaLang/LinearAlgebra.jl.git LINEARALGEBRA_TAR_URL = https://api.github.com/repos/JuliaLang/LinearAlgebra.jl/tarball/$1 diff --git a/stdlib/Mmap/src/Mmap.jl b/stdlib/Mmap/src/Mmap.jl index fb6bb72026588..806abc714d391 100644 --- a/stdlib/Mmap/src/Mmap.jl +++ b/stdlib/Mmap/src/Mmap.jl @@ -6,11 +6,10 @@ Low level module for mmap (memory mapping of files). module Mmap import Base: OS_HANDLE, INVALID_OS_HANDLE +using Base.Sys: PAGESIZE export mmap -const PAGESIZE = Int(Sys.isunix() ? ccall(:jl_getpagesize, Clong, ()) : ccall(:jl_getallocationgranularity, Clong, ())) - # for mmaps not backed by files mutable struct Anonymous <: IO name::String diff --git a/stdlib/Mmap/test/runtests.jl b/stdlib/Mmap/test/runtests.jl index d129c0ee94295..375a249721400 100644 --- a/stdlib/Mmap/test/runtests.jl +++ b/stdlib/Mmap/test/runtests.jl @@ -267,6 +267,7 @@ A2 = mmap(s, Matrix{Int}, (m,n)) seek(s, 0) A3 = mmap(s, Matrix{Int}, (m,n), convert(Int64, 2*sizeof(Int))) @test A == A3 +seek(s, 0) A4 = mmap(s, Matrix{Int}, (m,150), convert(Int64, (2+150*m)*sizeof(Int))) @test A[:, 151:end] == A4 close(s) diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index 8225cb5fe32d4..6feeb870e2f20 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ PKG_BRANCH = release-1.12 -PKG_SHA1 = 98a52b1ccf470daf6aafa9483e8246eede98292d +PKG_SHA1 = 53b2b5da91c27515ce129635fe184e8bd9afb09f PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 27f32fc453d55..ab8458539b2c4 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -538,8 +538,7 @@ function flatten(data::Vector, lidict::LineInfoDict) return (newdata, newdict) end -const SRC_DIR = normpath(joinpath(Sys.BUILD_ROOT_PATH, "src")) -const COMPILER_DIR = "../usr/share/julia/Compiler/" +const SRC_DIR = normpath(Base.SOURCEDIR, "src") # Take a file-system path and try to form a concise representation of it # based on the package ecosystem @@ -548,17 +547,18 @@ function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,Stri return get!(filenamecache, spath) do path = Base.fixup_stdlib_path(string(spath)) path_norm = normpath(path) - possible_base_path = normpath(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "base", path)) + possible_base_path = normpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "base", path) lib_dir = abspath(Sys.BINDIR, Base.LIBDIR) + compiler_dir = normpath(Base.DATAROOT, "julia", "Compiler/") if startswith(path_norm, SRC_DIR) remainder = only(split(path_norm, SRC_DIR, keepempty=false)) return (isfile(path_norm) ? path_norm : ""), "@juliasrc", remainder elseif startswith(path_norm, lib_dir) remainder = only(split(path_norm, lib_dir, keepempty=false)) return (isfile(path_norm) ? path_norm : ""), "@julialib", remainder - elseif contains(path, COMPILER_DIR) - remainder = split(path, COMPILER_DIR, keepempty=false)[end] - possible_compiler_path = normpath(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "Compiler", remainder)) + elseif startswith(path_norm, compiler_dir) + remainder = split(path_norm, compiler_dir, keepempty=false)[end] + possible_compiler_path = normpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "Compiler", remainder) return (isfile(possible_compiler_path) ? possible_compiler_path : ""), "@Compiler", remainder elseif isabspath(path) if ispath(path) @@ -586,11 +586,10 @@ function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,Stri elseif isfile(possible_base_path) # do the same mechanic for Base (or Core/Compiler) files as above, # but they start from a relative path - return possible_base_path, "@Base", normpath(path) + return possible_base_path, "@Base", path_norm else # for non-existent relative paths (such as "REPL[1]"), just consider simplifying them - path = normpath(path) - return "", "", path # drop leading "./" + return "", "", path_norm # drop leading "./" end end end diff --git a/stdlib/REPL/src/latex_symbols.jl b/stdlib/REPL/src/latex_symbols.jl index 9f5b7e3e864ed..b739accc72499 100644 --- a/stdlib/REPL/src/latex_symbols.jl +++ b/stdlib/REPL/src/latex_symbols.jl @@ -517,6 +517,7 @@ const latex_symbols = Dict( "\\mapsto" => "↦", "\\hookleftarrow" => "↩", "\\hookrightarrow" => "↪", + "\\hookunderrightarrow" => "🢲", "\\looparrowleft" => "↫", "\\looparrowright" => "↬", "\\leftrightsquigarrow" => "↭", diff --git a/stdlib/REPL/src/precompile.jl b/stdlib/REPL/src/precompile.jl index c4295934da3a5..a4d289db8cd40 100644 --- a/stdlib/REPL/src/precompile.jl +++ b/stdlib/REPL/src/precompile.jl @@ -7,7 +7,7 @@ import ..REPL # Ugly hack for our cache file to not have a dependency edge on the FakePTYs file. Base._track_dependencies[] = false try - Base.include(@__MODULE__, joinpath(Sys.BINDIR, "..", "share", "julia", "test", "testhelpers", "FakePTYs.jl")) + Base.include(@__MODULE__, joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test", "testhelpers", "FakePTYs.jl")) @Core.latestworld import .FakePTYs: open_fake_pty finally diff --git a/stdlib/REPL/test/bad_history_startup.jl b/stdlib/REPL/test/bad_history_startup.jl index 09f7a00e1c31a..6c342751d9a07 100644 --- a/stdlib/REPL/test/bad_history_startup.jl +++ b/stdlib/REPL/test/bad_history_startup.jl @@ -4,7 +4,7 @@ using Test -const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test") +const BASE_TEST_PATH = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test") isdefined(Main, :FakePTYs) || @eval Main include(joinpath($(BASE_TEST_PATH), "testhelpers", "FakePTYs.jl")) import .Main.FakePTYs: with_fake_pty diff --git a/stdlib/REPL/test/precompilation.jl b/stdlib/REPL/test/precompilation.jl index bc3eda15eae61..57b6b27be6e7c 100644 --- a/stdlib/REPL/test/precompilation.jl +++ b/stdlib/REPL/test/precompilation.jl @@ -2,7 +2,7 @@ ## Tests that compilation in the interactive session startup are as expected using Test -Base.include(@__MODULE__, joinpath(Sys.BINDIR, "..", "share", "julia", "test", "testhelpers", "FakePTYs.jl")) +Base.include(@__MODULE__, joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test", "testhelpers", "FakePTYs.jl")) import .FakePTYs: open_fake_pty if !Sys.iswindows() diff --git a/stdlib/REPL/test/repl.jl b/stdlib/REPL/test/repl.jl index 0ca3788d2b460..09ad35dd4e21e 100644 --- a/stdlib/REPL/test/repl.jl +++ b/stdlib/REPL/test/repl.jl @@ -11,7 +11,7 @@ empty!(Base.Experimental._hint_handlers) # unregister error hints so they can be @test Base.REPL_MODULE_REF[] === REPL -const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test") +const BASE_TEST_PATH = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test") isdefined(Main, :FakePTYs) || @eval Main include(joinpath($(BASE_TEST_PATH), "testhelpers", "FakePTYs.jl")) import .Main.FakePTYs: with_fake_pty diff --git a/stdlib/Random/src/RNGs.jl b/stdlib/Random/src/RNGs.jl index 2ea2fb3a684df..6c8fc684d8e53 100644 --- a/stdlib/Random/src/RNGs.jl +++ b/stdlib/Random/src/RNGs.jl @@ -287,7 +287,7 @@ function random_seed() # almost surely always getting distinct seeds, while having them printed reasonably tersely return rand(RandomDevice(), UInt128) catch ex - ex isa IOError || rethrow() + ex isa Base.IOError || rethrow() @warn "Entropy pool not available to seed RNG; using ad-hoc entropy sources." return Libc.rand() end diff --git a/stdlib/Random/test/runtests.jl b/stdlib/Random/test/runtests.jl index a28197bdfe833..cfc53a6cd17be 100644 --- a/stdlib/Random/test/runtests.jl +++ b/stdlib/Random/test/runtests.jl @@ -3,7 +3,7 @@ using Test, SparseArrays using Test: guardseed -const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test") +const BASE_TEST_PATH = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test") isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($(BASE_TEST_PATH), "testhelpers", "OffsetArrays.jl")) using .Main.OffsetArrays diff --git a/stdlib/SharedArrays/test/runtests.jl b/stdlib/SharedArrays/test/runtests.jl index 84dffafb3d92a..1d4bd81e4b75f 100644 --- a/stdlib/SharedArrays/test/runtests.jl +++ b/stdlib/SharedArrays/test/runtests.jl @@ -1,7 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license using Test, Distributed, SharedArrays, Random -include(joinpath(Sys.BINDIR, "..", "share", "julia", "test", "testenv.jl")) +include(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test", "testenv.jl")) # These processes explicitly want to share memory, we can't have # them in separate rr sessions diff --git a/test/atomics.jl b/test/atomics.jl index 3572824741459..369a63f7d5fbf 100644 --- a/test/atomics.jl +++ b/test/atomics.jl @@ -57,9 +57,8 @@ swap(x, y) = y struct UndefComplex{T} re::T im::T - UndefComplex{T}() where {T} = new{T}() end -Base.convert(T::Type{<:UndefComplex}, S) = T() +Base.convert(T::Type{<:UndefComplex}, S) = T(S, 0) let T1 = Refxy{NTuple{3,UInt8}}, T2 = ARefxy{NTuple{3,UInt8}} diff --git a/test/llvmpasses/multiversioning-clone-only.ll b/test/llvmpasses/multiversioning-clone-only.ll index 00f0db0aa1e91..c4f5257a59988 100644 --- a/test/llvmpasses/multiversioning-clone-only.ll +++ b/test/llvmpasses/multiversioning-clone-only.ll @@ -7,7 +7,7 @@ ; CHECK: @jl_fvar_idxs = hidden constant [1 x i32] zeroinitializer ; CHECK: @jl_gvar_idxs = hidden constant [0 x i32] zeroinitializer ; OPAQUE: @subtarget_cloned_gv = hidden global ptr null -; OPAQUE: @subtarget_cloned.reloc_slot = hidden global ptr null +; OPAQUE: @subtarget_cloned.reloc_slot = hidden global ptr @subtarget_cloned.autoinit_trampoline ; CHECK: @jl_fvar_count = hidden constant i64 1 ; OPAQUE: @jl_fvar_ptrs = hidden global [1 x ptr] [ptr @subtarget_cloned] ; CHECK: @jl_clone_slots = hidden constant [5 x i32] @@ -57,7 +57,7 @@ define noundef i32 @subtarget_cloned(i32 noundef %0) #2 { ; COM: should fixup this callsite since 2 is cloned for a subtarget ; CHECK: define{{.*}}@call_subtarget_cloned({{.*}}#[[CALL_SUBTARGET_CLONED_DEFAULT_ATTRS:[0-9]+]] ; CHECK-NEXT: [[FUNC_PTR:%[0-9]+]] = load{{.*}}@subtarget_cloned.reloc_slot{{.*}}!tbaa ![[TBAA_CONST_METADATA:[0-9]+]], !invariant.load -; CHECK-NEXT: call{{.*}}[[FUNC_PTR]] +; CHECK-NEXT: call{{.*}}[[FUNC_PTR]]({{.*}}) ; CHECK: ret i32 define noundef i32 @call_subtarget_cloned(i32 noundef %0) #3 { %2 = call noundef i32 @subtarget_cloned(i32 noundef %0) @@ -66,13 +66,23 @@ define noundef i32 @call_subtarget_cloned(i32 noundef %0) #3 { ; CHECK: define{{.*}}@call_subtarget_cloned_but_not_cloned({{.*}}#[[BORING_DEFAULT_ATTRS]] ; CHECK-NEXT: [[FUNC_PTR:%[0-9]+]] = load{{.*}}@subtarget_cloned.reloc_slot{{.*}}!tbaa ![[TBAA_CONST_METADATA]], !invariant.load -; CHECK-NEXT: call{{.*}}[[FUNC_PTR]] +; CHECK-NEXT: call{{.*}}[[FUNC_PTR]]({{.*}}) ; CHECK: ret i32 define noundef i32 @call_subtarget_cloned_but_not_cloned(i32 noundef %0) #0 { %2 = call noundef i32 @subtarget_cloned(i32 noundef %0) ret i32 %2 } +; COM: check that the autoinit trampoline is generated correctly +; CHECK: define{{.*}}@subtarget_cloned.autoinit_trampoline({{.*}} +; CHECK-NEXT: top: +; CHECK-NEXT: call ptr @ijl_autoinit_and_adopt_thread() +; CHECK-NEXT: [[FUNC_PTR:%[0-9]+]] = load ptr, ptr @subtarget_cloned.reloc_slot{{.*}}!tbaa ![[TBAA_CONST_METADATA]], !invariant.load +; CHECK-NEXT: call{{.*}}[[FUNC_PTR]]({{.*}}) +; CHECK: ret i32 + +declare ptr @ijl_autoinit_and_adopt_thread() + ; CHECK: define{{.*}}@boring.1({{.*}}#[[BORING_CLONEALL_ATTRS:[0-9]+]] ; CHECK-NEXT: ret i32 %0 @@ -106,10 +116,10 @@ define noundef i32 @call_subtarget_cloned_but_not_cloned(i32 noundef %0) #0 { ; CHECK-NOT: @subtarget_cloned_but_not_cloned.2 ; COM: check for alias being rewritten to a function trampoline -; CHECK: define{{.*}}@subtarget_cloned_aliased{{.*}}#[[SUBTARGET_ALIASED_ATTRS:[0-9]+]] +; CHECK: define{{.*}}@subtarget_cloned_aliased{{[^.]*}}#[[SUBTARGET_ALIASED_ATTRS:[0-9]+]] ; CHECK-NOT: } ; CHECK: [[FUNC_PTR:%[0-9]+]] = load{{.*}}@subtarget_cloned.reloc_slot{{.*}}!tbaa ![[TBAA_CONST_METADATA]], !invariant.load -; CHECK-NEXT: call{{.*}}[[FUNC_PTR]] +; CHECK-NEXT: call{{.*}}[[FUNC_PTR]]({{.*}}) ; CHECK: ret i32 ; CHECK: attributes #[[BORING_DEFAULT_ATTRS]] diff --git a/test/llvmpasses/multiversioning-x86.ll b/test/llvmpasses/multiversioning-x86.ll index ff4a8abba5252..e2918d0c20eec 100644 --- a/test/llvmpasses/multiversioning-x86.ll +++ b/test/llvmpasses/multiversioning-x86.ll @@ -11,7 +11,7 @@ ; OPAQUE: @jl_gvar_ptrs = global [0 x ptr] zeroinitializer, align 8 ; CHECK: @jl_fvar_idxs = hidden constant [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4], align 8 ; CHECK: @jl_gvar_idxs = hidden constant [0 x i32] zeroinitializer, align 8 -; OPAQUE: @simd_test.reloc_slot = hidden global ptr null +; OPAQUE: @simd_test.reloc_slot = hidden global ptr @simd_test.autoinit_trampoline ; OPAQUE: @jl_fvar_ptrs = hidden global [5 x ptr] [ptr @boring, ptr @fastmath_test, ptr @loop_test, ptr @simd_test, ptr @simd_test_call] ; OPAQUE: @jl_clone_slots = hidden constant [3 x i32] [i32 1, i32 3, i32 trunc (i64 sub (i64 ptrtoint (ptr @simd_test.reloc_slot to i64), i64 ptrtoint (ptr @jl_clone_slots to i64)) to i32)] ; CHECK: @jl_clone_idxs = hidden constant [10 x i32] [i32 -2147483647, i32 3, i32 -2147483647, i32 3, i32 4, i32 1, i32 1, i32 2, i32 -2147483645, i32 4] diff --git a/test/loading.jl b/test/loading.jl index 1a0a723eee533..a6fb433be52df 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -1414,12 +1414,21 @@ end mktempdir() do depot # This manifest has a LibGit2 entry that is missing LibGit2_jll, which should be # handled by falling back to the stdlib Project.toml for dependency truth. - badmanifest_test_dir = joinpath(@__DIR__, "project", "deps", "BadStdlibDeps.jl") + badmanifest_test_dir = joinpath(@__DIR__, "project", "deps", "BadStdlibDeps") @test success(addenv( `$(Base.julia_cmd()) --project=$badmanifest_test_dir --startup-file=no -e 'using LibGit2'`, "JULIA_DEPOT_PATH" => depot * Base.Filesystem.pathsep(), )) end + mktempdir() do depot + # This manifest has a LibGit2 entry that has a LibGit2_jll with a git-tree-hash1 + # which simulates an old manifest where LibGit2_jll was not a stdlib + badmanifest_test_dir2 = joinpath(@__DIR__, "project", "deps", "BadStdlibDeps2") + @test success(addenv( + `$(Base.julia_cmd()) --project=$badmanifest_test_dir2 --startup-file=no -e 'using LibGit2'`, + "JULIA_DEPOT_PATH" => depot * Base.Filesystem.pathsep(), + )) + end end @testset "code coverage disabled during precompilation" begin diff --git a/test/project/deps/BadStdlibDeps2/Manifest.toml b/test/project/deps/BadStdlibDeps2/Manifest.toml new file mode 100644 index 0000000000000..988efc8da56f3 --- /dev/null +++ b/test/project/deps/BadStdlibDeps2/Manifest.toml @@ -0,0 +1,54 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.12.0-DEV" +manifest_format = "2.0" +project_hash = "dc9d33b0ee13d9466bdb75b8d375808a534a79ec" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +version = "1.11.0" + +[[deps.LibGit2]] +deps = ["NetworkOptions", "Printf", "SHA", "LibGit2_jll"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" +version = "1.11.0" + +# This is an stdlib but intentionally has a git-tree-sha1 because +# we are emulating that the manifest comes from a version where +# LibGit2_jll was not an stdlib +[[deps.LibGit2_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] +git-tree-sha1 = "1111111111111111111111111111111111111111" +uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" +version = "1.8.0+0" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.11.0+1" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +version = "1.11.0" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.6+1" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" +version = "1.11.0" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" +version = "1.11.0" diff --git a/test/project/deps/BadStdlibDeps2/Project.toml b/test/project/deps/BadStdlibDeps2/Project.toml new file mode 100644 index 0000000000000..223889185ea15 --- /dev/null +++ b/test/project/deps/BadStdlibDeps2/Project.toml @@ -0,0 +1,2 @@ +[deps] +LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" diff --git a/test/secretbuffer.jl b/test/secretbuffer.jl index 703552570745c..996471c5b3830 100644 --- a/test/secretbuffer.jl +++ b/test/secretbuffer.jl @@ -1,6 +1,6 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test") +const BASE_TEST_PATH = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test") isdefined(Main, :ChallengePrompts) || @eval Main include(joinpath($(BASE_TEST_PATH), "testhelpers", "ChallengePrompts.jl")) using .Main.ChallengePrompts: challenge_prompt diff --git a/test/syntax.jl b/test/syntax.jl index 833ecf232ed44..70640e6c93d67 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -2282,6 +2282,11 @@ end @test Meta.parse("a ⥷ b") == Expr(:call, :⥷, :a, :b) end +# issue 57143 +@testset "binary 🢲" begin + @test Meta.parse("a 🢲 b") == Expr(:call, :🢲, :a, :b) +end + # only allow certain characters after interpolated vars (#25231) @test_parseerror("\"\$x෴ \"", "interpolated variable \$x ends with invalid character \"෴\"; use \"\$(x)\" instead.")