Skip to content

Commit 7955e35

Browse files
authored
Merge branch 'master' into inline_info2
2 parents 784c7d1 + 8ccf2d6 commit 7955e35

File tree

339 files changed

+9030
-5440
lines changed

Some content is hidden

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

339 files changed

+9030
-5440
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ Add new code to Julia's base libraries as follows (this is the "basic" approach;
201201
202202
Build as usual, and do `make clean testall` to test your contribution. If your contribution includes changes to Makefiles or external dependencies, make sure you can build Julia from a clean tree using `git clean -fdx` or equivalent (be careful – this command will delete any files lying around that aren't checked into git).
203203
204-
Note: You can run specific test files with `make`:
204+
#### Running specific tests
205+
There are `make` targets for running specific tests:
205206
206207
make test-bitarray
207208
208-
or with the `runtests.jl` script, e.g. to run `test/bitarray.jl` and `test/math.jl`:
209+
You can also use the `runtests.jl` script, e.g. to run `test/bitarray.jl` and `test/math.jl`:
209210
210211
./usr/bin/julia test/runtests.jl bitarray math
211212
@@ -242,12 +243,30 @@ If you need to restart your Julia session, just start at step 2 above.
242243
built and incorporate them automatically. You only need to rebuild
243244
Julia if you made code-changes that Revise cannot handle.
244245

245-
For convenience, there are also `test-revise-*` targets for every `test-*`
246-
target that use Revise to load any modifications to Base into the current
247-
process before running the corresponding test. This can be useful as a shortcut
246+
For convenience, there are also `test-revise-*` targets for every [`test-*`
247+
target](https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#running-specific-tests) that use Revise to load any modifications to Base into the current
248+
system image before running the corresponding test. This can be useful as a shortcut
248249
on the command line (since tests aren't always designed to be run outside the
249250
runtest harness).
250251

252+
### Contributing to the standard library
253+
254+
The standard library (stdlib) packages are baked into the Julia system image.
255+
When running the ordinary test workflow on the stdlib packages, the system image
256+
version overrides the version you are developing.
257+
To test stdlib packages, you can do the following steps:
258+
259+
1. Edit the UUID field of the `Project.toml` in the stdlib package
260+
2. Change the current directory to the directory of the stdlib you are developing
261+
3. Start julia with `julia --project=.`
262+
4. You can now test the package by running `pkg> test` in Pkg mode.
263+
264+
Because you changed the UUID, the package manager treats the stdlib package as
265+
different from the one in the system image, and the system image version will
266+
not override the package.
267+
268+
Be sure to change the UUID value back before making the pull request.
269+
251270
### Contributing to patch releases
252271

253272
The process of creating a patch release is roughly as follows:

HISTORY.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ New language features
1111
e.g. `[;;;]` creates a 0×0×0 `Array` ([#41618]).
1212
* `try`-blocks can now optionally have an `else`-block which is executed right after the main body only if
1313
no errors were thrown ([#42211]).
14-
* `@inline` and `@noinline` annotations can now be placed within a function body ([#41312]).
15-
* `@inline` and `@noinline` annotations can now be applied to a function call site or block
14+
* `@inline` and `@noinline` can now be placed within a function body, allowing one to annotate anonymous function ([#41312]).
15+
* `@inline` and `@noinline` can now be applied to a function at callsite or block
1616
to enforce the involved function calls to be (or not to be) inlined ([#41328]).
1717
* ``, ``, and `` are now allowed as identifier characters ([#42314]).
1818
* Support for Unicode 14.0.0 ([#43443]).
@@ -43,7 +43,9 @@ Compiler/Runtime improvements
4343
`libjulia-codegen`. It is loaded by default, so normal usage should see no changes.
4444
In deployments that do not need the compiler (e.g. system images where all needed code
4545
is precompiled), this library (and its LLVM dependency) can simply be excluded ([#41936]).
46-
* Conditional type constraints can now be forwarded interprocedurally (i.e. propagated from caller to callee) ([#42529]).
46+
* Conditional type constraints are now be forwarded interprocedurally (i.e. propagated from caller to callee).
47+
This allows inference to understand e.g. `Base.ifelse(isa(x, Int), x, 0)` returns `::Int`-value
48+
even if the type of `x` is not known ([#42529]).
4749
* Julia-level SROA (Scalar Replacement of Aggregates) has been improved: allowing elimination of
4850
`getfield` calls with constant global fields ([#42355]), enabling elimination of mutable structs with
4951
uninitialized fields ([#43208]), improving performance ([#43232]), and handling more nested `getfield`
@@ -53,7 +55,7 @@ Compiler/Runtime improvements
5355
* Inference now tracks various effects such as side-effectful-ness and nothrow-ness on a per-specialization basis.
5456
Code heavily dependent on constant propagation should see significant compile-time performance improvements and
5557
certain cases (e.g. calls to uninlinable functions that are nevertheless effect free) should see runtime performance
56-
improvements. Effects may be overwritten manually with the `@Base.assume_effects` macro ([#43852]).
58+
improvements. Effects may be overwritten manually with the `Base.@assume_effects` macro ([#43852]).
5759

5860
Command-line option changes
5961
---------------------------
@@ -3291,7 +3293,7 @@ Deprecated or removed
32913293
array interface should define their own `strides` method ([#25321]).
32923294

32933295
* `module_parent`, `Base.datatype_module`, and `Base.function_module` have been deprecated
3294-
in favor of `parentmodule` ([#TODO]).
3296+
in favor of `parentmodule` ([#25629]).
32953297

32963298
* `rand(t::Tuple{Vararg{Int}})` is deprecated in favor of `rand(Float64, t)` or `rand(t...)`;
32973299
`rand(::Tuple)` will have another meaning in the future ([#25429], [#25278]).
@@ -3664,6 +3666,7 @@ Command-line option changes
36643666
[#25571]: https://github.com/JuliaLang/julia/issues/25571
36653667
[#25616]: https://github.com/JuliaLang/julia/issues/25616
36663668
[#25622]: https://github.com/JuliaLang/julia/issues/25622
3669+
[#25629]: https://github.com/JuliaLang/julia/issues/25629
36673670
[#25631]: https://github.com/JuliaLang/julia/issues/25631
36683671
[#25633]: https://github.com/JuliaLang/julia/issues/25633
36693672
[#25634]: https://github.com/JuliaLang/julia/issues/25634

Make.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -898,10 +898,6 @@ OPENBLAS_DYNAMIC_ARCH:=0
898898
OPENBLAS_TARGET_ARCH:=ARMV8
899899
USE_BLAS64:=1
900900
BINARY:=64
901-
ifeq ($(OS),Darwin)
902-
# Apple Chips are all at least A12Z
903-
MCPU:=apple-m1
904-
endif
905901
endif
906902

907903
# Set MARCH-specific flags

Makefile

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ default: $(JULIA_BUILD_MODE) # contains either "debug" or "release"
77
all: debug release
88

99
# sort is used to remove potential duplicates
10-
DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/stdlib $(build_man1dir))
10+
DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/src $(build_datarootdir)/julia/stdlib $(build_man1dir))
1111
ifneq ($(BUILDROOT),$(JULIAHOME))
1212
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src src/flisp src/support src/clangsa cli doc deps stdlib test test/clangsa test/embedding test/llvmpasses)
1313
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) $(BUILDROOT)/sysimage.mk
@@ -37,13 +37,13 @@ configure:
3737
endif
3838

3939
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
40-
$(foreach link,base $(JULIAHOME)/test,$(eval $(call symlink_target,$(link),$$(build_datarootdir)/julia,$(notdir $(link)))))
40+
$(eval $(call symlink_target,$(JULIAHOME)/test,$$(build_datarootdir)/julia,test))
4141

4242
julia_flisp.boot.inc.phony: julia-deps
4343
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src julia_flisp.boot.inc.phony
4444

4545
# Build the HTML docs (skipped if already exists, notably in tarballs)
46-
$(BUILDROOT)/doc/_build/html/en/index.html: $(shell find $(BUILDROOT)/base $(BUILDROOT)/doc \( -path $(BUILDROOT)/doc/_build -o -path $(BUILDROOT)/doc/deps -o -name *_constants.jl -o -name *_h.jl -o -name version_git.jl \) -prune -o -type f -print)
46+
$(BUILDROOT)/doc/_build/html/en/index.html: $(shell find $(BUILDROOT)/base $(BUILDROOT)/doc \( -path $(BUILDROOT)/doc/_build -o -path $(BUILDROOT)/doc/deps \) -prune -o -type f -print)
4747
@$(MAKE) docs
4848

4949
julia-symlink: julia-cli-$(JULIA_BUILD_MODE)
@@ -56,7 +56,7 @@ ifndef JULIA_VAGRANT_BUILD
5656
endif
5757
endif
5858

59-
julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia/test
59+
julia-deps: | $(DIRS) $(build_datarootdir)/julia/test
6060
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/deps
6161

6262
# `julia-stdlib` depends on `julia-deps` so that the fake JLL stdlibs can copy in their Artifacts.toml files.
@@ -84,9 +84,14 @@ julia-sysimg-ji : julia-stdlib julia-base julia-cli-$(JULIA_BUILD_MODE) julia-sr
8484
julia-sysimg-bc : julia-stdlib julia-base julia-cli-$(JULIA_BUILD_MODE) julia-src-$(JULIA_BUILD_MODE) | $(build_private_libdir)
8585
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-bc JULIA_EXECUTABLE='$(JULIA_EXECUTABLE)'
8686

87-
julia-sysimg-release julia-sysimg-debug : julia-sysimg-% : julia-sysimg-ji julia-src-%
88-
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-$*
87+
$(JULIA_SYSIMG_release): julia-sysimg-ji julia-src-release
88+
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-release
89+
$(JULIA_SYSIMG_debug) : julia-sysimg-ji julia-src-debug
90+
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-debug
8991

92+
julia-sysimg-release : $(JULIA_SYSIMG_release)
93+
julia-sysimg-debug : $(JULIA_SYSIMG_debug)
94+
julia-base-cache: $(build_datarootdir)/julia/base.cache
9095
julia-debug julia-release : julia-% : julia-sysimg-% julia-src-% julia-symlink julia-libccalltest julia-libllvmcalltest julia-base-cache
9196

9297
debug release : % : julia-%
@@ -156,10 +161,10 @@ $(build_datarootdir)/julia/julia-config.jl: $(JULIAHOME)/contrib/julia-config.jl
156161
$(build_depsbindir)/stringreplace: $(JULIAHOME)/contrib/stringreplace.c | $(build_depsbindir)
157162
@$(call PRINT_CC, $(HOSTCC) -o $(build_depsbindir)/stringreplace $(JULIAHOME)/contrib/stringreplace.c)
158163

159-
julia-base-cache: julia-sysimg-$(JULIA_BUILD_MODE) | $(DIRS) $(build_datarootdir)/julia
164+
$(build_datarootdir)/julia/base.cache: $(JULIA_SYSIMG) | $(DIRS) $(build_datarootdir)/julia
160165
@JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) WINEPATH="$(call cygpath_w,$(build_bindir));$$WINEPATH" \
161166
$(call spawn, $(JULIA_EXECUTABLE) --startup-file=no $(call cygpath_w,$(JULIAHOME)/etc/write_base_cache.jl) \
162-
$(call cygpath_w,$(build_datarootdir)/julia/base.cache))
167+
$(call cygpath_w,$@))
163168

164169
# public libraries, that are installed in $(prefix)/lib
165170
JL_TARGETS := julia
@@ -192,7 +197,7 @@ else
192197
JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += libz
193198
endif
194199
ifeq ($(USE_LLVM_SHLIB),1)
195-
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-13jl
200+
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-14jl
196201
endif
197202
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libunwind
198203

@@ -313,10 +318,9 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
313318
endif
314319

315320
# Copy in all .jl sources as well
316-
mkdir -p $(DESTDIR)$(datarootdir)/julia/base $(DESTDIR)$(datarootdir)/julia/test
317-
cp -R -L $(JULIAHOME)/base/* $(DESTDIR)$(datarootdir)/julia/base
318-
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
321+
mkdir -p $(DESTDIR)$(datarootdir)/julia/src $(DESTDIR)$(datarootdir)/julia/test
319322
cp -R -L $(build_datarootdir)/julia/* $(DESTDIR)$(datarootdir)/julia
323+
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
320324
# Copy documentation
321325
cp -R -L $(BUILDROOT)/doc/_build/html $(DESTDIR)$(docdir)/
322326
# Remove various files which should not be installed
@@ -462,7 +466,7 @@ ifneq ($(BUILDROOT),$(JULIAHOME))
462466
$(error make light-source-dist does not work in out-of-tree builds)
463467
endif
464468
# Save git information
465-
-@$(MAKE) -C $(JULIAHOME)/base version_git.jl.phony
469+
-@$(MAKE) -C $(JULIAHOME)/base version_git.jl
466470

467471
# Create file light-source-dist.tmp to hold all the filenames that go into the tarball
468472
echo "base/version_git.jl" > light-source-dist.tmp

NEWS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ New language features
77
* It is now possible to assign to bindings in another module using `setproperty!(::Module, ::Symbol, x)`. ([#44137])
88
* Slurping in assignments is now also allowed in non-final position. This is
99
handled via `Base.split_rest`. ([#42902])
10+
* Character literals now support the same syntax allowed in string literals; i.e. the syntax can
11+
represent invalid UTF-8 sequences as allowed by the `Char` type ([#44989]).
1012

1113
Language changes
1214
----------------
@@ -19,10 +21,24 @@ Language changes
1921
binary minus falls back to addition `-(x, y) = x + (-y)`, and, at the most generic level,
2022
left- and right-division fall back to multiplication with the inverse from left and right,
2123
respectively, as stated in the docstring. ([#44564])
24+
* The `@invoke` macro introduced in 1.7 is now exported. Additionally, it now uses `Core.Typeof(x)`
25+
rather than `Any` when a type annotation is omitted for an argument `x` so that types passed
26+
as arguments are handled correctly. ([#45807])
2227

2328
Compiler/Runtime improvements
2429
-----------------------------
2530

31+
* The known quadratic behavior of type inference is now fixed and inference uses less memory in general.
32+
Certain edge cases with auto-generated long functions (e.g. ModelingToolkit.jl with partial
33+
differential equations and large causal models) should see significant compile-time improvements.
34+
([#45276], [#45404])
35+
* Non-concrete call sites can now be union-split to be inlined or statically-resolved even
36+
if there are multiple dispatch candidates. This may improve runtime performance in certain
37+
situations where object types are not fully known statically but mostly available at runtime
38+
(as like Julia-level type inference implementation itself) by statically resolving
39+
`@nospecialize`-d call sites and avoiding excessive compilation. ([#44512])
40+
* All the previous usages of `@pure`-macro in `Base` has been replaced with the preferred
41+
`Base.@assume_effects`-based annotations. ([#44776])
2642

2743
Command-line option changes
2844
---------------------------
@@ -32,6 +48,9 @@ Command-line option changes
3248
* `--math-mode=fast` is now a no-op ([#41638]). Users are encouraged to use the @fastmath macro instead, which has more well-defined semantics.
3349
* The `--threads` command-line option now accepts `auto|N[,auto|M]` where `M` specifies the
3450
number of interactive threads to create (`auto` currently means 1) ([#42302]).
51+
* New option `--heap-size-hint=<size>` gives a memory hint for triggering greedy garbage
52+
collection. The size might be specified in bytes, kilobytes(1000k), megabytes(300M),
53+
gigabytes(1.5G)
3554

3655
Multi-threading changes
3756
-----------------------
@@ -51,6 +70,8 @@ New library functions
5170
* `Iterators.flatmap` was added ([#44792]).
5271
* New helper `Splat(f)` which acts like `x -> f(x...)`, with pretty printing for
5372
inspecting which function `f` was originally wrapped. ([#42717])
73+
* New `pkgversion(m::Module)` function to get the version of the package that loaded
74+
a given module, similar to `pkgdir(m::Module)`. ([#45607])
5475

5576
Library changes
5677
---------------
@@ -99,8 +120,17 @@ Standard library changes
99120
* `Meta-e` now opens the current input in an editor. The content (if modified) will be
100121
executed upon existing the editor.
101122

123+
* The contextual module which is active at the REPL can be changed (it is `Main` by default),
124+
via the `REPL.activate(::Module)` function or via typing the module in the REPL and pressing
125+
the keybinding Alt-m ([#33872]).
126+
102127
#### SparseArrays
103128

129+
#### Test
130+
* New fail-fast mode for testsets that will terminate the test run early if a failure or error occurs.
131+
Set either via the `@testset` kwarg `failfast=true` or by setting env var `JULIA_TEST_FAILFAST`
132+
to `"true"` i.e. in CI runs to request the job failure be posted eagerly when issues occur ([#45317])
133+
104134
#### Dates
105135

106136
#### Downloads
@@ -143,4 +173,7 @@ External dependencies
143173
Tooling Improvements
144174
---------------------
145175

176+
* Printing of `MethodError` and methods (such as from `methods(my_func)`) are now prettified and color consistent with printing of methods
177+
in stacktraces. ([#45069])
178+
146179
<!--- generated by NEWS-update.jl: -->

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Julia. However, most users should use the [most recent stable version](https://g
9393
of Julia. You can get this version by changing to the Julia directory
9494
and running:
9595

96-
git checkout v1.7.2
96+
git checkout v1.7.3
9797

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

base/.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
/features_h.jl
2-
/pcre_h.jl
3-
/errno_h.jl
4-
/build_h.jl
51
/build_h.jl.phony
6-
/file_constants.jl
7-
/uv_constants.jl
82
/version_git.jl
93
/version_git.jl.phony
104
/userimg.jl

base/Base.jl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,8 @@ using .Iterators: Flatten, Filter, product # for generators
151151
include("namedtuple.jl")
152152

153153
# For OS specific stuff
154-
# We need to strcat things here, before strings are really defined
155-
function strcat(x::String, y::String)
156-
out = ccall(:jl_alloc_string, Ref{String}, (Csize_t,), Core.sizeof(x) + Core.sizeof(y))
157-
GC.@preserve x y out begin
158-
out_ptr = unsafe_convert(Ptr{UInt8}, out)
159-
unsafe_copyto!(out_ptr, unsafe_convert(Ptr{UInt8}, x), Core.sizeof(x))
160-
unsafe_copyto!(out_ptr + Core.sizeof(x), unsafe_convert(Ptr{UInt8}, y), Core.sizeof(y))
161-
end
162-
return out
163-
end
164-
include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "build_h.jl")) # include($BUILDROOT/base/build_h.jl)
165-
include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "version_git.jl")) # include($BUILDROOT/base/version_git.jl)
154+
include("../build_h.jl")
155+
include("../version_git.jl")
166156

167157
# These used to be in build_h.jl and are retained for backwards compatibility
168158
const libblas_name = "libblastrampoline"

base/Enums.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Base.print(io::IO, x::Enum) = print(io, _symbol(x))
3636
function Base.show(io::IO, x::Enum)
3737
sym = _symbol(x)
3838
if !(get(io, :compact, false)::Bool)
39-
from = get(io, :module, Main)
39+
from = get(io, :module, Base.active_module())
4040
def = typeof(x).name.module
4141
if from === nothing || !Base.isvisible(sym, def, from)
4242
show(io, def)
@@ -206,6 +206,9 @@ macro enum(T::Union{Symbol,Expr}, syms...)
206206
Enums.namemap(::Type{$(esc(typename))}) = $(esc(namemap))
207207
Base.typemin(x::Type{$(esc(typename))}) = $(esc(typename))($lo)
208208
Base.typemax(x::Type{$(esc(typename))}) = $(esc(typename))($hi)
209+
let enum_hash = hash($(esc(typename)))
210+
Base.hash(x::$(esc(typename)), h::UInt) = hash(enum_hash, hash(Integer(x), h))
211+
end
209212
let insts = (Any[ $(esc(typename))(v) for v in $values ]...,)
210213
Base.instances(::Type{$(esc(typename))}) = insts
211214
end

0 commit comments

Comments
 (0)