Skip to content

Commit d1406fb

Browse files
authored
Backports for 1.12.3 (#60225)
2 parents 708662c + 7c7d8d6 commit d1406fb

File tree

60 files changed

+317
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+317
-165
lines changed

Make.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ $(foreach D,build_libdir build_private_libdir,$(eval $(call cache_rel_path,$(D),
381381
# Save a special one: reverse_private_libdir_rel: usually just `../`, but good to be general:
382382
reverse_private_libdir_rel_eval = $(call rel_path,$(private_libdir),$(libdir))
383383
reverse_private_libdir_rel = $(call hit_cache,reverse_private_libdir_rel_eval)
384+
reverse_private_libexecdir_rel_eval = $(call rel_path,$(private_libexecdir),$(libdir))
385+
reverse_private_libexecdir_rel = $(call hit_cache,reverse_private_libexecdir_rel_eval)
386+
reverse_build_private_libexecdir_rel_eval = $(call rel_path,$(build_private_libexecdir),$(build_libdir))
387+
reverse_build_private_libexecdir_rel = $(call hit_cache,reverse_build_private_libexecdir_rel_eval)
384388

385389
INSTALL_F := $(JULIAHOME)/contrib/install.sh 644
386390
INSTALL_M := $(JULIAHOME)/contrib/install.sh 755

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ New language features
2929
* `Threads.@spawn` now takes a `:samepool` argument to specify the same threadpool as the caller.
3030
`Threads.@spawn :samepool foo()` which is shorthand for `Threads.@spawn Threads.threadpool() foo()` ([#57109]).
3131
* The `@ccall` macro can now take a `gc_safe` argument, that if set to true allows the runtime to run garbage collection concurrently to the `ccall` ([#49933]).
32+
* A single method covering multiple functions is now allowed in more cases. See issue #54620. ([#58131]).
33+
* The character U+1F8B2 🢲 (RIGHTWARDS ARROW WITH LOWER HOOK), newly added by Unicode 16,
34+
is now a valid operator with arrow precedence, accessible as `\hookunderrightarrow` at the REPL.
35+
([JuliaLang/JuliaSyntax.jl#525], [#57143]).
3236

3337
Language changes
3438
----------------
@@ -289,5 +293,8 @@ Tooling Improvements
289293
[#57081]: https://github.com/JuliaLang/julia/issues/57081
290294
[#57087]: https://github.com/JuliaLang/julia/issues/57087
291295
[#57109]: https://github.com/JuliaLang/julia/issues/57109
296+
[#57143]: https://github.com/JuliaLang/julia/issues/57143
292297
[#57253]: https://github.com/JuliaLang/julia/issues/57253
293298
[#57727]: https://github.com/JuliaLang/julia/issues/57727
299+
[#58131]: https://github.com/JuliaLang/julia/issues/58131
300+
[JuliaLang/JuliaSyntax.jl#525]: https://github.com/JuliaLang/JuliaSyntax.jl/pull/525

base/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ endif
7171
@printf "%s\n" "const PRIVATE_LIBDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(private_libdir_rel)))) >> $@
7272
@printf "%s\n" "const PRIVATE_LIBEXECDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(private_libexecdir_rel)))) >> $@
7373
@printf "%s\n" "const INCLUDEDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(includedir_rel)))) >> $@
74+
@printf "%s\n" "const SOURCEDIR = "$(call shell_escape,$(call julia_escape,$(call normalize_path,$(shell echo $(call cygpath_w,$(JULIAHOME)))))) >> $@
7475
ifeq ($(DARWIN_FRAMEWORK), 1)
7576
@printf "%s\n" "const DARWIN_FRAMEWORK = true" >> $@
7677
@printf "%s\n" "const DARWIN_FRAMEWORK_NAME = \"$(FRAMEWORK_NAME)\"" >> $@

base/array.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,10 +1076,10 @@ function _growbeg!(a::Vector, delta::Integer)
10761076
len = length(a)
10771077
offset = memoryrefoffset(ref)
10781078
newlen = len + delta
1079-
setfield!(a, :size, (newlen,))
10801079
# if offset is far enough advanced to fit data in existing memory without copying
10811080
if delta <= offset - 1
10821081
setfield!(a, :ref, @inbounds memoryref(ref, 1 - delta))
1082+
setfield!(a, :size, (newlen,))
10831083
else
10841084
@noinline (function()
10851085
@_terminates_locally_meta
@@ -1111,6 +1111,7 @@ function _growbeg!(a::Vector, delta::Integer)
11111111
end
11121112
setfield!(a, :ref, @inbounds memoryref(newmem, newoffset))
11131113
end)()
1114+
setfield!(a, :size, (newlen,))
11141115
end
11151116
return
11161117
end
@@ -1125,7 +1126,6 @@ function _growend!(a::Vector, delta::Integer)
11251126
len = length(a)
11261127
newlen = len + delta
11271128
offset = memoryrefoffset(ref)
1128-
setfield!(a, :size, (newlen,))
11291129
newmemlen = offset + newlen - 1
11301130
if memlen < newmemlen
11311131
@noinline (function()
@@ -1156,6 +1156,7 @@ function _growend!(a::Vector, delta::Integer)
11561156
setfield!(a, :ref, newref)
11571157
end)()
11581158
end
1159+
setfield!(a, :size, (newlen,))
11591160
return
11601161
end
11611162

@@ -1173,7 +1174,6 @@ function _growat!(a::Vector, i::Integer, delta::Integer)
11731174
memlen = length(mem)
11741175
newlen = len + delta
11751176
offset = memoryrefoffset(ref)
1176-
setfield!(a, :size, (newlen,))
11771177
newmemlen = offset + newlen - 1
11781178

11791179
# which side would we rather grow into?
@@ -1183,11 +1183,13 @@ function _growat!(a::Vector, i::Integer, delta::Integer)
11831183
newref = @inbounds memoryref(mem, offset - delta)
11841184
unsafe_copyto!(newref, ref, i)
11851185
setfield!(a, :ref, newref)
1186+
setfield!(a, :size, (newlen,))
11861187
for j in i:i+delta-1
11871188
@inbounds _unsetindex!(a, j)
11881189
end
11891190
elseif !prefer_start && memlen >= newmemlen
11901191
unsafe_copyto!(mem, offset - 1 + delta + i, mem, offset - 1 + i, len - i + 1)
1192+
setfield!(a, :size, (newlen,))
11911193
for j in i:i+delta-1
11921194
@inbounds _unsetindex!(a, j)
11931195
end
@@ -1201,6 +1203,7 @@ function _growat!(a::Vector, i::Integer, delta::Integer)
12011203
unsafe_copyto!(newref, ref, i-1)
12021204
unsafe_copyto!(newmem, newoffset + delta + i - 1, mem, offset + i - 1, len - i + 1)
12031205
setfield!(a, :ref, newref)
1206+
setfield!(a, :size, (newlen,))
12041207
end
12051208
end
12061209

@@ -1213,11 +1216,11 @@ function _deletebeg!(a::Vector, delta::Integer)
12131216
@inbounds _unsetindex!(a, i)
12141217
end
12151218
newlen = len - delta
1219+
setfield!(a, :size, (newlen,))
12161220
if newlen != 0 # if newlen==0 we could accidentally index past the memory
12171221
newref = @inbounds memoryref(a.ref, delta + 1)
12181222
setfield!(a, :ref, newref)
12191223
end
1220-
setfield!(a, :size, (newlen,))
12211224
return
12221225
end
12231226
function _deleteend!(a::Vector, delta::Integer)

base/initdefs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const DEPOT_PATH = String[]
9797
function append_bundled_depot_path!(DEPOT_PATH)
9898
path = abspath(Sys.BINDIR, "..", "local", "share", "julia")
9999
path in DEPOT_PATH || push!(DEPOT_PATH, path)
100-
path = abspath(Sys.BINDIR, "..", "share", "julia")
100+
path = abspath(Sys.BINDIR, Base.DATAROOTDIR, "julia")
101101
path in DEPOT_PATH || push!(DEPOT_PATH, path)
102102
return DEPOT_PATH
103103
end

base/loading.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ function locate_package_env(pkg::PkgId, stopenv::Union{String, Nothing}=nothing)
462462
path = manifest_uuid_path(env, pkg)
463463
# missing is used as a sentinel to stop looking further down in envs
464464
if path === missing
465+
# Before stopping, try stdlib fallback
466+
is_stdlib(pkg) && @goto stdlib_fallback
465467
path = nothing
466468
@goto done
467469
end
@@ -473,6 +475,7 @@ function locate_package_env(pkg::PkgId, stopenv::Union{String, Nothing}=nothing)
473475
stopenv == env && break
474476
end
475477
end
478+
@label stdlib_fallback
476479
# Allow loading of stdlibs if the name/uuid are given
477480
# e.g. if they have been explicitly added to the project/manifest
478481
mbypath = manifest_uuid_path(Sys.STDLIB, pkg)

base/methodshow.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function fixup_stdlib_path(path::String)
140140
if isdefined(@__MODULE__, :Core) && isdefined(Core, :Compiler)
141141
compiler_folder = dirname(String(Base.moduleloc(Core.Compiler).file))
142142
if dirname(path) == compiler_folder
143-
return abspath(Sys.STDLIB, "..", "..", "Compiler", "src", basename(path))
143+
return abspath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "Compiler", "src", basename(path))
144144
end
145145
end
146146
end

base/sysinfo.jl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export BINDIR,
1414
MACHINE,
1515
KERNEL,
1616
JIT,
17+
PAGESIZE,
1718
cpu_info,
1819
cpu_summary,
1920
uptime,
@@ -39,7 +40,7 @@ export BINDIR,
3940
which,
4041
detectwsl
4142

42-
import ..Base: show
43+
import ..Base: DATAROOTDIR, show
4344

4445
"""
4546
Sys.BINDIR::String
@@ -53,12 +54,10 @@ global BINDIR::String = ccall(:jl_get_julia_bindir, Any, ())::String
5354
5455
A string containing the full path to the directory containing the `stdlib` packages.
5556
"""
56-
global STDLIB::String = "$BINDIR/../share/julia/stdlib/v$(VERSION.major).$(VERSION.minor)" # for bootstrap
57+
global STDLIB::String = "$BINDIR/$DATAROOTDIR/julia/stdlib/v$(VERSION.major).$(VERSION.minor)" # for bootstrap
5758
# In case STDLIB change after julia is built, the variable below can be used
5859
# to update cached method locations to updated ones.
5960
const BUILD_STDLIB_PATH = STDLIB
60-
# Similarly, this is the root of the julia repo directory that julia was built from
61-
const BUILD_ROOT_PATH = "$BINDIR/../.."
6261

6362
# helper to avoid triggering precompile warnings
6463

@@ -143,6 +142,13 @@ Note: Included in the detailed system information via `versioninfo(verbose=true)
143142
"""
144143
global JIT::String
145144

145+
"""
146+
Sys.PAGESIZE::Clong
147+
148+
A number providing the pagesize of the given OS. Common values being 4kb or 64kb on Linux.
149+
"""
150+
global PAGESIZE::Clong
151+
146152
function __init__()
147153
env_threads = nothing
148154
if haskey(ENV, "JULIA_CPU_THREADS")
@@ -161,6 +167,7 @@ function __init__()
161167
global SC_CLK_TCK = ccall(:jl_SC_CLK_TCK, Clong, ())
162168
global CPU_NAME = ccall(:jl_get_cpu_name, Ref{String}, ())
163169
global JIT = ccall(:jl_get_JIT, Ref{String}, ())
170+
global PAGESIZE = Int(Sys.isunix() ? ccall(:jl_getpagesize, Clong, ()) : ccall(:jl_getallocationgranularity, Clong, ()))
164171
__init_build()
165172
nothing
166173
end
@@ -169,7 +176,7 @@ end
169176
function __init_build()
170177
global BINDIR = ccall(:jl_get_julia_bindir, Any, ())::String
171178
vers = "v$(string(VERSION.major)).$(string(VERSION.minor))"
172-
global STDLIB = abspath(BINDIR, "..", "share", "julia", "stdlib", vers)
179+
global STDLIB = abspath(BINDIR, DATAROOTDIR, "julia", "stdlib", vers)
173180
nothing
174181
end
175182

contrib/generate_precompile.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
348348
uuid = "$pkguuid"
349349
""")
350350
touch(joinpath(pkgpath, "Manifest.toml"))
351-
tmp_prec = tempname(prec_path)
352-
tmp_proc = tempname(prec_path)
351+
tmp_prec = tempname(prec_path; cleanup=false)
352+
tmp_proc = tempname(prec_path; cleanup=false)
353353
s = """
354354
pushfirst!(DEPOT_PATH, $(repr(joinpath(prec_path,"depot"))));
355355
Base.PRECOMPILE_TRACE_COMPILE[] = $(repr(tmp_prec));

contrib/mac/app/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ dmg/$(APP_NAME): startup.applescript julia.icns
4747
plutil -insert CFBundleVersion -string "$(JULIA_VERSION_OPT_COMMIT)" $@/Contents/Info.plist
4848
plutil -insert NSHumanReadableCopyright -string "$(APP_COPYRIGHT)" $@/Contents/Info.plist
4949
-mkdir -p $@/Contents/Resources/julia
50-
make -C $(JULIAHOME) binary-dist
51-
tar zxf $(JULIAHOME)/$(JULIA_BINARYDIST_FILENAME).tar.gz -C $@/Contents/Resources/julia --strip-components 1
50+
$(MAKE) -C $(JULIAHOME) binary-dist
51+
$(TAR) -xzf $(JULIAHOME)/$(JULIA_BINARYDIST_FILENAME).tar.gz -C $@/Contents/Resources/julia --strip-components 1
5252
find $@/Contents/Resources/julia -type f -exec chmod -w {} \;
5353
# Even though the tarball may already be signed, we re-sign here to make it easier to add
5454
# unsigned executables (like the app launcher) and whatnot, without needing to maintain lists

0 commit comments

Comments
 (0)