Skip to content

Commit 83796a7

Browse files
authored
Merge pull request #21 from qinsoon/update-upstream-43bf2c8
Update upstream 43bf2c8
2 parents fdef6b1 + c8543de commit 83796a7

File tree

371 files changed

+10981
-5749
lines changed

Some content is hidden

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

371 files changed

+10981
-5749
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/source-dist.tmp
1313
/source-dist.tmp1
1414

15+
*.expmap
1516
*.exe
1617
*.dll
1718
*.dwo

.mailmap

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,3 +283,15 @@ Daniel Karrasch <[email protected]> <[email protected]>
283283

284284
285285
286+
287+
Frames Catherine White <[email protected]> <[email protected]>
288+
Frames Catherine White <[email protected]> <[email protected]>
289+
Frames Catherine White <[email protected]> <[email protected]>
290+
291+
292+
293+
Jishnu Bhattacharya <[email protected]> <[email protected]>
294+
Jishnu Bhattacharya <[email protected]> <[email protected]>
295+
296+
297+

CONTRIBUTING.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,14 @@ At the moment, this should always be done with the following `compat` admonition
185185
186186
*By contributing code to Julia, you are agreeing to release it under the [MIT License](https://github.com/JuliaLang/julia/tree/master/LICENSE.md).*
187187
188-
The Julia community uses [GitHub issues](https://github.com/JuliaLang/julia/issues) to track and discuss problems, feature requests, and pull requests (PR). You can make pull requests for incomplete features to get code review. The convention is to prefix the pull request title with "WIP:" for Work In Progress, or "RFC:" for Request for Comments when work is completed and ready for merging. This will prevent accidental merging of work that is in progress.
188+
The Julia community uses [GitHub issues](https://github.com/JuliaLang/julia/issues) to track and discuss problems, feature requests, and pull requests (PR).
189+
190+
Issues and pull requests should have self explanatory titles such that they can be understood from the list of PRs and Issues.
191+
i.e. `Add {feature}` and `Fix {bug}` are good, `Fix #12345. Corrects the bug.` is bad.
192+
193+
You can make pull requests for incomplete features to get code review. The convention is to open these a draft PRs and prefix
194+
the pull request title with "WIP:" for Work In Progress, or "RFC:" for Request for Comments when work is completed and ready
195+
for merging. This will prevent accidental merging of work that is in progress.
189196
190197
Note: These instructions are for adding to or improving functionality in the base library. Before getting started, it can be helpful to discuss the proposed changes or additions on the [Julia Discourse forum](https://discourse.julialang.org) or in a GitHub issue---it's possible your proposed change belongs in a package rather than the core language. Also, keep in mind that changing stuff in the base can potentially break a lot of things. Finally, because of the time required to build Julia, note that it's usually faster to develop your code in stand-alone files, get it working, and then migrate it into the base libraries.
191198
@@ -325,7 +332,7 @@ please remove the `backport-X.Y` tag from the originating pull request for the c
325332
- use lower case with underscores for method names
326333
- it is generally preferred to use ASCII operators and identifiers over
327334
Unicode equivalents whenever possible
328-
- in docstring refer to the language as "Julia" and the executable as "`julia`"
335+
- in docstrings refer to the language as "Julia" and the executable as "`julia`"
329336

330337
#### General Formatting Guidelines For C code contributions
331338

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2009-2022: Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors: https://github.com/JuliaLang/julia/contributors
3+
Copyright (c) 2009-2023: Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors: https://github.com/JuliaLang/julia/contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

Make.inc

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,17 @@ JULIA_MINOR_VERSION := $(shell echo $(JULIA_VERSION) | cut -d'-' -f 1 | cut -d'.
191191
JULIA_PATCH_VERSION := $(shell echo $(JULIA_VERSION) | cut -d'-' -f 1 | cut -d'+' -f 1 | cut -d'.' -f 3)
192192

193193
# libjulia's SONAME will follow the format libjulia.so.$(SOMAJOR). Before v1.0.0,
194-
# SOMAJOR will be a two-decimal value, e.g. libjulia.so.0.5, whereas at and beyond
195-
# v1.0.0, SOMAJOR will be simply the major version number, e.g. libjulia.so.1
194+
# somajor was a two-decimal value (e.g. libjulia.so.0.5). During v1.0.x - v1.9.x,
195+
# somajor was simply the major version number (e.g. libjulia.so.1). Starting in
196+
# v1.10.0, somajor is major.minor again (e.g. libjulia.so.1.10)
196197
# The file itself will ultimately symlink to libjulia.so.$(SOMAJOR).$(SOMINOR)
197-
ifeq ($(JULIA_MAJOR_VERSION),0)
198198
SOMAJOR := $(JULIA_MAJOR_VERSION).$(JULIA_MINOR_VERSION)
199199
SOMINOR := $(JULIA_PATCH_VERSION)
200-
else
201-
SOMAJOR := $(JULIA_MAJOR_VERSION)
202-
SOMINOR := $(JULIA_MINOR_VERSION)
200+
201+
# This suffix affects libjulia's SONAME and the symbol version associated with
202+
# all of its exported symbols.
203+
ifdef SYMBOL_VERSION_SUFFIX
204+
SOMAJOR := $(SOMAJOR)_$(SYMBOL_VERSION_SUFFIX)
203205
endif
204206

205207
ifneq ($(NO_GIT), 1)
@@ -489,37 +491,61 @@ MACOSX_VERSION_MIN := 11.0
489491
endif
490492
endif
491493

492-
ifeq ($(USEGCC),1)
493-
CC := $(CROSS_COMPILE)gcc
494-
CXX := $(CROSS_COMPILE)g++
495-
JCFLAGS := -std=gnu11 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
494+
JCFLAGS_COMMON := -std=gnu11 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
495+
JCFLAGS_CLANG := $(JCFLAGS_COMMON)
496+
JCFLAGS_GCC := $(JCFLAGS_COMMON) -fno-gnu-unique
497+
496498
# AArch64 needs this flag to generate the .eh_frame used by libunwind
497-
JCPPFLAGS := -fasynchronous-unwind-tables
498-
JCXXFLAGS := -pipe $(fPIC) -fno-rtti -std=c++14
499+
JCPPFLAGS_COMMON := -fasynchronous-unwind-tables
500+
JCPPFLAGS_CLANG := $(JCPPFLAGS_COMMON)
501+
JCPPFLAGS_GCC := $(JCPPFLAGS_COMMON)
502+
503+
JCXXFLAGS_COMMON := -pipe $(fPIC) -fno-rtti -std=c++14
504+
JCXXFLAGS_CLANG := $(JCXXFLAGS_COMMON) -pedantic
505+
JCXXFLAGS_GCC := $(JCXXFLAGS_COMMON) -fno-gnu-unique
506+
507+
DEBUGFLAGS_COMMON := -O0 -DJL_DEBUG_BUILD -fstack-protector
508+
DEBUGFLAGS_CLANG := $(DEBUGFLAGS_COMMON) -g
509+
DEBUGFLAGS_GCC := $(DEBUGFLAGS_COMMON) -ggdb2
510+
511+
SHIPFLAGS_COMMON := -O3
512+
SHIPFLAGS_CLANG := $(SHIPFLAGS_COMMON) -g
513+
SHIPFLAGS_GCC := $(SHIPFLAGS_COMMON) -ggdb2 -falign-functions
514+
515+
ifeq ($(OS), Darwin)
516+
JCPPFLAGS_CLANG += -D_LARGEFILE_SOURCE -D_DARWIN_USE_64_BIT_INODE=1
517+
endif
518+
499519
ifneq ($(OS), WINNT)
500520
# Do not enable on windows to avoid warnings from libuv.
501-
JCXXFLAGS += -pedantic
521+
JCXXFLAGS_GCC += -pedantic
502522
endif
503-
DEBUGFLAGS := -O0 -ggdb2 -DJL_DEBUG_BUILD -fstack-protector
504-
SHIPFLAGS := -O3 -ggdb2 -falign-functions
523+
524+
ifeq ($(USEGCC),1)
525+
CC := $(CROSS_COMPILE)gcc
526+
CXX := $(CROSS_COMPILE)g++
527+
JCFLAGS := $(JCFLAGS_GCC)
528+
JCPPFLAGS := $(JCPPFLAGS_GCC)
529+
JCXXFLAGS := $(JCXXFLAGS_GCC)
530+
DEBUGFLAGS := $(DEBUGFLAGS_GCC)
531+
SHIPFLAGS := $(SHIPFLAGS_GCC)
505532
endif
506533

507534
ifeq ($(USECLANG),1)
508-
CC := $(CROSS_COMPILE)clang
509-
CXX := $(CROSS_COMPILE)clang++
510-
JCFLAGS := -std=gnu11 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
511-
# AArch64 needs this flag to generate the .eh_frame used by libunwind
512-
JCPPFLAGS := -fasynchronous-unwind-tables
513-
JCXXFLAGS := -pipe $(fPIC) -fno-rtti -pedantic -std=c++14
514-
DEBUGFLAGS := -O0 -g -DJL_DEBUG_BUILD -fstack-protector
515-
SHIPFLAGS := -O3 -g
535+
CC := $(CROSS_COMPILE)clang
536+
CXX := $(CROSS_COMPILE)clang++
537+
JCFLAGS := $(JCFLAGS_CLANG)
538+
JCPPFLAGS := $(JCPPFLAGS_CLANG)
539+
JCXXFLAGS := $(JCXXFLAGS_CLANG)
540+
DEBUGFLAGS := $(DEBUGFLAGS_CLANG)
541+
SHIPFLAGS := $(SHIPFLAGS_CLANG)
542+
516543
ifeq ($(OS), Darwin)
517544
CC += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
518545
CXX += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
519546
FC += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
520547
# export MACOSX_DEPLOYMENT_TARGET so that ld picks it up, especially for deps
521548
export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_VERSION_MIN)
522-
JCPPFLAGS += -D_LARGEFILE_SOURCE -D_DARWIN_USE_64_BIT_INODE=1
523549
endif
524550
endif
525551

@@ -702,7 +728,7 @@ endif # OS Linux or FreeBSD
702728
endif # SANITIZE_MEMORY=1
703729
ifeq ($(SANITIZE_ADDRESS),1)
704730
SANITIZE_OPTS += -fsanitize=address
705-
SANITIZE_LDFLAGS += -fsanitize=address
731+
SANITIZE_LDFLAGS += -fsanitize=address -shared-libasan
706732
endif
707733
ifeq ($(SANITIZE_THREAD),1)
708734
SANITIZE_OPTS += -fsanitize=thread
@@ -1334,7 +1360,7 @@ ifeq (supported, $(shell echo $(IFUNC_DETECT_SRC) | $(CC) -Werror -x c - -S -o /
13341360
JCPPFLAGS += -DJULIA_HAS_IFUNC_SUPPORT=1
13351361
endif
13361362
JLDFLAGS += -Wl,-Bdynamic
1337-
OSLIBS += -Wl,--version-script=$(JULIAHOME)/src/julia.expmap
1363+
OSLIBS += -Wl,--version-script=$(BUILDROOT)/src/julia.expmap
13381364
ifneq ($(SANITIZE),1)
13391365
JLDFLAGS += -Wl,-no-undefined
13401366
endif
@@ -1359,7 +1385,7 @@ OSLIBS += -lelf -lkvm -lrt -lpthread -latomic
13591385
# See #21788
13601386
OSLIBS += -lgcc_s
13611387

1362-
OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \
1388+
OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(BUILDROOT)/src/julia.expmap \
13631389
$(NO_WHOLE_ARCHIVE)
13641390
endif
13651391

@@ -1374,7 +1400,7 @@ endif
13741400

13751401
ifeq ($(OS), WINNT)
13761402
HAVE_SSP := 1
1377-
OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \
1403+
OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(BUILDROOT)/src/julia.expmap \
13781404
$(NO_WHOLE_ARCHIVE) -lpsapi -lkernel32 -lws2_32 -liphlpapi -lwinmm -ldbghelp -luserenv -lsecur32 -latomic
13791405
JLDFLAGS += -Wl,--stack,8388608
13801406
ifeq ($(ARCH),i686)
@@ -1517,6 +1543,12 @@ endef
15171543
# Overridable in Make.user
15181544
WINE ?= wine
15191545

1546+
ifeq ($(BINARY),32)
1547+
HEAPLIM := --heap-size-hint=500M
1548+
else
1549+
HEAPLIM :=
1550+
endif
1551+
15201552
# many of the following targets must be = not := because the expansion of the makefile functions (and $1) shouldn't happen until later
15211553
ifeq ($(BUILD_OS), WINNT) # MSYS
15221554
spawn = $(1)

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ JL_PRIVATE_LIBS-$(USE_SYSTEM_CSL) += libwinpthread
237237
else
238238
JL_PRIVATE_LIBS-$(USE_SYSTEM_CSL) += libpthread
239239
endif
240+
ifeq ($(SANITIZE),1)
241+
ifeq ($(USECLANG),1)
242+
JL_PRIVATE_LIBS-1 += libclang_rt.asan
243+
else
244+
JL_PRIVATE_LIBS-1 += libasan
245+
endif
246+
endif
247+
240248
ifeq ($(WITH_TRACY),1)
241249
JL_PRIVATE_LIBS-0 += libTracyClient
242250
endif
@@ -365,6 +373,10 @@ endif
365373
# Remove various files which should not be installed
366374
-rm -f $(DESTDIR)$(datarootdir)/julia/base/version_git.sh
367375
-rm -f $(DESTDIR)$(datarootdir)/julia/test/Makefile
376+
-rm -f $(DESTDIR)$(datarootdir)/julia/base/*/source-extracted
377+
-rm -f $(DESTDIR)$(datarootdir)/julia/base/*/build-configured
378+
-rm -f $(DESTDIR)$(datarootdir)/julia/base/*/build-compiled
379+
-rm -f $(DESTDIR)$(datarootdir)/julia/base/*/build-checked
368380
-rm -f $(DESTDIR)$(datarootdir)/julia/stdlib/$(VERSDIR)/*/source-extracted
369381
-rm -f $(DESTDIR)$(datarootdir)/julia/stdlib/$(VERSDIR)/*/build-configured
370382
-rm -f $(DESTDIR)$(datarootdir)/julia/stdlib/$(VERSDIR)/*/build-compiled

NEWS.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Julia v1.10 Release Notes
44
New language features
55
---------------------
66

7+
* JuliaSyntax.jl is now used as the default parser, providing better diagnostics and faster
8+
parsing. Set environment variable `JULIA_USE_NEW_PARSER` to `0` to switch back to the old
9+
parser if necessary (and if you find this necessary, please file an issue) ([#46372]).
710
* `` (U+297A, `\leftarrowsubset`) and `` (U+2977, `\leftarrowless`)
811
may now be used as binary operators with arrow precedence. ([#45962])
912

@@ -18,12 +21,21 @@ Language changes
1821
that significantly improves load and inference times for heavily overloaded methods that
1922
dispatch on Types (such as traits and constructors).
2023
* The "h bar" `` (`\hslash` U+210F) character is now treated as equivalent to `ħ` (`\hbar` U+0127).
24+
* The `@simd` macro now has a more limited and clearer semantics, it only enables reordering and contraction
25+
of floating-point operations, instead of turning on all "fastmath" optimizations.
26+
If you observe performance regressions due to this change, you can recover previous behavior with `@fastmath @simd`,
27+
if you are OK with all the optimizations enabled by the `@fastmath` macro. ([#49405])
28+
* When a method with keyword arguments is displayed in the stack trace view, the textual
29+
representation of the keyword arguments' types is simplified using the new
30+
`@Kwargs{key1::Type1, ...}` macro syntax ([#49959]).
2131

2232
Compiler/Runtime improvements
2333
-----------------------------
2434

2535
* The `@pure` macro is now deprecated. Use `Base.@assume_effects :foldable` instead ([#48682]).
2636
* The mark phase of the Garbage Collector is now multi-threaded ([#48600]).
37+
* [JITLink](https://llvm.org/docs/JITLink.html) is enabled by default on Linux aarch64 when Julia is linked to LLVM 15 or later versions ([#49745]).
38+
This should resolve many segmentation faults previously observed on this platform.
2739

2840
Command-line option changes
2941
---------------------------
@@ -44,6 +56,8 @@ New library functions
4456
* `tanpi` is now defined. It computes tan(πx) more accurately than `tan(pi*x)` ([#48575]).
4557
* `fourthroot(x)` is now defined in `Base.Math` and can be used to compute the fourth root of `x`.
4658
It can also be accessed using the unicode character ``, which can be typed by `\fourthroot<tab>` ([#48899]).
59+
* `Libc.memmove`, `Libc.memset`, and `Libc.memcpy` are now defined, whose functionality matches that of their respective C calls.
60+
* `Base.isprecompiled(pkg::PkgId)` to identify whether a package has already been precompiled ([#50218]).
4761

4862
New library features
4963
--------------------
@@ -52,6 +66,7 @@ New library features
5266
* `binomial(x, k)` now supports non-integer `x` ([#48124]).
5367
* A `CartesianIndex` is now treated as a "scalar" for broadcasting ([#47044]).
5468
* `printstyled` now supports italic output ([#45164]).
69+
* `parent` and `parentindices` support `SubString`s
5570

5671
Standard library changes
5772
------------------------
@@ -82,6 +97,11 @@ Standard library changes
8297
(real symmetric) part of a matrix ([#31836]).
8398
* The `norm` of the adjoint or transpose of an `AbstractMatrix` now returns the norm of the
8499
parent matrix by default, matching the current behaviour for `AbstractVector`s ([#49020]).
100+
* `eigen(A, B)` and `eigvals(A, B)`, where one of `A` or `B` is symmetric or Hermitian,
101+
are now fully supported ([#49533])
102+
* `eigvals/eigen(A, cholesky(B))` now computes the generalized eigenvalues (`eigen`: and eigenvectors)
103+
of `A` and `B` via Cholesky decomposition for positive definite `B`. Note: The second argument is
104+
the output of `cholesky`.
85105

86106
#### Printf
87107
* Format specifiers now support dynamic width and precision, e.g. `%*s` and `%*.*g` ([#40105]).
@@ -94,6 +114,8 @@ Standard library changes
94114

95115
#### REPL
96116

117+
* When stack traces are printed, the printed depth of types in function signatures will be limited
118+
to avoid overly verbose output ([#49795]).
97119

98120
#### SuiteSparse
99121

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1+
<a name="logo"/>
12
<div align="center">
2-
<a href="https://julialang.org/" target="_blank">
3-
<picture>
4-
<source media="(prefers-color-scheme: dark)" srcset="doc/src/assets/julialogoheaderimage_dark.svg">
5-
<img alt="The Julia logo" src="doc/src/assets/julialogoheaderimage_light.svg">
6-
</picture>
7-
</a>
3+
<a href="https://julialang.org/" target="_blank">
4+
<img src="doc/src/assets/logo.svg" alt="Julia Logo" width="210" height="142"></img>
5+
</a>
86
</div>
97

108
<table>

base/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
/version_git.jl
99
/version_git.jl.phony
1010
/userimg.jl
11+
/JuliaSyntax

base/Base.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using Core.Intrinsics, Core.IR
66

77
# to start, we're going to use a very simple definition of `include`
88
# that doesn't require any function (except what we can get from the `Core` top-module)
9-
const _included_files = Array{Tuple{Module,String},1}()
9+
const _included_files = Array{Tuple{Module,String},1}(Core.undef, 1)
1010
function include(mod::Module, path::String)
1111
ccall(:jl_array_grow_end, Cvoid, (Any, UInt), _included_files, UInt(1))
1212
Core.arrayset(true, _included_files, (mod, ccall(:jl_prepend_cwd, Any, (Any,), path)), arraylen(_included_files))
@@ -163,6 +163,7 @@ include("int.jl")
163163
include("operators.jl")
164164
include("pointer.jl")
165165
include("refvalue.jl")
166+
include("cmem.jl")
166167
include("refpointer.jl")
167168

168169
# now replace the Pair constructor (relevant for NamedTuples) with one that calls our Base.convert
@@ -316,7 +317,7 @@ include("version.jl")
316317
# system & environment
317318
include("sysinfo.jl")
318319
include("libc.jl")
319-
using .Libc: getpid, gethostname, time
320+
using .Libc: getpid, gethostname, time, memcpy, memset, memmove, memcmp
320321

321322
# These used to be in build_h.jl and are retained for backwards compatibility.
322323
# NOTE: keep in sync with `libblastrampoline_jll.libblastrampoline`.
@@ -488,6 +489,10 @@ a_method_to_overwrite_in_test() = inferencebarrier(1)
488489
include(mod::Module, _path::AbstractString) = _include(identity, mod, _path)
489490
include(mapexpr::Function, mod::Module, _path::AbstractString) = _include(mapexpr, mod, _path)
490491

492+
# External libraries vendored into Base
493+
Core.println("JuliaSyntax/src/JuliaSyntax.jl")
494+
include(@__MODULE__, "JuliaSyntax/src/JuliaSyntax.jl")
495+
491496
end_base_include = time_ns()
492497

493498
const _sysimage_modules = PkgId[]
@@ -596,8 +601,12 @@ function __init__()
596601
ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), PROFILE_PRINT_COND[].handle)
597602
errormonitor(Threads.@spawn(profile_printing_listener()))
598603
end
604+
_require_world_age[] = get_world_counter()
599605
# Prevent spawned Julia process from getting stuck waiting on Tracy to connect.
600606
delete!(ENV, "JULIA_WAIT_FOR_TRACY")
607+
if get_bool_env("JULIA_USE_NEW_PARSER", true) === true
608+
JuliaSyntax.enable_in_core!()
609+
end
601610
nothing
602611
end
603612

@@ -606,5 +615,8 @@ end
606615

607616
end
608617

618+
# Ensure this file is also tracked
619+
@assert !isassigned(_included_files, 1)
620+
_included_files[1] = (parentmodule(Base), abspath(@__FILE__))
609621

610622
end # baremodule Base

0 commit comments

Comments
 (0)