Skip to content

Commit

Permalink
Merge branch 'master' into inline_info2
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick authored Jun 27, 2022
2 parents 784c7d1 + 8ccf2d6 commit 7955e35
Show file tree
Hide file tree
Showing 339 changed files with 9,030 additions and 5,440 deletions.
29 changes: 24 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,12 @@ Add new code to Julia's base libraries as follows (this is the "basic" approach;
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).
Note: You can run specific test files with `make`:
#### Running specific tests
There are `make` targets for running specific tests:
make test-bitarray
or with the `runtests.jl` script, e.g. to run `test/bitarray.jl` and `test/math.jl`:
You can also use the `runtests.jl` script, e.g. to run `test/bitarray.jl` and `test/math.jl`:
./usr/bin/julia test/runtests.jl bitarray math
Expand Down Expand Up @@ -242,12 +243,30 @@ If you need to restart your Julia session, just start at step 2 above.
built and incorporate them automatically. You only need to rebuild
Julia if you made code-changes that Revise cannot handle.

For convenience, there are also `test-revise-*` targets for every `test-*`
target that use Revise to load any modifications to Base into the current
process before running the corresponding test. This can be useful as a shortcut
For convenience, there are also `test-revise-*` targets for every [`test-*`
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
system image before running the corresponding test. This can be useful as a shortcut
on the command line (since tests aren't always designed to be run outside the
runtest harness).

### Contributing to the standard library

The standard library (stdlib) packages are baked into the Julia system image.
When running the ordinary test workflow on the stdlib packages, the system image
version overrides the version you are developing.
To test stdlib packages, you can do the following steps:

1. Edit the UUID field of the `Project.toml` in the stdlib package
2. Change the current directory to the directory of the stdlib you are developing
3. Start julia with `julia --project=.`
4. You can now test the package by running `pkg> test` in Pkg mode.

Because you changed the UUID, the package manager treats the stdlib package as
different from the one in the system image, and the system image version will
not override the package.

Be sure to change the UUID value back before making the pull request.

### Contributing to patch releases

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

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

* `module_parent`, `Base.datatype_module`, and `Base.function_module` have been deprecated
in favor of `parentmodule` ([#TODO]).
in favor of `parentmodule` ([#25629]).

* `rand(t::Tuple{Vararg{Int}})` is deprecated in favor of `rand(Float64, t)` or `rand(t...)`;
`rand(::Tuple)` will have another meaning in the future ([#25429], [#25278]).
Expand Down Expand Up @@ -3664,6 +3666,7 @@ Command-line option changes
[#25571]: https://github.com/JuliaLang/julia/issues/25571
[#25616]: https://github.com/JuliaLang/julia/issues/25616
[#25622]: https://github.com/JuliaLang/julia/issues/25622
[#25629]: https://github.com/JuliaLang/julia/issues/25629
[#25631]: https://github.com/JuliaLang/julia/issues/25631
[#25633]: https://github.com/JuliaLang/julia/issues/25633
[#25634]: https://github.com/JuliaLang/julia/issues/25634
Expand Down
4 changes: 0 additions & 4 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -898,10 +898,6 @@ OPENBLAS_DYNAMIC_ARCH:=0
OPENBLAS_TARGET_ARCH:=ARMV8
USE_BLAS64:=1
BINARY:=64
ifeq ($(OS),Darwin)
# Apple Chips are all at least A12Z
MCPU:=apple-m1
endif
endif

# Set MARCH-specific flags
Expand Down
30 changes: 17 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default: $(JULIA_BUILD_MODE) # contains either "debug" or "release"
all: debug release

# sort is used to remove potential duplicates
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))
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))
ifneq ($(BUILDROOT),$(JULIAHOME))
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src src/flisp src/support src/clangsa cli doc deps stdlib test test/clangsa test/embedding test/llvmpasses)
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) $(BUILDROOT)/sysimage.mk
Expand Down Expand Up @@ -37,13 +37,13 @@ configure:
endif

$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
$(foreach link,base $(JULIAHOME)/test,$(eval $(call symlink_target,$(link),$$(build_datarootdir)/julia,$(notdir $(link)))))
$(eval $(call symlink_target,$(JULIAHOME)/test,$$(build_datarootdir)/julia,test))

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

# Build the HTML docs (skipped if already exists, notably in tarballs)
$(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)
$(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)
@$(MAKE) docs

julia-symlink: julia-cli-$(JULIA_BUILD_MODE)
Expand All @@ -56,7 +56,7 @@ ifndef JULIA_VAGRANT_BUILD
endif
endif

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

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

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

julia-sysimg-release : $(JULIA_SYSIMG_release)
julia-sysimg-debug : $(JULIA_SYSIMG_debug)
julia-base-cache: $(build_datarootdir)/julia/base.cache
julia-debug julia-release : julia-% : julia-sysimg-% julia-src-% julia-symlink julia-libccalltest julia-libllvmcalltest julia-base-cache

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

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

# public libraries, that are installed in $(prefix)/lib
JL_TARGETS := julia
Expand Down Expand Up @@ -192,7 +197,7 @@ else
JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += libz
endif
ifeq ($(USE_LLVM_SHLIB),1)
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-13jl
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-14jl
endif
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBUNWIND) += libunwind

Expand Down Expand Up @@ -313,10 +318,9 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
endif

# Copy in all .jl sources as well
mkdir -p $(DESTDIR)$(datarootdir)/julia/base $(DESTDIR)$(datarootdir)/julia/test
cp -R -L $(JULIAHOME)/base/* $(DESTDIR)$(datarootdir)/julia/base
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
mkdir -p $(DESTDIR)$(datarootdir)/julia/src $(DESTDIR)$(datarootdir)/julia/test
cp -R -L $(build_datarootdir)/julia/* $(DESTDIR)$(datarootdir)/julia
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
# Copy documentation
cp -R -L $(BUILDROOT)/doc/_build/html $(DESTDIR)$(docdir)/
# Remove various files which should not be installed
Expand Down Expand Up @@ -462,7 +466,7 @@ ifneq ($(BUILDROOT),$(JULIAHOME))
$(error make light-source-dist does not work in out-of-tree builds)
endif
# Save git information
-@$(MAKE) -C $(JULIAHOME)/base version_git.jl.phony
-@$(MAKE) -C $(JULIAHOME)/base version_git.jl

# Create file light-source-dist.tmp to hold all the filenames that go into the tarball
echo "base/version_git.jl" > light-source-dist.tmp
Expand Down
33 changes: 33 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ New language features
* It is now possible to assign to bindings in another module using `setproperty!(::Module, ::Symbol, x)`. ([#44137])
* Slurping in assignments is now also allowed in non-final position. This is
handled via `Base.split_rest`. ([#42902])
* Character literals now support the same syntax allowed in string literals; i.e. the syntax can
represent invalid UTF-8 sequences as allowed by the `Char` type ([#44989]).

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

Compiler/Runtime improvements
-----------------------------

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

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

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

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

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

#### SparseArrays

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

#### Dates

#### Downloads
Expand Down Expand Up @@ -143,4 +173,7 @@ External dependencies
Tooling Improvements
---------------------

* Printing of `MethodError` and methods (such as from `methods(my_func)`) are now prettified and color consistent with printing of methods
in stacktraces. ([#45069])

<!--- generated by NEWS-update.jl: -->
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Julia. However, most users should use the [most recent stable version](https://g
of Julia. You can get this version by changing to the Julia directory
and running:

git checkout v1.7.2
git checkout v1.7.3

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

Expand Down
6 changes: 0 additions & 6 deletions base/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
/features_h.jl
/pcre_h.jl
/errno_h.jl
/build_h.jl
/build_h.jl.phony
/file_constants.jl
/uv_constants.jl
/version_git.jl
/version_git.jl.phony
/userimg.jl
14 changes: 2 additions & 12 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,8 @@ using .Iterators: Flatten, Filter, product # for generators
include("namedtuple.jl")

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

# These used to be in build_h.jl and are retained for backwards compatibility
const libblas_name = "libblastrampoline"
Expand Down
5 changes: 4 additions & 1 deletion base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Base.print(io::IO, x::Enum) = print(io, _symbol(x))
function Base.show(io::IO, x::Enum)
sym = _symbol(x)
if !(get(io, :compact, false)::Bool)
from = get(io, :module, Main)
from = get(io, :module, Base.active_module())
def = typeof(x).name.module
if from === nothing || !Base.isvisible(sym, def, from)
show(io, def)
Expand Down Expand Up @@ -206,6 +206,9 @@ macro enum(T::Union{Symbol,Expr}, syms...)
Enums.namemap(::Type{$(esc(typename))}) = $(esc(namemap))
Base.typemin(x::Type{$(esc(typename))}) = $(esc(typename))($lo)
Base.typemax(x::Type{$(esc(typename))}) = $(esc(typename))($hi)
let enum_hash = hash($(esc(typename)))
Base.hash(x::$(esc(typename)), h::UInt) = hash(enum_hash, hash(Integer(x), h))
end
let insts = (Any[ $(esc(typename))(v) for v in $values ]...,)
Base.instances(::Type{$(esc(typename))}) = insts
end
Expand Down
Loading

0 comments on commit 7955e35

Please sign in to comment.