Skip to content

Commit

Permalink
Merge branch 'master' into ifelseboolassert
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod authored Aug 16, 2022
2 parents e87e072 + ec98087 commit 3307d66
Show file tree
Hide file tree
Showing 35 changed files with 229 additions and 89 deletions.
61 changes: 31 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,17 @@ $(build_datarootdir)/julia/base.cache: $(JULIA_SYSIMG) | $(DIRS) $(build_dataroo
$(call cygpath_w,$@))

# public libraries, that are installed in $(prefix)/lib
ifeq ($(JULIA_BUILD_MODE),release)
JL_TARGETS := julia
ifeq ($(BUNDLE_DEBUG_LIBS),1)
JL_TARGETS += julia-debug
else ifeq ($(JULIA_BUILD_MODE),debug)
JL_TARGETS := julia-debug
endif

# private libraries, that are installed in $(prefix)/lib/julia
JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest libjulia-internal libjulia-codegen
ifeq ($(BUNDLE_DEBUG_LIBS),1)
JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest
ifeq ($(JULIA_BUILD_MODE),release)
JL_PRIVATE_LIBS-0 += libjulia-internal libjulia-codegen
else ifeq ($(JULIA_BUILD_MODE),debug)
JL_PRIVATE_LIBS-0 += libjulia-internal-debug libjulia-codegen-debug
endif
ifeq ($(USE_GPL_LIBS), 1)
Expand Down Expand Up @@ -237,38 +240,32 @@ endef


install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html
ifeq ($(BUNDLE_DEBUG_LIBS),1)
@$(MAKE) $(QUIET_MAKE) all
else
@$(MAKE) $(QUIET_MAKE) release
endif
@$(MAKE) $(QUIET_MAKE) $(JULIA_BUILD_MODE)
@for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir) $(libexecdir); do \
mkdir -p $(DESTDIR)$$subdir; \
done

$(INSTALL_M) $(build_bindir)/julia $(DESTDIR)$(bindir)/
ifeq ($(BUNDLE_DEBUG_LIBS),1)
$(INSTALL_M) $(build_bindir)/julia-debug $(DESTDIR)$(bindir)/
endif
$(INSTALL_M) $(JULIA_EXECUTABLE_$(JULIA_BUILD_MODE)) $(DESTDIR)$(bindir)/
ifeq ($(OS),WINNT)
-$(INSTALL_M) $(filter-out $(build_bindir)/libjulia-debug.dll,$(wildcard $(build_bindir)/*.dll)) $(DESTDIR)$(bindir)/
-$(INSTALL_M) $(wildcard $(build_bindir)/*.dll) $(DESTDIR)$(bindir)/
ifeq ($(JULIA_BUILD_MODE),release)
-$(INSTALL_M) $(build_libdir)/libjulia.dll.a $(DESTDIR)$(libdir)/
else ifeq ($(JULIA_BUILD_MODE),debug)
-$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/
endif

# 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

# Copy over .dSYM directories directly for Darwin
ifneq ($(DARWIN_FRAMEWORK),1)
ifeq ($(OS),Darwin)
ifeq ($(JULIA_BUILD_MODE),release)
-cp -a $(build_libdir)/libjulia.*.dSYM $(DESTDIR)$(libdir)
-cp -a $(build_private_libdir)/sys.dylib.dSYM $(DESTDIR)$(private_libdir)
ifeq ($(BUNDLE_DEBUG_LIBS),1)
else ifeq ($(JULIA_BUILD_MODE),debug)
-cp -a $(build_libdir)/libjulia-debug.*.dSYM $(DESTDIR)$(libdir)
-cp -a $(build_private_libdir)/sys-debug.dylib.dSYM $(DESTDIR)$(private_libdir)
endif
Expand All @@ -283,10 +280,11 @@ endif
done
else
# libjulia in Darwin framework has special location and name
ifeq ($(JULIA_BUILD_MODE),release)
$(INSTALL_M) $(build_libdir)/libjulia.$(SOMAJOR).$(SOMINOR).dylib $(DESTDIR)$(prefix)/$(framework_dylib)
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/$(FRAMEWORK_NAME).dSYM $(DESTDIR)$(prefix)/$(framework_dylib)
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/sys.dylib.dSYM $(build_private_libdir)/sys.dylib
ifeq ($(BUNDLE_DEBUG_LIBS),1)
else ifeq ($(JULIA_BUILD_MODE),debug)
$(INSTALL_M) $(build_libdir)/libjulia-debug.$(SOMAJOR).$(SOMINOR).dylib $(DESTDIR)$(prefix)/$(framework_dylib)_debug
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/$(FRAMEWORK_NAME)_debug.dSYM $(DESTDIR)$(prefix)/$(framework_dylib)_debug
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/sys-debug.dylib.dSYM $(build_private_libdir)/sys-debug.dylib
Expand Down Expand Up @@ -314,8 +312,9 @@ endif
# Copy public headers
cp -R -L $(build_includedir)/julia/* $(DESTDIR)$(includedir)/julia
# Copy system image
ifeq ($(JULIA_BUILD_MODE),release)
$(INSTALL_M) $(build_private_libdir)/sys.$(SHLIB_EXT) $(DESTDIR)$(private_libdir)
ifeq ($(BUNDLE_DEBUG_LIBS),1)
else ifeq ($(JULIA_BUILD_MODE),debug)
$(INSTALL_M) $(build_private_libdir)/sys-debug.$(SHLIB_EXT) $(DESTDIR)$(private_libdir)
endif

Expand Down Expand Up @@ -364,33 +363,35 @@ endif
RELEASE_TARGET=$(DESTDIR)$(prefix)/$(framework_dylib); \
DEBUG_TARGET=$(DESTDIR)$(prefix)/$(framework_dylib)_debug; \
fi; \
$(call stringreplace,$${RELEASE_TARGET},sys.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys.$(SHLIB_EXT)); \
if [ "$(BUNDLE_DEBUG_LIBS)" = "1" ]; then \
if [ "$(JULIA_BUILD_MODE)" = "release" ]; then \
$(call stringreplace,$${RELEASE_TARGET},sys.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys.$(SHLIB_EXT)); \
elif [ "$(JULIA_BUILD_MODE)" = "debug" ]; then \
$(call stringreplace,$${DEBUG_TARGET},sys-debug.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys-debug.$(SHLIB_EXT)); \
fi;
endif

# Set rpath for libjulia-internal, which is moving from `../lib` to `../lib/julia`. We only need to do this for Linux/FreeBSD
ifneq (,$(findstring $(OS),Linux FreeBSD))
ifeq ($(JULIA_BUILD_MODE),release)
$(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal.$(SHLIB_EXT)
ifeq ($(BUNDLE_DEBUG_LIBS),1)
else ifeq ($(JULIA_BUILD_MODE),debug)
$(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal-debug.$(SHLIB_EXT)
endif
endif


ifneq ($(LOADER_BUILD_DEP_LIBS),$(LOADER_INSTALL_DEP_LIBS))
# Next, overwrite relative path to libjulia-internal in our loader if $$(LOADER_BUILD_DEP_LIBS) != $$(LOADER_INSTALL_DEP_LIBS)
ifeq ($(JULIA_BUILD_MODE),release)
$(call stringreplace,$(DESTDIR)$(shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT),$(LOADER_BUILD_DEP_LIBS)$$,$(LOADER_INSTALL_DEP_LIBS))
ifeq ($(OS),Darwin)
# Codesign the libjulia we just modified
$(JULIAHOME)/contrib/codesign.sh "$(MACOS_CODESIGN_IDENTITY)" "$(DESTDIR)$(shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT)"
endif

ifeq ($(BUNDLE_DEBUG_LIBS),1)
else ifeq ($(JULIA_BUILD_MODE),debug)
$(call stringreplace,$(DESTDIR)$(shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT),$(LOADER_DEBUG_BUILD_DEP_LIBS)$$,$(LOADER_DEBUG_INSTALL_DEP_LIBS))
endif
ifeq ($(OS),Darwin)
# Codesign the libjulia we just modified
ifeq ($(JULIA_BUILD_MODE),release)
$(JULIAHOME)/contrib/codesign.sh "$(MACOS_CODESIGN_IDENTITY)" "$(DESTDIR)$(shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT)"
else ifeq ($(JULIA_BUILD_MODE),debug)
$(JULIAHOME)/contrib/codesign.sh "$(MACOS_CODESIGN_IDENTITY)" "$(DESTDIR)$(shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT)"
endif
endif
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ Standard library changes

#### DelimitedFiles

* DelimitedFiles has been promoted from being a standard library to a separate package. It now has to be explicitly installed to be used.


Deprecated or removed
---------------------
Expand Down
2 changes: 0 additions & 2 deletions base/compiler/typeutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# lattice utilities #
#####################

isType(@nospecialize t) = isa(t, DataType) && t.name === _TYPE_NAME

# true if Type{T} is inlineable as constant T
# requires that T is a singleton, s.t. T == S implies T === S
isconstType(@nospecialize t) = isType(t) && hasuniquerep(t.parameters[1])
Expand Down
2 changes: 1 addition & 1 deletion base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function firstcaller(bt::Vector, funcsyms)
li = lkup.linfo
if li isa Core.MethodInstance
ft = ccall(:jl_first_argument_datatype, Any, (Any,), (li.def::Method).sig)
if isa(ft, DataType) && ft.name === Type.body.name
if isType(ft)
ft = unwrap_unionall(ft.parameters[1])
found = (isa(ft, DataType) && ft.name.name in funcsyms)
end
Expand Down
2 changes: 1 addition & 1 deletion base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function show_method_candidates(io::IO, ex::MethodError, @nospecialize kwargs=()
# pool MethodErrors for these two functions.
if f === convert && !isempty(arg_types_param)
at1 = arg_types_param[1]
if isa(at1,DataType) && (at1::DataType).name === Type.body.name && !Core.Compiler.has_free_typevars(at1)
if isType(at1) && !Core.Compiler.has_free_typevars(at1)
push!(funcs, (at1.parameters[1], arg_types_param[2:end]))
end
end
Expand Down
7 changes: 5 additions & 2 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1312,8 +1312,11 @@ end

# get a top-level Module from the given key
root_module(key::PkgId) = @lock require_lock loaded_modules[key]
root_module(where::Module, name::Symbol) =
root_module(identify_package(where, String(name)))
function root_module(where::Module, name::Symbol)
key = identify_package(where, String(name))
key isa PkgId || throw(KeyError(name))
return root_module(key)
end
maybe_root_module(key::PkgId) = @lock require_lock get(loaded_modules, key, nothing)

root_module_exists(key::PkgId) = @lock require_lock haskey(loaded_modules, key)
Expand Down
1 change: 1 addition & 0 deletions base/namedtuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ get(nt::NamedTuple, key::Union{Integer, Symbol}, default) = isdefined(nt, key) ?
get(f::Callable, nt::NamedTuple, key::Union{Integer, Symbol}) = isdefined(nt, key) ? getfield(nt, key) : f()
tail(t::NamedTuple{names}) where names = NamedTuple{tail(names)}(t)
front(t::NamedTuple{names}) where names = NamedTuple{front(names)}(t)
reverse(nt::NamedTuple) = NamedTuple{reverse(keys(nt))}(reverse(values(nt)))

@assume_effects :total function diff_names(an::Tuple{Vararg{Symbol}}, bn::Tuple{Vararg{Symbol}})
@nospecialize an bn
Expand Down
8 changes: 5 additions & 3 deletions base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ isbitstype(@nospecialize t) = (@_total_meta; isa(t, DataType) && (t.flags & 0x8)
Return `true` if `x` is an instance of an [`isbitstype`](@ref) type.
"""
isbits(@nospecialize x) = (@_total_meta; typeof(x).flags & 0x8 == 0x8)
isbits(@nospecialize x) = isbitstype(typeof(x))

"""
isdispatchtuple(T)
Expand All @@ -605,12 +605,14 @@ has_free_typevars(@nospecialize(t)) = ccall(:jl_has_free_typevars, Cint, (Any,),

# equivalent to isa(v, Type) && isdispatchtuple(Tuple{v}) || v === Union{}
# and is thus perhaps most similar to the old (pre-1.0) `isleaftype` query
const _TYPE_NAME = Type.body.name
function isdispatchelem(@nospecialize v)
return (v === Bottom) || (v === typeof(Bottom)) || isconcretedispatch(v) ||
(isa(v, DataType) && v.name === _TYPE_NAME && !has_free_typevars(v)) # isType(v)
(isType(v) && !has_free_typevars(v))
end

const _TYPE_NAME = Type.body.name
isType(@nospecialize t) = isa(t, DataType) && t.name === _TYPE_NAME

"""
isconcretetype(T)
Expand Down
3 changes: 1 addition & 2 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2392,8 +2392,7 @@ function show_signature_function(io::IO, @nospecialize(ft), demangle=false, farg
end
s = sprint(show_sym, (demangle ? demangle_function_name : identity)(uw.name.mt.name), context=io)
print_within_stacktrace(io, s, bold=true)
elseif isa(ft, DataType) && ft.name === Type.body.name &&
(f = ft.parameters[1]; !isa(f, TypeVar))
elseif isType(ft) && (f = ft.parameters[1]; !isa(f, TypeVar))
uwf = unwrap_unionall(f)
parens = isa(f, UnionAll) && !(isa(uwf, DataType) && f === uwf.name.wrapper)
parens && print(io, "(")
Expand Down
15 changes: 13 additions & 2 deletions base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1464,10 +1464,15 @@ import Core.Intrinsics: slt_int
import ..Sort: sort!, UIntMappable, uint_map, uint_unmap
import ...Order: lt, DirectOrdering

const Floats = Union{Float32,Float64}
const FPSortable = Union{ # Mixed Float32 and Float64 are not allowed.
# IEEEFloat is not available in Core.Compiler
const Floats = Union{Float16, Float32, Float64}
# fpsort is not safe for vectors of mixed bitwidth such as Vector{Union{Float32, Float64}}.
# This type allows us to dispatch only when it is safe to do so. See #42739 for more info.
const FPSortable = Union{
AbstractVector{Union{Float16, Missing}},
AbstractVector{Union{Float32, Missing}},
AbstractVector{Union{Float64, Missing}},
AbstractVector{Float16},
AbstractVector{Float32},
AbstractVector{Float64},
AbstractVector{Missing}}
Expand All @@ -1484,6 +1489,12 @@ right(o::Perm) = Perm(right(o.order), o.data)
lt(::Left, x::T, y::T) where {T<:Floats} = slt_int(y, x)
lt(::Right, x::T, y::T) where {T<:Floats} = slt_int(x, y)

uint_map(x::Float16, ::Left) = ~reinterpret(UInt16, x)
uint_unmap(::Type{Float16}, u::UInt16, ::Left) = reinterpret(Float16, ~u)
uint_map(x::Float16, ::Right) = reinterpret(UInt16, x)
uint_unmap(::Type{Float16}, u::UInt16, ::Right) = reinterpret(Float16, u)
UIntMappable(::Type{Float16}, ::Union{Left, Right}) = UInt16

uint_map(x::Float32, ::Left) = ~reinterpret(UInt32, x)
uint_unmap(::Type{Float32}, u::UInt32, ::Left) = reinterpret(Float32, ~u)
uint_map(x::Float32, ::Right) = reinterpret(UInt32, x)
Expand Down
2 changes: 1 addition & 1 deletion base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ let
# 7-depth packages
:LazyArtifacts,
]
maxlen = reduce(max, textwidth.(string.(stdlibs)); init=0)
maxlen = maximum(textwidth.(string.(stdlibs)))

tot_time_stdlib = 0.0
# use a temp module to avoid leaving the type of this closure in Main
Expand Down
9 changes: 7 additions & 2 deletions contrib/fixup-libstdc++.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ fi
libdir="$1"
private_libdir="$2"

if [ ! -f "$private_libdir/libjulia-internal.so" ]; then
if [ ! -f "$private_libdir/libjulia-internal.so" ] && \
[ ! -f "$private_libdir/libjulia-internal-debug.so" ]; then
echo "ERROR: Could not open $private_libdir/libjulia-internal.so" >&2
exit 2
fi
Expand All @@ -24,7 +25,11 @@ find_shlib ()
}

# Discover libstdc++ location and name
LIBSTD=$(find_shlib "$private_libdir/libjulia-internal.so" "libstdc++.so")
if [ -f "$private_libdir/libjulia-internal.so" ]; then
LIBSTD=$(find_shlib "$private_libdir/libjulia-internal.so" "libstdc++.so")
elif [ -f "$private_libdir/libjulia-internal-debug.so" ]; then
LIBSTD=$(find_shlib "$private_libdir/libjulia-internal-debug.so" "libstdc++.so")
fi
LIBSTD_NAME=$(basename $LIBSTD)
LIBSTD_DIR=$(dirname $LIBSTD)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9e337aa579ec47017d7b5ef2df3bcd02
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
99e67b045691f8d9c16680e77014a33a507250377c037a7cf23e5dc2f0294c771a834e6d14f6a3a19a8def0ebb61a6fde17a4f3c1284cab0f4d7b5ea8c128d5d

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion doc/src/manual/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ they are equivalent to `broadcast` calls and are fused with other nested "dot" c

You can also combine dot operations with function chaining using [`|>`](@ref), as in this example:
```jldoctest
julia> [1:5;] .|> [x->x^2, inv, x->2*x, -, isodd]
julia> 1:5 .|> [x->x^2, inv, x->2*x, -, isodd]
5-element Vector{Real}:
1
0.5
Expand Down
17 changes: 0 additions & 17 deletions julia.spdx.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,6 @@
"copyrightText": "Copyright (c) 2014: Elliot Saba",
"summary": "A performant, 100% native-julia SHA1, SHA2, and SHA3 implementation"
},
{
"name": "DelimitedFiles.jl",
"SPDXID": "SPDXRef-JuliaDelimitedFiles",
"downloadLocation": "git+https://github.com/JuliaData/DelimitedFiles.jl.git",
"filesAnalyzed": false,
"homepage": "https://julialang.org",
"sourceInfo": "The git hash of the version in use can be found in the file stdlib/DelimitedFiles.version",
"licenseConcluded": "MIT",
"licenseDeclared": "MIT",
"copyrightText": "Copyright (c) 2012-2022 The Julia Programming Language",
"summary": "A package for reading and writing files with delimited values."
},
{
"name": "dSFMT",
"SPDXID": "SPDXRef-dSFMT",
Expand Down Expand Up @@ -503,11 +491,6 @@
"relationshipType": "BUILD_DEPENDENCY_OF",
"relatedSpdxElement": "SPDXRef-JuliaMain"
},
{
"spdxElementId": "SPDXRef-JuliaDelimitedFiles",
"relationshipType": "BUILD_DEPENDENCY_OF",
"relatedSpdxElement": "SPDXRef-JuliaMain"
},
{
"spdxElementId": "SPDXRef-dSFMT",
"relationshipType": "BUILD_DEPENDENCY_OF",
Expand Down
Loading

0 comments on commit 3307d66

Please sign in to comment.