Skip to content

Commit 3307d66

Browse files
authored
Merge branch 'master' into ifelseboolassert
2 parents e87e072 + ec98087 commit 3307d66

File tree

35 files changed

+229
-89
lines changed

35 files changed

+229
-89
lines changed

Makefile

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,17 @@ $(build_datarootdir)/julia/base.cache: $(JULIA_SYSIMG) | $(DIRS) $(build_dataroo
169169
$(call cygpath_w,$@))
170170

171171
# public libraries, that are installed in $(prefix)/lib
172+
ifeq ($(JULIA_BUILD_MODE),release)
172173
JL_TARGETS := julia
173-
ifeq ($(BUNDLE_DEBUG_LIBS),1)
174-
JL_TARGETS += julia-debug
174+
else ifeq ($(JULIA_BUILD_MODE),debug)
175+
JL_TARGETS := julia-debug
175176
endif
176177

177178
# private libraries, that are installed in $(prefix)/lib/julia
178-
JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest libjulia-internal libjulia-codegen
179-
ifeq ($(BUNDLE_DEBUG_LIBS),1)
179+
JL_PRIVATE_LIBS-0 := libccalltest libllvmcalltest
180+
ifeq ($(JULIA_BUILD_MODE),release)
181+
JL_PRIVATE_LIBS-0 += libjulia-internal libjulia-codegen
182+
else ifeq ($(JULIA_BUILD_MODE),debug)
180183
JL_PRIVATE_LIBS-0 += libjulia-internal-debug libjulia-codegen-debug
181184
endif
182185
ifeq ($(USE_GPL_LIBS), 1)
@@ -237,38 +240,32 @@ endef
237240

238241

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

249-
$(INSTALL_M) $(build_bindir)/julia $(DESTDIR)$(bindir)/
250-
ifeq ($(BUNDLE_DEBUG_LIBS),1)
251-
$(INSTALL_M) $(build_bindir)/julia-debug $(DESTDIR)$(bindir)/
252-
endif
248+
$(INSTALL_M) $(JULIA_EXECUTABLE_$(JULIA_BUILD_MODE)) $(DESTDIR)$(bindir)/
253249
ifeq ($(OS),WINNT)
254-
-$(INSTALL_M) $(filter-out $(build_bindir)/libjulia-debug.dll,$(wildcard $(build_bindir)/*.dll)) $(DESTDIR)$(bindir)/
250+
-$(INSTALL_M) $(wildcard $(build_bindir)/*.dll) $(DESTDIR)$(bindir)/
251+
ifeq ($(JULIA_BUILD_MODE),release)
255252
-$(INSTALL_M) $(build_libdir)/libjulia.dll.a $(DESTDIR)$(libdir)/
253+
else ifeq ($(JULIA_BUILD_MODE),debug)
254+
-$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/
255+
endif
256256

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

266262
# Copy over .dSYM directories directly for Darwin
267263
ifneq ($(DARWIN_FRAMEWORK),1)
268264
ifeq ($(OS),Darwin)
265+
ifeq ($(JULIA_BUILD_MODE),release)
269266
-cp -a $(build_libdir)/libjulia.*.dSYM $(DESTDIR)$(libdir)
270267
-cp -a $(build_private_libdir)/sys.dylib.dSYM $(DESTDIR)$(private_libdir)
271-
ifeq ($(BUNDLE_DEBUG_LIBS),1)
268+
else ifeq ($(JULIA_BUILD_MODE),debug)
272269
-cp -a $(build_libdir)/libjulia-debug.*.dSYM $(DESTDIR)$(libdir)
273270
-cp -a $(build_private_libdir)/sys-debug.dylib.dSYM $(DESTDIR)$(private_libdir)
274271
endif
@@ -283,10 +280,11 @@ endif
283280
done
284281
else
285282
# libjulia in Darwin framework has special location and name
283+
ifeq ($(JULIA_BUILD_MODE),release)
286284
$(INSTALL_M) $(build_libdir)/libjulia.$(SOMAJOR).$(SOMINOR).dylib $(DESTDIR)$(prefix)/$(framework_dylib)
287285
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/$(FRAMEWORK_NAME).dSYM $(DESTDIR)$(prefix)/$(framework_dylib)
288286
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/sys.dylib.dSYM $(build_private_libdir)/sys.dylib
289-
ifeq ($(BUNDLE_DEBUG_LIBS),1)
287+
else ifeq ($(JULIA_BUILD_MODE),debug)
290288
$(INSTALL_M) $(build_libdir)/libjulia-debug.$(SOMAJOR).$(SOMINOR).dylib $(DESTDIR)$(prefix)/$(framework_dylib)_debug
291289
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/$(FRAMEWORK_NAME)_debug.dSYM $(DESTDIR)$(prefix)/$(framework_dylib)_debug
292290
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/sys-debug.dylib.dSYM $(build_private_libdir)/sys-debug.dylib
@@ -314,8 +312,9 @@ endif
314312
# Copy public headers
315313
cp -R -L $(build_includedir)/julia/* $(DESTDIR)$(includedir)/julia
316314
# Copy system image
315+
ifeq ($(JULIA_BUILD_MODE),release)
317316
$(INSTALL_M) $(build_private_libdir)/sys.$(SHLIB_EXT) $(DESTDIR)$(private_libdir)
318-
ifeq ($(BUNDLE_DEBUG_LIBS),1)
317+
else ifeq ($(JULIA_BUILD_MODE),debug)
319318
$(INSTALL_M) $(build_private_libdir)/sys-debug.$(SHLIB_EXT) $(DESTDIR)$(private_libdir)
320319
endif
321320

@@ -364,33 +363,35 @@ endif
364363
RELEASE_TARGET=$(DESTDIR)$(prefix)/$(framework_dylib); \
365364
DEBUG_TARGET=$(DESTDIR)$(prefix)/$(framework_dylib)_debug; \
366365
fi; \
367-
$(call stringreplace,$${RELEASE_TARGET},sys.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys.$(SHLIB_EXT)); \
368-
if [ "$(BUNDLE_DEBUG_LIBS)" = "1" ]; then \
366+
if [ "$(JULIA_BUILD_MODE)" = "release" ]; then \
367+
$(call stringreplace,$${RELEASE_TARGET},sys.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys.$(SHLIB_EXT)); \
368+
elif [ "$(JULIA_BUILD_MODE)" = "debug" ]; then \
369369
$(call stringreplace,$${DEBUG_TARGET},sys-debug.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys-debug.$(SHLIB_EXT)); \
370370
fi;
371371
endif
372372

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

381382

382383
ifneq ($(LOADER_BUILD_DEP_LIBS),$(LOADER_INSTALL_DEP_LIBS))
383384
# Next, overwrite relative path to libjulia-internal in our loader if $$(LOADER_BUILD_DEP_LIBS) != $$(LOADER_INSTALL_DEP_LIBS)
385+
ifeq ($(JULIA_BUILD_MODE),release)
384386
$(call stringreplace,$(DESTDIR)$(shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT),$(LOADER_BUILD_DEP_LIBS)$$,$(LOADER_INSTALL_DEP_LIBS))
385-
ifeq ($(OS),Darwin)
386-
# Codesign the libjulia we just modified
387-
$(JULIAHOME)/contrib/codesign.sh "$(MACOS_CODESIGN_IDENTITY)" "$(DESTDIR)$(shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT)"
388-
endif
389-
390-
ifeq ($(BUNDLE_DEBUG_LIBS),1)
387+
else ifeq ($(JULIA_BUILD_MODE),debug)
391388
$(call stringreplace,$(DESTDIR)$(shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT),$(LOADER_DEBUG_BUILD_DEP_LIBS)$$,$(LOADER_DEBUG_INSTALL_DEP_LIBS))
389+
endif
392390
ifeq ($(OS),Darwin)
393391
# Codesign the libjulia we just modified
392+
ifeq ($(JULIA_BUILD_MODE),release)
393+
$(JULIAHOME)/contrib/codesign.sh "$(MACOS_CODESIGN_IDENTITY)" "$(DESTDIR)$(shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT)"
394+
else ifeq ($(JULIA_BUILD_MODE),debug)
394395
$(JULIAHOME)/contrib/codesign.sh "$(MACOS_CODESIGN_IDENTITY)" "$(DESTDIR)$(shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT)"
395396
endif
396397
endif

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ Standard library changes
158158

159159
#### DelimitedFiles
160160

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

162164
Deprecated or removed
163165
---------------------

base/compiler/typeutils.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# lattice utilities #
55
#####################
66

7-
isType(@nospecialize t) = isa(t, DataType) && t.name === _TYPE_NAME
8-
97
# true if Type{T} is inlineable as constant T
108
# requires that T is a singleton, s.t. T == S implies T === S
119
isconstType(@nospecialize t) = isType(t) && hasuniquerep(t.parameters[1])

base/deprecated.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function firstcaller(bt::Vector, funcsyms)
159159
li = lkup.linfo
160160
if li isa Core.MethodInstance
161161
ft = ccall(:jl_first_argument_datatype, Any, (Any,), (li.def::Method).sig)
162-
if isa(ft, DataType) && ft.name === Type.body.name
162+
if isType(ft)
163163
ft = unwrap_unionall(ft.parameters[1])
164164
found = (isa(ft, DataType) && ft.name.name in funcsyms)
165165
end

base/errorshow.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ function show_method_candidates(io::IO, ex::MethodError, @nospecialize kwargs=()
400400
# pool MethodErrors for these two functions.
401401
if f === convert && !isempty(arg_types_param)
402402
at1 = arg_types_param[1]
403-
if isa(at1,DataType) && (at1::DataType).name === Type.body.name && !Core.Compiler.has_free_typevars(at1)
403+
if isType(at1) && !Core.Compiler.has_free_typevars(at1)
404404
push!(funcs, (at1.parameters[1], arg_types_param[2:end]))
405405
end
406406
end

base/loading.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,8 +1312,11 @@ end
13121312

13131313
# get a top-level Module from the given key
13141314
root_module(key::PkgId) = @lock require_lock loaded_modules[key]
1315-
root_module(where::Module, name::Symbol) =
1316-
root_module(identify_package(where, String(name)))
1315+
function root_module(where::Module, name::Symbol)
1316+
key = identify_package(where, String(name))
1317+
key isa PkgId || throw(KeyError(name))
1318+
return root_module(key)
1319+
end
13171320
maybe_root_module(key::PkgId) = @lock require_lock get(loaded_modules, key, nothing)
13181321

13191322
root_module_exists(key::PkgId) = @lock require_lock haskey(loaded_modules, key)

base/namedtuple.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ get(nt::NamedTuple, key::Union{Integer, Symbol}, default) = isdefined(nt, key) ?
320320
get(f::Callable, nt::NamedTuple, key::Union{Integer, Symbol}) = isdefined(nt, key) ? getfield(nt, key) : f()
321321
tail(t::NamedTuple{names}) where names = NamedTuple{tail(names)}(t)
322322
front(t::NamedTuple{names}) where names = NamedTuple{front(names)}(t)
323+
reverse(nt::NamedTuple) = NamedTuple{reverse(keys(nt))}(reverse(values(nt)))
323324

324325
@assume_effects :total function diff_names(an::Tuple{Vararg{Symbol}}, bn::Tuple{Vararg{Symbol}})
325326
@nospecialize an bn

base/reflection.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ isbitstype(@nospecialize t) = (@_total_meta; isa(t, DataType) && (t.flags & 0x8)
588588
589589
Return `true` if `x` is an instance of an [`isbitstype`](@ref) type.
590590
"""
591-
isbits(@nospecialize x) = (@_total_meta; typeof(x).flags & 0x8 == 0x8)
591+
isbits(@nospecialize x) = isbitstype(typeof(x))
592592

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

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

613+
const _TYPE_NAME = Type.body.name
614+
isType(@nospecialize t) = isa(t, DataType) && t.name === _TYPE_NAME
615+
614616
"""
615617
isconcretetype(T)
616618

base/show.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,8 +2392,7 @@ function show_signature_function(io::IO, @nospecialize(ft), demangle=false, farg
23922392
end
23932393
s = sprint(show_sym, (demangle ? demangle_function_name : identity)(uw.name.mt.name), context=io)
23942394
print_within_stacktrace(io, s, bold=true)
2395-
elseif isa(ft, DataType) && ft.name === Type.body.name &&
2396-
(f = ft.parameters[1]; !isa(f, TypeVar))
2395+
elseif isType(ft) && (f = ft.parameters[1]; !isa(f, TypeVar))
23972396
uwf = unwrap_unionall(f)
23982397
parens = isa(f, UnionAll) && !(isa(uwf, DataType) && f === uwf.name.wrapper)
23992398
parens && print(io, "(")

base/sort.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,10 +1464,15 @@ import Core.Intrinsics: slt_int
14641464
import ..Sort: sort!, UIntMappable, uint_map, uint_unmap
14651465
import ...Order: lt, DirectOrdering
14661466

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

1492+
uint_map(x::Float16, ::Left) = ~reinterpret(UInt16, x)
1493+
uint_unmap(::Type{Float16}, u::UInt16, ::Left) = reinterpret(Float16, ~u)
1494+
uint_map(x::Float16, ::Right) = reinterpret(UInt16, x)
1495+
uint_unmap(::Type{Float16}, u::UInt16, ::Right) = reinterpret(Float16, u)
1496+
UIntMappable(::Type{Float16}, ::Union{Left, Right}) = UInt16
1497+
14871498
uint_map(x::Float32, ::Left) = ~reinterpret(UInt32, x)
14881499
uint_unmap(::Type{Float32}, u::UInt32, ::Left) = reinterpret(Float32, ~u)
14891500
uint_map(x::Float32, ::Right) = reinterpret(UInt32, x)

0 commit comments

Comments
 (0)