Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8230e8b
[backports-release-1.11] Don't forget to decay value on struct initia…
gbaraldi Sep 9, 2025
9111406
[`backports-release-1.11`] Backport #59259 ("Fix compile time regress…
DilumAluthge Sep 9, 2025
d64638c
[backports-release-1.11] Backport #57523: Remove usages of weak symbo…
xal-0 Sep 9, 2025
0e12c4b
remove workaround for controlling terminal behavior in repl_cmd (#58554)
vtjnash May 29, 2025
d0297f3
Make late gc lower handle insertelement of alloca use. (#58637)
gbaraldi Jun 4, 2025
c3e5a99
Update the developer docs to reflect the use of JuliaSyntax.jl (#59300)
ajwheeler Aug 19, 2025
572b87a
`@nospecialize` for `string_index_err` (#57604)
nsajko Aug 21, 2025
8702c18
aotcompile: destroy LLVM context after serializing combined module (#…
xal-0 Aug 22, 2025
992d673
Fix startup when history file is bad (#59418)
IanButterworth Sep 3, 2025
f0ad92d
Enable getting non-boxed LLVM type from Julia Type (#56890)
wsmoses Sep 5, 2025
af1c584
Remove bad test
gbaraldi Sep 15, 2025
788c31a
Fix mingw windows build
wsmoses Sep 16, 2025
1fbe3bc
[release-1.11] Fix missing CodeInstance owner lookup in _jl_invoke (#…
vchuravy Sep 16, 2025
2bb5165
codegen: mark write barrier field load as volatile (#59559)
vtjnash Sep 16, 2025
b3045a7
Only apply Base.Sort.SubArrayOptimization when iszero(v.offset1) (#59…
LilithHafner Sep 17, 2025
bef4090
[REPL] more reliable extension loading (#58415)
vtjnash May 15, 2025
133273d
Bump LLVM version
gbaraldi Sep 22, 2025
5c59ec2
Remove test
gbaraldi Sep 23, 2025
58327cc
CI 1.11: Use the 1.11-specific Buildkite branch (#59760)
DilumAluthge Oct 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite-external-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
main
release-julia-1.11
15 changes: 4 additions & 11 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ stackframe_lineinfo_color() = repl_color("JULIA_STACKFRAME_LINEINFO_COLOR", :bol
stackframe_function_color() = repl_color("JULIA_STACKFRAME_FUNCTION_COLOR", :bold)

function repl_cmd(cmd, out)
shell = shell_split(get(ENV, "JULIA_SHELL", get(ENV, "SHELL", "/bin/sh")))
shell_name = Base.basename(shell[1])

# Immediately expand all arguments, so that typing e.g. ~/bin/foo works.
cmd.exec .= expanduser.(cmd.exec)

Expand Down Expand Up @@ -64,19 +61,15 @@ function repl_cmd(cmd, out)
cd(dir)
println(out, pwd())
else
@static if !Sys.iswindows()
if shell_name == "fish"
shell_escape_cmd = "begin; $(shell_escape_posixly(cmd)); and true; end"
else
shell_escape_cmd = "($(shell_escape_posixly(cmd))) && true"
end
if !Sys.iswindows()
shell = shell_split(get(ENV, "JULIA_SHELL", get(ENV, "SHELL", "/bin/sh")))
shell_escape_cmd = shell_escape_posixly(cmd)
cmd = `$shell -c $shell_escape_cmd`
end
try
run(ignorestatus(cmd))
catch
# Windows doesn't shell out right now (complex issue), so Julia tries to run the program itself
# Julia throws an exception if it can't find the program, but the stack trace isn't useful
# Julia throws an exception if it can't find the cmd (which may be the shell itself), but the stack trace isn't useful
lasterr = current_exceptions()
lasterr = ExceptionStack([(exception = e[1], backtrace = [] ) for e in lasterr])
invokelatest(display_error, lasterr)
Expand Down
99 changes: 70 additions & 29 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2640,7 +2640,48 @@
end

# load a serialized file directly from append_bundled_depot_path for uuidkey without stalechecks
function require_stdlib(package_uuidkey::PkgId, ext::Union{Nothing, String}=nothing)
"""
require_stdlib(package_uuidkey::PkgId, [ext::String, from::Module])

!!! warning "May load duplicate copies of stdlib packages."

This requires that all stdlib packages loaded are compatible with having concurrent
copies of themselves loaded into memory. It also places additional restrictions on
the kinds of type-piracy that are allowed in stdlibs, since type-piracy can cause the
dispatch table to become visibly "torn" across multiple different packages.

The specific requirements are:

The import side (caller of `require_stdlib`) must not leak any stdlib types, esp.
to any context that may have a conflicting copy of the stdlib(s) (or vice-versa).
- e.g., if an output is forwarded to user code, it must contain only Base types.
- e.g., if an output contains types from the stdlib, it must be consumed "internally"
before reaching user code.

The imported code (loaded stdlibs) must be very careful about type piracy:
- It must not access any global state that may differ between stdlib copies in
type-pirated methods.
- It must not return any stdlib types from any type-pirated public methods (since
a loaded duplicate would overwrite the Base method again, returning different
types that don't correspond to the user-accessible copy of the stdlib).
- It must not pass / discriminate stdlib types in type-pirated methods, except
indirectly via methods defined in Base and implemented (w/o type-piracy) in
all copies of the stdlib over their respective types.

The idea behind the above restrictions is that any type-pirated methods in the stdlib
must return a result that is simultaneously correct for all of the stdlib's loaded
copies, including accounting for global state differences and split type identities.

Furthermore, any imported code must not leak any stdlib types to globals and containers
(e.g. Vectors and mutable structs) in upstream Modules, since this will also lead to
type-confusion when the type is later pulled out in user / stdlib code.

For examples of issues like the above, see:
[1] https://github.com/JuliaLang/Pkg.jl/issues/4017#issuecomment-2377589989
[2] https://github.com/JuliaLang/StyledStrings.jl/issues/91#issuecomment-2379602914
"""
require_stdlib(package_uuidkey::PkgId) = require_stdlib(package_uuidkey, nothing, Base)
function require_stdlib(package_uuidkey::PkgId, ext::Union{Nothing, String}, from::Module)
if generating_output(#=incremental=#true)
# Otherwise this would lead to awkward dependency issues by loading a package that isn't in the Project/Manifest
error("This interactive function requires a stdlib to be loaded, and package code should instead use it directly from that stdlib.")
Expand All @@ -2652,35 +2693,33 @@
if newm isa Module
return newm
end
# first since this is a stdlib, try to look there directly first
env = Sys.STDLIB
#sourcepath = ""
if ext === nothing
sourcepath = normpath(env, this_uuidkey.name, "src", this_uuidkey.name * ".jl")
else
sourcepath = find_ext_path(normpath(joinpath(env, package_uuidkey.name)), ext)
end
#mbypath = manifest_uuid_path(env, this_uuidkey)
#if mbypath isa String && isfile_casesensitive(mbypath)
# sourcepath = mbypath
#else
# # if the user deleted the stdlib folder, we next try using their environment
# sourcepath = locate_package_env(this_uuidkey)
# if sourcepath !== nothing
# sourcepath, env = sourcepath
# end
#end
#if sourcepath === nothing
# throw(ArgumentError("""
# Package $(repr("text/plain", this_uuidkey)) is required but does not seem to be installed.
# """))
#end
set_pkgorigin_version_path(this_uuidkey, sourcepath)
depot_path = append_bundled_depot_path!(empty(DEPOT_PATH))
newm = start_loading(this_uuidkey, UInt128(0), true)
newm === nothing || return newm
try
newm = _require_search_from_serialized(this_uuidkey, sourcepath, UInt128(0), false; DEPOT_PATH=depot_path)
depot_path = append_bundled_depot_path!(empty(DEPOT_PATH))
from_stdlib = true # set to false if `from` is a normal package so we do not want the internal loader for the extension either
if ext isa String
from_uuid = PkgId(from)
from_m = get(loaded_modules, from_uuid, nothing)
if from_m === from
# if from_uuid is either nothing or points to something else, assume we should use require_stdlib
# otherwise check cachepath for from to see if it looks like it is from depot_path, since try_build_ids
cachepath = get(PkgOrigin, pkgorigins, from_uuid).cachepath
entrypath, entryfile = cache_file_entry(from_uuid)
from_stdlib = any(x -> startswith(entrypath, x), depot_path)
end
end
if from_stdlib
# first since this is a stdlib, try to look there directly first
if ext === nothing
sourcepath = normpath(env, this_uuidkey.name, "src", this_uuidkey.name * ".jl")
else
sourcepath = find_ext_path(normpath(joinpath(env, package_uuidkey.name)), ext)
end
set_pkgorigin_version_path(this_uuidkey, sourcepath)
newm = start_loading(this_uuidkey, UInt128(0), true)
newm === nothing || return newm
newm = _require_search_from_serialized(this_uuidkey, sourcepath, UInt128(0), false; DEPOT_PATH=depot_path)
end
finally
end_loading(this_uuidkey, newm)
end
Expand All @@ -2690,10 +2729,12 @@
run_package_callbacks(this_uuidkey)
else
# if the user deleted their bundled depot, next try to load it completely normally
# if it is an extension, we first need to indicate where to find its parant via EXT_PRIMED

Check warning on line 2732 in base/loading.jl

View workflow job for this annotation

GitHub Actions / Check for new typos

perhaps "parant" should be "parent".
ext isa String && (EXT_PRIMED[this_uuidkey] = PkgId[package_uuidkey])
newm = _require_prelocked(this_uuidkey)
end
return newm
end
end # release lock
end


Expand Down
7 changes: 5 additions & 2 deletions base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,15 @@ function _sort!(v::UnwrappableSubArray, a::SubArrayOptimization, o::Ordering, kw
@getkw lo hi
# @assert v.stride1 == 1
parent = v.parent
if parent isa Array && !(parent isa Vector) && hi - lo < 100
if parent isa Array && !(parent isa Vector) && hi - lo < 100 || !iszero(v.offset1)
# vec(::Array{T, ≠1}) allocates and is therefore somewhat expensive.
# We don't want that for small inputs.

# Additionally, if offset1 is non-zero, then this optimization is incompatible with
# algorithms that track absolute first and last indices (e.g. ScratchQuickSort)
_sort!(v, a.next, o, kw)
else
_sort!(vec(parent), a.next, o, (;kw..., lo = lo + v.offset1, hi = hi + v.offset1))
_sort!(vec(parent), a.next, o, kw)
end
end

Expand Down
4 changes: 2 additions & 2 deletions base/strings/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ An error occurred when trying to access `str` at index `i` that is not valid.
"""
struct StringIndexError <: Exception
string::AbstractString
index::Integer
index::Int
end
@noinline string_index_err(s::AbstractString, i::Integer) =
@noinline string_index_err((@nospecialize s::AbstractString), i::Integer) =
throw(StringIndexError(s, Int(i)))
function Base.showerror(io::IO, exc::StringIndexError)
s = exc.string
Expand Down
Loading