Skip to content

Commit

Permalink
Merge branch 'master' into string_pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen authored Oct 24, 2023
2 parents 404c566 + abd00d0 commit f08ac97
Show file tree
Hide file tree
Showing 112 changed files with 1,805 additions and 657 deletions.
2 changes: 1 addition & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ LIBGFORTRAN_VERSION := $(subst libgfortran,,$(filter libgfortran%,$(subst -,$(SP
# shipped with CSL. Although we do not depend on any of the symbols, it is entirely
# possible that a user might choose to install a library which depends on symbols provided
# by a newer libstdc++. Without runtime detection, those libraries would break.
CSL_NEXT_GLIBCXX_VERSION=GLIBCXX_3\.4\.31|GLIBCXX_3\.5\.|GLIBCXX_4\.
CSL_NEXT_GLIBCXX_VERSION=GLIBCXX_3\.4\.33|GLIBCXX_3\.5\.|GLIBCXX_4\.


# This is the set of projects that BinaryBuilder dependencies are hooked up for.
Expand Down
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,13 @@ else ifeq ($(JULIA_BUILD_MODE),debug)
-$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/
-$(INSTALL_M) $(build_libdir)/libjulia-internal-debug.dll.a $(DESTDIR)$(libdir)/
endif
-$(INSTALL_M) $(wildcard $(build_private_libdir)/*.a) $(DESTDIR)$(private_libdir)/

# We have a single exception; we want 7z.dll to live in private_libexecdir, not bindir, so that 7z.exe can find it.
# We have a single exception; we want 7z.dll to live in private_libexecdir,
# not bindir, so that 7z.exe can find it.
-mv $(DESTDIR)$(bindir)/7z.dll $(DESTDIR)$(private_libexecdir)/
-$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/
-$(INSTALL_M) $(build_libdir)/libssp.dll.a $(DESTDIR)$(libdir)/
# The rest are compiler dependencies, as an example memcpy is exported by msvcrt
# These are files from mingw32 and required for creating shared libraries like our caches.
-$(INSTALL_M) $(build_libdir)/libgcc_s.a $(DESTDIR)$(libdir)/
-$(INSTALL_M) $(build_libdir)/libgcc.a $(DESTDIR)$(libdir)/
-$(INSTALL_M) $(build_libdir)/libmsvcrt.a $(DESTDIR)$(libdir)/
else

# Copy over .dSYM directories directly for Darwin
Expand Down
17 changes: 17 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ New language features
difference between `public` and `export` is that `public` names do not become
available when `using` a package/module. ([#50105])
* `ScopedValue` implement dynamic scope with inheritance across tasks ([#50958]).
* Support for Unicode 15.1 ([#51799]).
* A new `AbstractString` type, `AnnotatedString`, is introduced that allows for
regional annotations to be attached to an underlying string. This type is
particularly useful for holding styling information, and is used extensively
in the new `StyledStrings` standard library. There is also a new `AnnotatedChar`
type, that is the equivalent new `AbstractChar` type.

Language changes
----------------
Expand Down Expand Up @@ -51,6 +57,17 @@ New library features
Standard library changes
------------------------

#### StyledStrings

* A new standard library for handling styling in a more comprehensive and structured way.
* The new `Faces` struct serves as a container for text styling information
(think typeface, as well as color and decoration), and comes with a framework
to provide a convenient, extensible (via `addface!`), and customisable (with a
user's `Faces.toml` and `loadfaces!`) approach to
styled content.
* The new `@styled_str` string macro provides a convenient way of creating a
`AnnotatedString` with various faces or other attributes applied.

#### Package Manager

#### LinearAlgebra
Expand Down
2 changes: 1 addition & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ Perform a conservative test to check if arrays `A` and `B` might share the same
By default, this simply checks if either of the arrays reference the same memory
regions, as identified by their [`Base.dataids`](@ref).
"""
mightalias(A::AbstractArray, B::AbstractArray) = !isbits(A) && !isbits(B) && !_isdisjoint(dataids(A), dataids(B))
mightalias(A::AbstractArray, B::AbstractArray) = !isbits(A) && !isbits(B) && !isempty(A) && !isempty(B) && !_isdisjoint(dataids(A), dataids(B))
mightalias(x, y) = false

_isdisjoint(as::Tuple{}, bs::Tuple{}) = true
Expand Down
29 changes: 13 additions & 16 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ function exec_options(opts)
# If we're doing a bug report, don't load anything else. We will
# spawn a child in which to execute these options.
let InteractiveUtils = load_InteractiveUtils()
InteractiveUtils.report_bug(arg)
invokelatest(InteractiveUtils.report_bug, arg)
end
return nothing
return false
else
@warn "Unexpected command -$cmd'$arg'"
end
Expand All @@ -261,8 +261,8 @@ function exec_options(opts)
distributed_mode = (opts.worker == 1) || (opts.nprocs > 0) || (opts.machine_file != C_NULL)
if distributed_mode
let Distributed = require(PkgId(UUID((0x8ba89e20_285c_5b6f, 0x9357_94700520ee1b)), "Distributed"))
Core.eval(Main, :(const Distributed = $Distributed))
Core.eval(Main, :(using .Distributed))
Core.eval(MainInclude, :(const Distributed = $Distributed))
Core.eval(Main, :(using Base.MainInclude.Distributed))
end

invokelatest(Main.Distributed.process_opts, opts)
Expand All @@ -271,6 +271,10 @@ function exec_options(opts)
interactiveinput = (repl || is_interactive::Bool) && isa(stdin, TTY)
is_interactive::Bool |= interactiveinput

# load terminfo in for styled printing
term_env = get(ENV, "TERM", @static Sys.iswindows() ? "" : "dumb")
global current_terminfo = load_terminfo(term_env)

# load ~/.julia/config/startup.jl file
if startup
try
Expand Down Expand Up @@ -380,19 +384,18 @@ _atreplinit(repl) = invokelatest(__atreplinit, repl)

function load_InteractiveUtils(mod::Module=Main)
# load interactive-only libraries
if !isdefined(mod, :InteractiveUtils)
if !isdefined(MainInclude, :InteractiveUtils)
try
let InteractiveUtils = require(PkgId(UUID(0xb77e0a4c_d291_57a0_90e8_8db25a27a240), "InteractiveUtils"))
Core.eval(mod, :(const InteractiveUtils = $InteractiveUtils))
Core.eval(mod, :(using .InteractiveUtils))
return InteractiveUtils
Core.eval(MainInclude, :(const InteractiveUtils = $InteractiveUtils))
end
catch ex
@warn "Failed to import InteractiveUtils into module $mod" exception=(ex, catch_backtrace())
return nothing
end
return nothing
end
return getfield(mod, :InteractiveUtils)
Core.eval(mod, :(using Base.MainInclude.InteractiveUtils))
return MainInclude.InteractiveUtils
end

function load_REPL()
Expand All @@ -417,11 +420,9 @@ function run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_f
end
end
# TODO cleanup REPL_MODULE_REF

if !fallback_repl && interactive && isassigned(REPL_MODULE_REF)
invokelatest(REPL_MODULE_REF[]) do REPL
term_env = get(ENV, "TERM", @static Sys.iswindows() ? "" : "dumb")
global current_terminfo = load_terminfo(term_env)
term = REPL.Terminals.TTYTerminal(term_env, stdin, stdout, stderr)
banner == :no || Base.banner(term, short=banner==:short)
if term.term_type == "dumb"
Expand Down Expand Up @@ -511,10 +512,6 @@ A variable referring to the last thrown errors, automatically imported to the in
The thrown errors are collected in a stack of exceptions.
"""
global err = nothing

# weakly exposes ans and err variables to Main
export ans, err

end

"""
Expand Down
16 changes: 9 additions & 7 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,12 @@ function handle_single_case!(todo::Vector{Pair{Int,Any}},
elseif isa(case, InvokeCase)
is_foldable_nothrow(case.effects) && inline_const_if_inlineable!(ir[SSAValue(idx)]) && return nothing
isinvoke && rewrite_invoke_exprargs!(stmt)
stmt.head = :invoke
pushfirst!(stmt.args, case.invoke)
if stmt.head === :invoke
stmt.args[1] = case.invoke
else
stmt.head = :invoke
pushfirst!(stmt.args, case.invoke)
end
ir[SSAValue(idx)][:flag] |= flags_for_effects(case.effects)
elseif case === nothing
# Do, well, nothing
Expand Down Expand Up @@ -1643,13 +1647,11 @@ function handle_finalizer_call!(ir::IRCode, idx::Int, stmt::Expr, info::Finalize
return nothing
end

function handle_invoke_expr!(todo::Vector{Pair{Int,Any}},
function handle_invoke_expr!(todo::Vector{Pair{Int,Any}}, ir::IRCode,
idx::Int, stmt::Expr, @nospecialize(info::CallInfo), flag::UInt32, sig::Signature, state::InliningState)
mi = stmt.args[1]::MethodInstance
case = resolve_todo(mi, sig.argtypes, info, flag, state)
if case !== nothing
push!(todo, idx=>(case::InliningTodo))
end
handle_single_case!(todo, ir, idx, stmt, case, false)
return nothing
end

Expand Down Expand Up @@ -1677,7 +1679,7 @@ function assemble_inline_todo!(ir::IRCode, state::InliningState)
# `NativeInterpreter` won't need this, but provide a support for `:invoke` exprs here
# for external `AbstractInterpreter`s that may run the inlining pass multiple times
if isexpr(stmt, :invoke)
handle_invoke_expr!(todo, idx, stmt, info, flag, sig, state)
handle_invoke_expr!(todo, ir, idx, stmt, info, flag, sig, state)
continue
end

Expand Down
2 changes: 1 addition & 1 deletion base/compiler/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ end

function get_nospecializeinfer_sig(method::Method, @nospecialize(atype), sparams::SimpleVector)
isa(atype, DataType) || return method.sig
mt = ccall(:jl_method_table_for, Any, (Any,), atype)
mt = ccall(:jl_method_get_table, Any, (Any,), method)
mt === nothing && return method.sig
return ccall(:jl_normalize_to_compilable_sig, Any, (Any, Any, Any, Any, Cint),
mt, atype, sparams, method, #=int return_if_compileable=#0)
Expand Down
4 changes: 4 additions & 0 deletions base/ctypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ const Cfloat = Float32
Equivalent to the native `double` c-type ([`Float64`](@ref)).
"""
const Cdouble = Float64


# we have no `Float16` alias, because C does not define a standard fp16 type. Julia follows
# the _Float16 C ABI; if that becomes standard, we can add an appropriate alias here.
2 changes: 1 addition & 1 deletion base/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ error(s::AbstractString) = throw(ErrorException(s))
"""
error(msg...)
Raise an `ErrorException` with the given message.
Raise an `ErrorException` with a message constructed by `string(msg...)`.
"""
function error(s::Vararg{Any,N}) where {N}
@noinline
Expand Down
124 changes: 65 additions & 59 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1072,83 +1072,89 @@ export

@main

# TODO: use normal syntax once JuliaSyntax.jl becomes available at this point in bootstrapping
eval(Expr(:public,
public
# Modules
:Checked,
:Filesystem,
:Order,
:Sort,
Checked,
Filesystem,
Order,
Sort,

# Types
:AbstractLock,
:AsyncCondition,
:CodeUnits,
:Event,
:Fix1,
:Fix2,
:Generator,
:ImmutableDict,
:OneTo,
:UUID,
AbstractLock,
AsyncCondition,
CodeUnits,
Event,
Fix1,
Fix2,
Generator,
ImmutableDict,
OneTo,
AnnotatedString,
AnnotatedChar,
UUID,

# Annotated strings
annotatedstring,
annotate!,
annotations,

# Semaphores
:Semaphore,
:acquire,
:release,
Semaphore,
acquire,
release,

# collections
:IteratorEltype,
:IteratorSize,
:to_index,
:vect,
:isdone,
:front,
:rest,
:split_rest,
:tail,
:checked_length,
IteratorEltype,
IteratorSize,
to_index,
vect,
isdone,
front,
rest,
split_rest,
tail,
checked_length,

# Loading
:DL_LOAD_PATH,
:load_path,
:active_project,
DL_LOAD_PATH,
load_path,
active_project,

# Reflection and introspection
:isambiguous,
:isexpr,
:isidentifier,
:issingletontype,
:identify_package,
:locate_package,
:moduleroot,
:jit_total_bytes,
:summarysize,
:isexported,
:ispublic,
isambiguous,
isexpr,
isidentifier,
issingletontype,
identify_package,
locate_package,
moduleroot,
jit_total_bytes,
summarysize,
isexported,
ispublic,

# Opperators
:operator_associativity,
:operator_precedence,
:isbinaryoperator,
:isoperator,
:isunaryoperator,
operator_associativity,
operator_precedence,
isbinaryoperator,
isoperator,
isunaryoperator,

# C interface
:cconvert,
:unsafe_convert,
cconvert,
unsafe_convert,

# Error handling
:exit_on_sigint,
:windowserror,
exit_on_sigint,
windowserror,

# Macros
Symbol("@assume_effects"),
Symbol("@constprop"),
Symbol("@locals"),
Symbol("@propagate_inbounds"),
@assume_effects,
@constprop,
@locals,
@propagate_inbounds,

# misc
:notnothing,
:runtests,
:text_colors))
notnothing,
runtests,
text_colors
6 changes: 3 additions & 3 deletions base/linking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ else
end

function link_image_cmd(path, out)
LIBDIR = "-L$(libdir())"
PRIVATE_LIBDIR = "-L$(private_libdir())"
SHLIBDIR = "-L$(shlibdir())"
LIBS = is_debug() ? ("-ljulia-debug", "-ljulia-internal-debug") : ("-ljulia", "-ljulia-internal")
LIBS = is_debug() ? ("-ljulia-debug", "-ljulia-internal-debug") :
("-ljulia", "-ljulia-internal")
@static if Sys.iswindows()
LIBS = (LIBS..., "-lopenlibm", "-lssp", "-lgcc_s", "-lgcc", "-lmsvcrt")
end

V = VERBOSE[] ? "--verbose" : ""
`$(ld()) $V $SHARED -o $out $WHOLE_ARCHIVE $path $NO_WHOLE_ARCHIVE $LIBDIR $PRIVATE_LIBDIR $SHLIBDIR $LIBS`
`$(ld()) $V $SHARED -o $out $WHOLE_ARCHIVE $path $NO_WHOLE_ARCHIVE $PRIVATE_LIBDIR $SHLIBDIR $LIBS`
end

function link_image(path, out, internal_stderr::IO=stderr, internal_stdout::IO=stdout)
Expand Down
Loading

0 comments on commit f08ac97

Please sign in to comment.