Skip to content

Commit d0b1c04

Browse files
committed
Merge remote-tracking branch 'origin/master' into filterxf
2 parents dfcd792 + 84e8392 commit d0b1c04

File tree

503 files changed

+7175
-5585
lines changed

Some content is hidden

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

503 files changed

+7175
-5585
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# treat patches as files that should not be modified
2-
*.patch -text
1+
# treat all files as files that should not be modified
2+
* -text

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,12 @@ If you need to restart your Julia session, just start at step 2 above.
264264
built and incorporate them automatically. You only need to rebuild
265265
Julia if you made code-changes that Revise cannot handle.
266266

267+
For convenience, there are also `test-revise-*` targets for every `test-*`
268+
target that use Revise to load any modifications to Base into the current
269+
process before running the corresponding test. This can be useful as a shortcut
270+
on the command line (since tests aren't always designed to be run outside the
271+
runtest harness).
272+
267273
### Code Formatting Guidelines
268274

269275
#### General Formatting Guidelines for Julia code contributions

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ New library functions
4646
Standard library changes
4747
------------------------
4848

49+
* `Pkg` won't clobber pre-compilation files as often when switching environments ([#32651])
4950
* `Pkg` can now download and install binary artifacts through the `Pkg.Artifacts`
5051
submodule and supporting functions. ([#32918])
5152
* When `wait` (or `@sync`, or `fetch`) is called on a failing `Task`, the exception is propagated as a

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Julia includes code from the following projects, which have their own licenses:
3535
- [MUSL](https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT) (for getopt implementation on Windows) [MIT]
3636
- [MINGW](https://sourceforge.net/p/mingw/mingw-org-wsl/ci/legacy/tree/mingwrt/mingwex/dirname.c) (for dirname implementation on Windows) [MIT]
3737
- [NetBSD](https://www.netbsd.org/about/redistribution.html) (for setjmp, longjmp, and strptime implementations on Windows) [BSD-3]
38-
- [Python](https://docs.python.org/2/license.html) (for strtod implementation on Windows) [BSD-3, effectively]
38+
- [Python](https://docs.python.org/2/license.html) (for strtod and joinpath implementation on Windows) [BSD-3, effectively]
3939

4040
The following components included in Julia `Base` have their own separate licenses:
4141

Make.inc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ libdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(libdir))
283283
build_private_libdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(build_bindir) $(build_private_libdir))
284284
private_libdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(private_libdir))
285285
datarootdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(datarootdir))
286+
libexecdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(libexecdir))
286287
docdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(docdir))
287288
sysconfdir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(sysconfdir))
288289
includedir_rel := $(shell $(JULIAHOME)/contrib/relative_path.sh $(bindir) $(includedir))
@@ -928,6 +929,20 @@ else
928929
PCRE_CONFIG := $(build_depsbindir)/pcre2-config
929930
endif
930931

932+
ifeq ($(USE_SYSTEM_PATCHELF), 1)
933+
PATCHELF := patchelf
934+
else
935+
PATCHELF := $(build_depsbindir)/patchelf
936+
endif
937+
938+
# On aarch64 and powerpc64le, we assume the page size is 64K. Our binutils linkers
939+
# and such already assume this, but `patchelf` seems to be behind the times. We
940+
# explicitly tell it to use this large page size so that when we rewrite rpaths and
941+
# such, we don't accidentally create incorrectly-aligned sections in our ELF files.
942+
ifneq (,$(filter $(ARCH),aarch64 powerpc64le))
943+
PATCHELF += --page-size=65536
944+
endif
945+
931946
# Use ILP64 BLAS interface when building openblas from source on 64-bit architectures
932947
ifeq ($(BINARY), 64)
933948
ifeq ($(USE_SYSTEM_BLAS), 1)
@@ -1246,7 +1261,7 @@ ifeq ($(USECLANG),1)
12461261
CXXLDFLAGS += -stdlib=libc++
12471262
else
12481263
ifeq ($(USEGCC),1)
1249-
$(error BUILD_CUSTOM_LIBCXX is currently only supported with Clang. Try setting BUILD_CUSTOM_LIBCXX=0)
1264+
$(error BUILD_CUSTOM_LIBCXX is currently only supported with Clang. Try setting BUILD_CUSTOM_LIBCXX=0 or USECLANG=1)
12501265
endif
12511266
endif # Clang
12521267
CUSTOM_LD_LIBRARY_PATH := LD_LIBRARY_PATH="$(build_libdir)"

Makefile

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ else
176176
JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += libz
177177
endif
178178
ifeq ($(USE_LLVM_SHLIB),1)
179-
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-6
179+
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-8
180180
endif
181181

182182
ifeq ($(USE_SYSTEM_LIBM),0)
@@ -269,7 +269,7 @@ endef
269269
ifeq (,$(findstring $(OS),FreeBSD WINNT))
270270
julia-base: $(build_libdir)/libgfortran*.$(SHLIB_EXT)*
271271
$(build_libdir)/libgfortran*.$(SHLIB_EXT)*: | $(build_libdir) julia-deps
272-
-$(CUSTOM_LD_LIBRARY_PATH) PATH="$(PATH):$(build_depsbindir)" $(JULIAHOME)/contrib/fixup-libgfortran.sh --verbose $(build_libdir)
272+
-$(CUSTOM_LD_LIBRARY_PATH) PATH="$(PATH):$(build_depsbindir)" PATCHELF="$(PATCHELF)" $(JULIAHOME)/contrib/fixup-libgfortran.sh --verbose $(build_libdir)
273273
JL_PRIVATE_LIBS-0 += libgfortran libgcc_s libquadmath
274274
endif
275275

@@ -291,16 +291,16 @@ endif
291291
ifeq ($(OS),WINNT)
292292
-$(INSTALL_M) $(filter-out $(build_bindir)/libjulia-debug.dll,$(wildcard $(build_bindir)/*.dll)) $(DESTDIR)$(bindir)/
293293
-$(INSTALL_M) $(build_libdir)/libjulia.dll.a $(DESTDIR)$(libdir)/
294+
295+
# We have a single exception; we want 7z.dll to live in libexec, not bin, so that 7z.exe can find it.
296+
-mv $(DESTDIR)$(bindir)/7z.dll $(DESTDIR)$(libexecdir)/
294297
ifeq ($(BUNDLE_DEBUG_LIBS),1)
295298
-$(INSTALL_M) $(build_bindir)/libjulia-debug.dll $(DESTDIR)$(bindir)/
296299
-$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/
297300
endif
298301
-$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/
299302
else
300303

301-
# Install `7z` into libexec/
302-
$(INSTALL_M) $(build_bindir)/7z$(EXE) $(DESTDIR)$(libexecdir)/
303-
304304
# Copy over .dSYM directories directly for Darwin
305305
ifneq ($(DARWIN_FRAMEWORK),1)
306306
ifeq ($(OS),Darwin)
@@ -330,6 +330,7 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
330330
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/sys-debug.dylib.dSYM $(build_private_libdir)/sys-debug.dylib
331331
endif
332332
endif
333+
333334
for suffix in $(JL_PRIVATE_LIBS-0) ; do \
334335
for lib in $(build_libdir)/$${suffix}.*$(SHLIB_EXT)*; do \
335336
if [ "$${lib##*.}" != "dSYM" ]; then \
@@ -342,6 +343,8 @@ endif
342343
$(INSTALL_M) $$lib $(DESTDIR)$(private_libdir) ; \
343344
done
344345
endif
346+
# Install `7z` into libexec/
347+
$(INSTALL_M) $(build_bindir)/7z$(EXE) $(DESTDIR)$(libexecdir)/
345348

346349
# Copy public headers
347350
cp -R -L $(build_includedir)/julia/* $(DESTDIR)$(includedir)/julia
@@ -389,35 +392,35 @@ ifneq ($(DARWIN_FRAMEWORK),1)
389392
endif
390393
else ifneq (,$(findstring $(OS),Linux FreeBSD))
391394
for j in $(JL_TARGETS) ; do \
392-
patchelf --set-rpath '$$ORIGIN/$(private_libdir_rel):$$ORIGIN/$(libdir_rel)' $(DESTDIR)$(bindir)/$$j; \
395+
$(PATCHELF) --set-rpath '$$ORIGIN/$(private_libdir_rel):$$ORIGIN/$(libdir_rel)' $(DESTDIR)$(bindir)/$$j; \
393396
done
394397
endif
395398

396399
# Overwrite JL_SYSTEM_IMAGE_PATH in julia library
397-
if [ $(DARWIN_FRAMEWORK) == 0 ]; then \
400+
if [ $(DARWIN_FRAMEWORK) = 0 ]; then \
398401
RELEASE_TARGET=$(DESTDIR)$(libdir)/libjulia.$(SHLIB_EXT); \
399402
DEBUG_TARGET=$(DESTDIR)$(libdir)/libjulia-debug.$(SHLIB_EXT); \
400403
else \
401404
RELEASE_TARGET=$(DESTDIR)$(prefix)/$(framework_dylib); \
402405
DEBUG_TARGET=$(DESTDIR)$(prefix)/$(framework_dylib)_debug; \
403406
fi; \
404407
$(call stringreplace,$${RELEASE_TARGET},sys.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys.$(SHLIB_EXT)); \
405-
if [ $(BUNDLE_DEBUG_LIBS) == 1 ]; then \
408+
if [ $(BUNDLE_DEBUG_LIBS) = 1 ]; then \
406409
$(call stringreplace,$${DEBUG_TARGET},sys-debug.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys-debug.$(SHLIB_EXT)); \
407410
fi;
408411

409412
endif
410413
# On FreeBSD, remove the build's libdir from each library's RPATH
411414
ifeq ($(OS),FreeBSD)
412-
$(JULIAHOME)/contrib/fixup-rpath.sh $(build_depsbindir)/patchelf $(DESTDIR)$(libdir) $(build_libdir)
413-
$(JULIAHOME)/contrib/fixup-rpath.sh $(build_depsbindir)/patchelf $(DESTDIR)$(private_libdir) $(build_libdir)
414-
$(JULIAHOME)/contrib/fixup-rpath.sh $(build_depsbindir)/patchelf $(DESTDIR)$(bindir) $(build_libdir)
415+
$(JULIAHOME)/contrib/fixup-rpath.sh "$(PATCHELF)" $(DESTDIR)$(libdir) $(build_libdir)
416+
$(JULIAHOME)/contrib/fixup-rpath.sh "$(PATCHELF)" $(DESTDIR)$(private_libdir) $(build_libdir)
417+
$(JULIAHOME)/contrib/fixup-rpath.sh "$(PATCHELF)" $(DESTDIR)$(bindir) $(build_libdir)
415418
# Set libgfortran's RPATH to ORIGIN instead of GCCPATH. It's only libgfortran that
416419
# needs to be fixed here, as libgcc_s and libquadmath don't have RPATHs set. If we
417420
# don't set libgfortran's RPATH, it won't be able to find its friends on systems
418421
# that don't have the exact GCC port installed used for the build.
419422
for lib in $(DESTDIR)$(private_libdir)/libgfortran*$(SHLIB_EXT)*; do \
420-
$(build_depsbindir)/patchelf --set-rpath '$$ORIGIN' $$lib; \
423+
$(PATCHELF) --set-rpath '$$ORIGIN' $$lib; \
421424
done
422425
endif
423426

@@ -557,7 +560,8 @@ distcleanall: cleanall
557560
julia-debug julia-release julia-stdlib julia-deps julia-deps-libs \
558561
julia-ui-release julia-ui-debug julia-src-release julia-src-debug \
559562
julia-symlink julia-base julia-sysimg julia-sysimg-ji julia-sysimg-release julia-sysimg-debug \
560-
test testall testall1 test clean distcleanall cleanall clean-* \
563+
test testall testall1 test test-* test-revise-* \
564+
clean distcleanall cleanall clean-* \
561565
run-julia run-julia-debug run-julia-release run \
562566
install binary-dist light-source-dist.tmp light-source-dist \
563567
dist full-source-dist source-dist
@@ -577,8 +581,13 @@ testall1: check-whitespace $(JULIA_BUILD_MODE)
577581
@env JULIA_CPU_THREADS=1 $(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test all JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)
578582

579583
test-%: check-whitespace $(JULIA_BUILD_MODE)
584+
@([ $$(( $$(date +%s) - $$(date +%s -r $(build_private_libdir)/sys.$(SHLIB_EXT)) )) -le 100 ] && \
585+
printf '\033[93m HINT The system image was recently rebuilt. Are you aware of the test-revise-* targets? See CONTRIBUTING.md. \033[0m\n') || true
580586
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test $* JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)
581587

588+
test-revise-%:
589+
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/test revise-$* JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)
590+
582591
# download target for some hardcoded windows dependencies
583592
.PHONY: win-extras wine_path
584593
win-extras:
@@ -596,11 +605,11 @@ else
596605
LLVM_SIZE := $(build_depsbindir)/llvm-size$(EXE)
597606
endif
598607
build-stats:
599-
@echo $(JULCOLOR)' ==> ./julia binary sizes'$(ENDCOLOR)
608+
@printf $(JULCOLOR)' ==> ./julia binary sizes\n'$(ENDCOLOR)
600609
$(call spawn,$(LLVM_SIZE) -A $(call cygpath_w,$(build_private_libdir)/sys.$(SHLIB_EXT)) \
601610
$(call cygpath_w,$(build_shlibdir)/libjulia.$(SHLIB_EXT)) \
602611
$(call cygpath_w,$(build_bindir)/julia$(EXE)))
603-
@echo $(JULCOLOR)' ==> ./julia launch speedtest'$(ENDCOLOR)
612+
@printf $(JULCOLOR)' ==> ./julia launch speedtest\n'$(ENDCOLOR)
604613
@time $(call spawn,$(build_bindir)/julia$(EXE) -e '')
605614
@time $(call spawn,$(build_bindir)/julia$(EXE) -e '')
606615
@time $(call spawn,$(build_bindir)/julia$(EXE) -e '')

NEWS.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ New language features
88

99
* `import` now allows quoted symbols, e.g. `import Base.:+` ([#33158]).
1010

11+
* Function composition now supports multiple functions: `∘(f, g, h) = f ∘ g ∘ h`
12+
and splatting `∘(fs...)` for composing an iterable collection of functions ([#33568]).
13+
1114
Language changes
1215
----------------
1316

@@ -30,9 +33,10 @@ New library functions
3033
* The `tempname` function now takes an optional `parent::AbstractString` argument to give it a directory in which to attempt to produce a temporary path name ([#33090]).
3134
* The `tempname` function now takes a `cleanup::Bool` keyword argument defaulting to `true`, which causes the process to try to ensure that any file or directory at the path returned by `tempname` is deleted upon process exit ([#33090]).
3235
* The `readdir` function now takes a `join::Bool` keyword argument defaulting to `false`, which when set causes `readdir` to join its directory argument with each listed name ([#33113]).
36+
* `readdir` output is now guaranteed to be sorted. The `sort` keyword allows opting out of sorting to get names in OS-native order ([#33542]).
3337
* The new `only(x)` function returns the one-and-only element of a collection `x`, and throws an `ArgumentError` if `x` contains zero or multiple elements. ([#33129])
3438
* `takewhile` and `dropwhile` have been added to the Iterators submodule ([#33437]).
35-
39+
* There is a now an `evalpoly` (generated) function meant to take the role of the `@evalpoly` macro. The function is just as efficient as the macro while giving added flexibility, so it should be preferred over `@evalpoly`. `evalpoly` takes a list of coefficients as a tuple, so where one might write `@evalpoly(x, p1, p2, p3)` one would instead write `evalpoly(x, (p1, p2, p3))`.
3640

3741
Standard library changes
3842
------------------------
@@ -43,6 +47,10 @@ Standard library changes
4347

4448
* Verbose `display` of `Char` (`text/plain` output) now shows the codepoint value in standard-conforming `"U+XXXX"` format ([#33291]).
4549

50+
* `Iterators.partition` now uses views (or smartly re-computed ranges) for partitions of all `AbstractArray`s ([#33533]).
51+
52+
* Sets are now displayed less compactly in the REPL, as a column of elements, like vectors
53+
and dictionaries ([#33300]).
4654

4755
#### Libdl
4856

@@ -54,6 +62,8 @@ Standard library changes
5462

5563
* `ldlt` and non-pivoted `lu` now throw a new `ZeroPivotException` type ([#33372]).
5664

65+
* `cond(A, p)` with `p=1` or `p=Inf` now computes the exact condition number instead of an estimate ([#33547]).
66+
5767
#### Random
5868

5969
* `AbstractRNG`s now behave like scalars when used in broadcasting ([#33213]).
@@ -63,6 +73,11 @@ Standard library changes
6373
* The performance of `rand(::Tuple)` is improved in some cases ([#32208]). As a consequence, the
6474
stream of generated values produced for a given seed has changed.
6575

76+
#### REPL
77+
78+
* The attributes of the implicit `IOContext` used by the REPL to display objects can be
79+
modified by the user (experimental feature) ([#29249]).
80+
6681
#### SparseArrays
6782

6883
#### Dates

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Julia. However, most users should use the most recent stable version
8484
of Julia. You can get this version by changing to the Julia directory
8585
and running:
8686

87-
git checkout v1.2.0
87+
git checkout v1.3.0
8888

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

base/Base.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ setproperty!(x::Type, f::Symbol, v) = setfield!(x, f, v)
3030
getproperty(x::Tuple, f::Int) = getfield(x, f)
3131
setproperty!(x::Tuple, f::Int, v) = setfield!(x, f, v) # to get a decent error
3232

33-
getproperty(Core.@nospecialize(x), f::Symbol) = getfield(x, f)
33+
getproperty(x, f::Symbol) = getfield(x, f)
3434
setproperty!(x, f::Symbol, v) = setfield!(x, f, convert(fieldtype(typeof(x), f), v))
3535

3636
include("coreio.jl")

base/Enums.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ macro enum(T, syms...)
121121
end
122122
basetype = Int32
123123
typename = T
124-
if isa(T, Expr) && T.head == :(::) && length(T.args) == 2 && isa(T.args[1], Symbol)
124+
if isa(T, Expr) && T.head === :(::) && length(T.args) == 2 && isa(T.args[1], Symbol)
125125
typename = T.args[1]
126126
basetype = Core.eval(__module__, T.args[2])
127127
if !isa(basetype, DataType) || !(basetype <: Integer) || !isbitstype(basetype)
@@ -137,7 +137,7 @@ macro enum(T, syms...)
137137
i = zero(basetype)
138138
hasexpr = false
139139

140-
if length(syms) == 1 && syms[1] isa Expr && syms[1].head == :block
140+
if length(syms) == 1 && syms[1] isa Expr && syms[1].head === :block
141141
syms = syms[1].args
142142
end
143143
for s in syms
@@ -147,7 +147,7 @@ macro enum(T, syms...)
147147
throw(ArgumentError("overflow in value \"$s\" of Enum $typename"))
148148
end
149149
elseif isa(s, Expr) &&
150-
(s.head == :(=) || s.head == :kw) &&
150+
(s.head === :(=) || s.head === :kw) &&
151151
length(s.args) == 2 && isa(s.args[1], Symbol)
152152
i = Core.eval(__module__, s.args[2]) # allow exprs, e.g. uint128"1"
153153
if !isa(i, Integer)

0 commit comments

Comments
 (0)