Skip to content

Commit

Permalink
Merge branch 'master' into filter
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott authored Oct 25, 2019
2 parents 6c8dc2e + f806717 commit f9fe412
Show file tree
Hide file tree
Showing 360 changed files with 4,574 additions and 2,571 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# treat patches as files that should not be modified
*.patch -text
# treat all files as files that should not be modified
* -text
23 changes: 0 additions & 23 deletions .github/CODE_OF_CONDUCT.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

15 changes: 0 additions & 15 deletions .github/SECURITY.md

This file was deleted.

12 changes: 0 additions & 12 deletions .github/SUPPORT.md

This file was deleted.

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

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

Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBSSH2) += libssh2
JL_PRIVATE_LIBS-$(USE_SYSTEM_MBEDTLS) += libmbedtls libmbedcrypto libmbedx509
JL_PRIVATE_LIBS-$(USE_SYSTEM_CURL) += libcurl
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBGIT2) += libgit2
ifeq ($(OS),WINNT)
JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += zlib
else
JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += libz
endif
ifeq ($(USE_LLVM_SHLIB),1)
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-6
endif
Expand Down Expand Up @@ -286,16 +291,16 @@ endif
ifeq ($(OS),WINNT)
-$(INSTALL_M) $(filter-out $(build_bindir)/libjulia-debug.dll,$(wildcard $(build_bindir)/*.dll)) $(DESTDIR)$(bindir)/
-$(INSTALL_M) $(build_libdir)/libjulia.dll.a $(DESTDIR)$(libdir)/

# We have a single exception; we want 7z.dll to live in libexec, not bin, so that 7z.exe can find it.
-mv $(DESTDIR)$(bindir)/7z.dll $(DESTDIR)$(libexecdir)/
ifeq ($(BUNDLE_DEBUG_LIBS),1)
-$(INSTALL_M) $(build_bindir)/libjulia-debug.dll $(DESTDIR)$(bindir)/
-$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/
endif
-$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/
else

# Install `7z` into libexec/
$(INSTALL_M) $(build_bindir)/7z $(DESTDIR)$(libexecdir)/

# Copy over .dSYM directories directly for Darwin
ifneq ($(DARWIN_FRAMEWORK),1)
ifeq ($(OS),Darwin)
Expand Down Expand Up @@ -325,6 +330,7 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/sys-debug.dylib.dSYM $(build_private_libdir)/sys-debug.dylib
endif
endif

for suffix in $(JL_PRIVATE_LIBS-0) ; do \
for lib in $(build_libdir)/$${suffix}.*$(SHLIB_EXT)*; do \
if [ "$${lib##*.}" != "dSYM" ]; then \
Expand All @@ -337,6 +343,8 @@ endif
$(INSTALL_M) $$lib $(DESTDIR)$(private_libdir) ; \
done
endif
# Install `7z` into libexec/
$(INSTALL_M) $(build_bindir)/7z$(EXE) $(DESTDIR)$(libexecdir)/

# Copy public headers
cp -R -L $(build_includedir)/julia/* $(DESTDIR)$(includedir)/julia
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ New language features

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

* Function composition now supports multiple functions: `∘(f, g, h) = f ∘ g ∘ h`
and splatting `∘(fs...)` for composing an iterable collection of functions ([#33568]).

Language changes
----------------

* Calling `show` or `repr` on an `undef`/`UndefInitializer()` array initializer now shows valid Julia code ([#33211]).

* Calling `show` or `repr` on a 0-dimensional `AbstractArray` now shows valid code for creating an equivalent 0-dimensional array, instead of only showing the contained value. ([#33206])

Multi-threading changes
-----------------------

Expand All @@ -28,7 +33,9 @@ New library functions
* 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]).
* 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]).
* 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]).
* `readdir` output is now guaranteed to be sorted. The `sort` keyword allows opting out of sorting to get names in OS-native order ([#33542]).
* 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])
* `takewhile` and `dropwhile` have been added to the Iterators submodule ([#33437]).
* `filter` can now act on a `Tuple` ([#32968]).

Standard library changes
Expand All @@ -38,6 +45,7 @@ Standard library changes
* `div` now accepts a rounding mode as the third argument, consistent with the corresponding argument to `rem`. Support for rounding division, by passing one of the RoundNearest modes to this function, was added. For future compatibility, library authors should now extend this function, rather than extending the two-argument `fld`/`cld`/`div` directly. ([#33040])
* Verbose `display` of `Char` (`text/plain` output) now shows the codepoint value in standard-conforming `"U+XXXX"` format ([#33291]).


#### Libdl

#### LinearAlgebra
Expand All @@ -46,6 +54,10 @@ Standard library changes

* `dot` now admits a 3-argument method `dot(x, A, y)` to compute generalized dot products `dot(x, A*y)`, but without computing and storing the intermediate result `A*y` ([#32739]).

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

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

#### Random

* `AbstractRNG`s now behave like scalars when used in broadcasting ([#33213]).
Expand Down
2 changes: 1 addition & 1 deletion base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ macro enum(T, 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 insts = ntuple(i->$(esc(typename))($values[i]), $(length(values)))
let insts = (Any[ $(esc(typename))(v) for v in $values ]...,)
Base.instances(::Type{$(esc(typename))}) = insts
end
end
Expand Down
10 changes: 5 additions & 5 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1190,13 +1190,13 @@ mightalias(A::AbstractArray, B::AbstractArray) = !isbits(A) && !isbits(B) && !_i
mightalias(x, y) = false

_isdisjoint(as::Tuple{}, bs::Tuple{}) = true
_isdisjoint(as::Tuple{}, bs::Tuple{Any}) = true
_isdisjoint(as::Tuple{}, bs::Tuple{UInt}) = true
_isdisjoint(as::Tuple{}, bs::Tuple) = true
_isdisjoint(as::Tuple{Any}, bs::Tuple{}) = true
_isdisjoint(as::Tuple{Any}, bs::Tuple{Any}) = as[1] != bs[1]
_isdisjoint(as::Tuple{Any}, bs::Tuple) = !(as[1] in bs)
_isdisjoint(as::Tuple{UInt}, bs::Tuple{}) = true
_isdisjoint(as::Tuple{UInt}, bs::Tuple{UInt}) = as[1] != bs[1]
_isdisjoint(as::Tuple{UInt}, bs::Tuple) = !(as[1] in bs)
_isdisjoint(as::Tuple, bs::Tuple{}) = true
_isdisjoint(as::Tuple, bs::Tuple{Any}) = !(bs[1] in as)
_isdisjoint(as::Tuple, bs::Tuple{UInt}) = !(bs[1] in as)
_isdisjoint(as::Tuple, bs::Tuple) = !(as[1] in bs) && _isdisjoint(tail(as), bs)

"""
Expand Down
2 changes: 1 addition & 1 deletion base/abstractarraymath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ julia> selectdim(A, 2, 3)
7
```
"""
@inline selectdim(A::AbstractArray, d::Integer, i) = _selectdim(A, d, i, setindex(map(Slice, axes(A)), i, d))
@inline selectdim(A::AbstractArray, d::Integer, i) = _selectdim(A, d, i, _setindex(i, d, map(Slice, axes(A))...))
@noinline function _selectdim(A, d, i, idxs)
d >= 1 || throw(ArgumentError("dimension must be ≥ 1, got $d"))
nd = ndims(A)
Expand Down
6 changes: 4 additions & 2 deletions base/abstractdict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ function keys end
Return an iterator over all keys in a dictionary.
`collect(keys(a))` returns an array of keys.
Since the keys are stored internally in a hash table,
When the keys are stored internally in a hash table,
as is the case for `Dict`,
the order in which they are returned may vary.
But `keys(a)` and `values(a)` both iterate `a` and
return the elements in the same order.
Expand All @@ -102,7 +103,8 @@ keys(a::AbstractDict) = KeySet(a)
Return an iterator over all values in a collection.
`collect(values(a))` returns an array of values.
Since the values are stored internally in a hash table,
When the values are stored internally in a hash table,
as is the case for `Dict`,
the order in which they are returned may vary.
But `keys(a)` and `values(a)` both iterate `a` and
return the elements in the same order.
Expand Down
12 changes: 4 additions & 8 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function bitsunionsize(u::Union)
end

length(a::Array) = arraylen(a)
elsize(::Type{<:Array{T}}) where {T} = isbitsunion(T) ? bitsunionsize(T) : (allocatedinline(T) ? sizeof(T) : sizeof(Ptr))
elsize(::Type{<:Array{T}}) where {T} = aligned_sizeof(T)
sizeof(a::Array) = Core.sizeof(a)

function isassigned(a::Array, i::Int...)
Expand All @@ -238,7 +238,7 @@ function unsafe_copyto!(dest::Ptr{T}, src::Ptr{T}, n) where T
# Do not use this to copy data between pointer arrays.
# It can't be made safe no matter how carefully you checked.
ccall(:memmove, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt),
dest, src, n*sizeof(T))
dest, src, n * aligned_sizeof(T))
return dest
end

Expand All @@ -257,7 +257,7 @@ function unsafe_copyto!(dest::Array{T}, doffs, src::Array{T}, soffs, n) where T
t2 = @_gc_preserve_begin src
if isbitsunion(T)
ccall(:memmove, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt),
pointer(dest, doffs), pointer(src, soffs), n * Base.bitsunionsize(T))
pointer(dest, doffs), pointer(src, soffs), n * aligned_sizeof(T))
# copy selector bytes
ccall(:memmove, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt),
ccall(:jl_array_typetagdata, Ptr{UInt8}, (Any,), dest) + doffs - 1,
Expand Down Expand Up @@ -1565,13 +1565,9 @@ function vcat(arrays::Vector{T}...) where T
arr = Vector{T}(undef, n)
ptr = pointer(arr)
if isbitsunion(T)
elsz = bitsunionsize(T)
selptr = ccall(:jl_array_typetagdata, Ptr{UInt8}, (Any,), arr)
elseif allocatedinline(T)
elsz = Core.sizeof(T)
else
elsz = Core.sizeof(Ptr{Cvoid})
end
elsz = aligned_sizeof(T)
t = @_gc_preserve_begin arr
for a in arrays
na = length(a)
Expand Down
26 changes: 19 additions & 7 deletions base/arrayshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,12 @@ end

# print_array: main helper functions for show(io, text/plain, array)
# typeinfo agnostic

# 0-dimensional arrays
print_array(io::IO, X::AbstractArray{T,0} where T) =
isassigned(X) ? show(io, X[]) :
print(io, undef_ref_str)

# Note that this is for showing the content inside the array, and for `MIME"text/plain".
# There are `show(::IO, ::A) where A<:AbstractArray` methods that don't use this
# e.g. show_vector, show_zero_dim
print_array(io::IO, X::AbstractArray{<:Any, 0}) =
isassigned(X) ? show(io, X[]) : print(io, undef_ref_str)
print_array(io::IO, X::AbstractVecOrMat) = print_matrix(io, X)

print_array(io::IO, X::AbstractArray) = show_nd(io, X, print_matrix, true)

# typeinfo aware
Expand Down Expand Up @@ -418,6 +416,7 @@ _show_empty(io, X) = nothing # by default, we don't know this constructor

# typeinfo aware (necessarily)
function show(io::IO, X::AbstractArray)
ndims(X) == 0 && return show_zero_dim(io, X)
ndims(X) == 1 && return show_vector(io, X)
prefix = typeinfo_prefix(io, X)
io = IOContext(io, :typeinfo => eltype(X))
Expand All @@ -426,6 +425,19 @@ function show(io::IO, X::AbstractArray)
_show_nonempty(io, X, prefix)
end

### 0-dimensional arrays (#31481)
show_zero_dim(io::IO, X::BitArray{0}) = print(io, "BitArray(", Int(X[]), ")")
function show_zero_dim(io::IO, X::AbstractArray{T, 0}) where T
if isassigned(X)
print(io, "fill(")
show(io, X[])
else
print(io, "Array{$T,0}(")
show(io, undef)
end
print(io, ")")
end

### Vector arrays

# typeinfo aware
Expand Down
1 change: 1 addition & 0 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ else
const UInt = UInt32
end

function iterate end
function Typeof end
ccall(:jl_toplevel_eval_in, Any, (Any, Any),
Core, quote
Expand Down
3 changes: 2 additions & 1 deletion base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ Base.@propagate_inbounds _newindex(ax::Tuple{}, I::Tuple{}) = ()
@inline function _newindexer(indsA::Tuple)
ind1 = indsA[1]
keep, Idefault = _newindexer(tail(indsA))
(Base.length(ind1)!=1, keep...), (first(ind1), Idefault...)
(Base.length(ind1)::Integer != 1, keep...), (first(ind1), Idefault...)
end

@inline function Base.getindex(bc::Broadcasted, I::Union{Integer,CartesianIndex})
Expand Down Expand Up @@ -916,6 +916,7 @@ end
@inline function copyto!(dest::BitArray, bc::Broadcasted{Nothing})
axes(dest) == axes(bc) || throwdm(axes(dest), axes(bc))
ischunkedbroadcast(dest, bc) && return chunkedcopyto!(dest, bc)
length(dest) < 256 && return invoke(copyto!, Tuple{AbstractArray, Broadcasted{Nothing}}, dest, bc)
tmp = Vector{Bool}(undef, bitcache_size)
destc = dest.chunks
ind = cind = 1
Expand Down
3 changes: 1 addition & 2 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ end

# deprecated function--preserved for DocTests.jl
function ip_matches_func(ip, func::Symbol)
ip isa InterpreterIP || (ip -= 1)
for fr in StackTraces.lookupat(ip)
for fr in StackTraces.lookup(ip)
if fr === StackTraces.UNKNOWN || fr.from_c
return false
end
Expand Down
2 changes: 2 additions & 0 deletions base/cmd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ shell_escape(cmd::Cmd; special::AbstractString="") =
shell_escape(cmd.exec..., special=special)
shell_escape_posixly(cmd::Cmd) =
shell_escape_posixly(cmd.exec...)
shell_escape_winsomely(cmd::Cmd) =
shell_escape_winsomely(cmd.exec...)

function show(io::IO, cmd::Cmd)
print_env = cmd.env !== nothing
Expand Down
Loading

0 comments on commit f9fe412

Please sign in to comment.