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

+31-30
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

+2
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

-2
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

+1-1
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

+1-1
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

+5-2
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

+1
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

+5-3
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

+1-2
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

+13-2
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)

base/sysimg.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ let
7171
# 7-depth packages
7272
:LazyArtifacts,
7373
]
74-
maxlen = reduce(max, textwidth.(string.(stdlibs)); init=0)
74+
maxlen = maximum(textwidth.(string.(stdlibs)))
7575

7676
tot_time_stdlib = 0.0
7777
# use a temp module to avoid leaving the type of this closure in Main

contrib/fixup-libstdc++.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ fi
1111
libdir="$1"
1212
private_libdir="$2"
1313

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

2627
# Discover libstdc++ location and name
27-
LIBSTD=$(find_shlib "$private_libdir/libjulia-internal.so" "libstdc++.so")
28+
if [ -f "$private_libdir/libjulia-internal.so" ]; then
29+
LIBSTD=$(find_shlib "$private_libdir/libjulia-internal.so" "libstdc++.so")
30+
elif [ -f "$private_libdir/libjulia-internal-debug.so" ]; then
31+
LIBSTD=$(find_shlib "$private_libdir/libjulia-internal-debug.so" "libstdc++.so")
32+
fi
2833
LIBSTD_NAME=$(basename $LIBSTD)
2934
LIBSTD_DIR=$(dirname $LIBSTD)
3035

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9e337aa579ec47017d7b5ef2df3bcd02
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
99e67b045691f8d9c16680e77014a33a507250377c037a7cf23e5dc2f0294c771a834e6d14f6a3a19a8def0ebb61a6fde17a4f3c1284cab0f4d7b5ea8c128d5d

deps/checksums/Pkg-cebcbc0a4af16fb7933fe101e8ef89a368231e60.tar.gz/md5

-1
This file was deleted.

deps/checksums/Pkg-cebcbc0a4af16fb7933fe101e8ef89a368231e60.tar.gz/sha512

-1
This file was deleted.

doc/src/manual/functions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ they are equivalent to `broadcast` calls and are fused with other nested "dot" c
10971097

10981098
You can also combine dot operations with function chaining using [`|>`](@ref), as in this example:
10991099
```jldoctest
1100-
julia> [1:5;] .|> [x->x^2, inv, x->2*x, -, isodd]
1100+
julia> 1:5 .|> [x->x^2, inv, x->2*x, -, isodd]
11011101
5-element Vector{Real}:
11021102
1
11031103
0.5

julia.spdx.json

-17
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,6 @@
146146
"copyrightText": "Copyright (c) 2014: Elliot Saba",
147147
"summary": "A performant, 100% native-julia SHA1, SHA2, and SHA3 implementation"
148148
},
149-
{
150-
"name": "DelimitedFiles.jl",
151-
"SPDXID": "SPDXRef-JuliaDelimitedFiles",
152-
"downloadLocation": "git+https://github.com/JuliaData/DelimitedFiles.jl.git",
153-
"filesAnalyzed": false,
154-
"homepage": "https://julialang.org",
155-
"sourceInfo": "The git hash of the version in use can be found in the file stdlib/DelimitedFiles.version",
156-
"licenseConcluded": "MIT",
157-
"licenseDeclared": "MIT",
158-
"copyrightText": "Copyright (c) 2012-2022 The Julia Programming Language",
159-
"summary": "A package for reading and writing files with delimited values."
160-
},
161149
{
162150
"name": "dSFMT",
163151
"SPDXID": "SPDXRef-dSFMT",
@@ -503,11 +491,6 @@
503491
"relationshipType": "BUILD_DEPENDENCY_OF",
504492
"relatedSpdxElement": "SPDXRef-JuliaMain"
505493
},
506-
{
507-
"spdxElementId": "SPDXRef-JuliaDelimitedFiles",
508-
"relationshipType": "BUILD_DEPENDENCY_OF",
509-
"relatedSpdxElement": "SPDXRef-JuliaMain"
510-
},
511494
{
512495
"spdxElementId": "SPDXRef-dSFMT",
513496
"relationshipType": "BUILD_DEPENDENCY_OF",

0 commit comments

Comments
 (0)