Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports for 1.10.0-rc2 #52045

Merged
merged 38 commits into from
Dec 2, 2023
Merged

Backports for 1.10.0-rc2 #52045

merged 38 commits into from
Dec 2, 2023

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Nov 6, 2023

Backported PRs:

Need manual backport:

Contains multiple commits, manual intervention needed:

Non-merged PRs with backport label:

maleadt and others added 8 commits November 6, 2023 13:29
`jl_errorexception_type` is undefined at the point we (fail to) load a
sysimg.

(cherry picked from commit 20a5fa7)
This is required now once Distributed is not in the sysimage.

Fixes https://github.com/JuliaLang/julia/issues/51756

(cherry picked from commit 795d8d7)
This aligns their behavior with manual calls to `finalize(o)`, and
prepares for a future time in which these functions are always run on a
separate thread. This means that they can wait to acquire locks in this
context, which otherwise would have been denied to them.

(cherry picked from commit c54a3f2)
Can cause spurious warnings about not closing these properly and
unexpected events to appear after `close` returns.

(cherry picked from commit d0c4284)
…dispatch (#51995)

The artifacts dict is not lowered to ensure_artifact_installed which
causes to load the ".toml" during runtime for lazy artifacts

(cherry picked from commit 9bc6994)
@KristofferC KristofferC added the release Release management and versioning. label Nov 6, 2023
nalimilan and others added 6 commits November 9, 2023 11:13
This bumps Statistics to the latest commit of the release-1.10 branch in
order to backport JuliaStats/Statistics.jl#153.

See JuliaData/DataFrames.jl#3383. Cc: @bkamins
@George9000
This avoids a crashes where we run the destructors because C++ is fun
and runs destructors before thread exit.

(cherry picked from commit 3d88550)
…#50207)

Suggested by @vchuravy.

---------

Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 2adf54a)
Two chagnes wrapped into one `Base.copymutable` => `Base.copymutable` &
`collect` and `Base.copymutable` => `similar` & words.

Followup for #52086 and #46104; also fixes #51932 (though we still may
want to make `copymutable` public at some point)

---------

Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 42c088b)
This fixes a whole bunch of small but annoying bugs, as described in the
JuliaSyntax-0.4.7 release notes

https://github.com/JuliaLang/JuliaSyntax.jl/releases/tag/v0.4.7

I've been careful about cutting the JuliaSyntax-0.4.7 release from
nonbreaking changes, so we should be able to backport this to 1.10.

---

Extended notes about compatibility
* The public keyword in
JuliaLang/JuliaSyntax.jl#320 is released in
JuliaSyntax-0.4.7 but JuliaSyntax is multi-version aware so this is
disabled when used as the default parser in Julia 1.10, but is enabled
in 1.11-DEV. So should be backportable.
* We aim for parsing to `Expr` to always be stable in JuliaSyntax and
independent of the host Julia `VERSION`, but we're not fully there yet
for 1.11 / 1.10 due to
JuliaLang/JuliaSyntax.jl#377. Thus some
careful management of the JuliaSyntax-0.4.x branch for now.

(cherry picked from commit 85d7cca)
@ViralBShah
Copy link
Member

ViralBShah commented Nov 21, 2023

We need #51725 here (Basically everything in that PR except for the SparseArrays version bump)

gbaraldi and others added 12 commits November 27, 2023 09:46
…aces (#51520)

On AMDGPU, this was generating a `addrspace(10)` pointer to an `alloca`
which is illegal and lead to other issues.

(cherry picked from commit af9a7af)
Fixes #51985

Ensure that the REPL completions escape and unescape text correctly,
using the correct functions, and accounting for exactly what the user
has currently typed.

The old broken method is left around for Pkg, since it has an
over-reliance on it returning incorrect answers. Once Pkg is fixed, we
can delete that code.

Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 5edcdc5)
Currently the interpreter always returns false. Which isn't very good.
Make it follow whatever the JIT will do.

(cherry picked from commit a6c656e)
#49559 by @JeffBezanson updated `src/flisp/julia_charmap.h` but missed
[the
comment](https://github.com/JuliaLang/julia/blob/164969f3d06919b073f3aa9ee608e40974ca82d9/src/flisp/julia_charmap.h#L5-L6)
noting that `base/strings/unicode.jl` has to be updated accordingly.

(cherry picked from commit 05f4b05)
…#51371)

~This is just me proposing a suggestion from @KristofferC in
https://discourse.julialang.org/t/debug-has-massive-performance-impact/103974/22,
it's all his code / idea, not mine.~

This PR makes it so that on windows, we pre-allocate an `IdDict` and
every time someone looks up environment variables (motivating example
here is `@debug` statements), we store the result of
`cwstring(::String)` in that `IdDict` so that it doesn't need to be
re-computed for future uses.

The idea behind this is that people have observed that [using `@debug`
is significantly more costly on Windows than other
platforms](https://discourse.julialang.org/t/debug-has-massive-performance-impact/103974),
even though we have documented in that manual that it should be a really
cheap operation. @KristofferC suggests this is due to the fact that
[checking environment variables in Windows is more
costly](https://discourse.julialang.org/t/debug-has-massive-performance-impact/103974/18).

~The idea here is that we preallocate a `Cwstring` on Windows that just
holds the text `"JULIA_DEBUG"`, so that if `access_env(f,
"JULIA_DEBUG")` gets called, we don't need to create a new `Cwstring`
and then throw it away each time.~

---------

Co-authored-by: Ian Butterworth <[email protected]>
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 9dcedaa)
Co-authored-by: Lilith Orion Hafner <[email protected]>
(cherry picked from commit 1cb85ad)
…aching (#52214)

Fixes #52213

Overwritting methods during cache creation is currently not something
that the system
can support and can lead to surprising, counter-intuitive and fatal
errors.

In 1.10 we turned it from a warning to a strong error, with this PR it
remains
a strong error, but the precompilation system recognizes it and
essentially sets `__precompile__(false)`
for this module and all modules that depend on it.

Before:
```
julia> using OverwriteMethodError
[ Info: Precompiling OverwriteMethodError [top-level]
WARNING: Method definition +(Bool, Bool) in module Base at bool.jl:166 overwritten in module OverwriteMethodError at /home/vchuravy/src/julia2/OverwriteMethodError.jl:2.
ERROR: LoadError: Method overwriting is not permitted during Module precompile.
Stacktrace:
 [1] top-level scope
   @ ~/src/julia2/OverwriteMethodError.jl:2
 [2] include
   @ Base ./Base.jl:489 [inlined]
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base ./loading.jl:2216
 [4] top-level scope
   @ stdin:3
in expression starting at /home/vchuravy/src/julia2/OverwriteMethodError.jl:1
in expression starting at stdin:3
ERROR: Failed to precompile OverwriteMethodError [top-level] to "/home/vchuravy/.julia/compiled/v1.10/jl_guiuCQ".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2462
  [3] compilecache
    @ Base ./loading.jl:2334 [inlined]
  [4] (::Base.var"#968#969"{Base.PkgId})()
    @ Base ./loading.jl:1968
  [5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0-rc1+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
  [6] #mkpidlock#6
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0-rc1+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
  [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0-rc1+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
  [8] #invokelatest#2
    @ Base ./essentials.jl:889 [inlined]
  [9] invokelatest
    @ Base ./essentials.jl:884 [inlined]
 [10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:2977
 [11] maybe_cachefile_lock
    @ Base ./loading.jl:2974 [inlined]
 [12] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1964
 [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1806
 [14] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [15] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1797
 [17] macro expansion
    @ Base ./loading.jl:1784 [inlined]
 [18] macro expansion
    @ Base ./lock.jl:267 [inlined]
 [19] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1747
 [20] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [21] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [22] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1740
```

After:
```
julia> using OverwriteMethodError
┌ Info: Precompiling OverwriteMethodError [top-level]
└ @ Base loading.jl:2486
WARNING: Method definition +(Bool, Bool) in module Base at bool.jl:166 overwritten in module OverwriteMethodError at /home/vchuravy/src/julia2/OverwriteMethodError.jl:2.
ERROR: Method overwriting is not permitted during Module precompile.
┌ Info: Skipping precompilation since __precompile__(false). Importing OverwriteMethodError [top-level].
└ @ Base loading.jl:2084
```

---------

Co-authored-by: Kristoffer Carlsson <[email protected]>
(cherry picked from commit 9e8fe68)
This is #50914, with only the documentation changes, plus an improvement
to the warning message.

---------

Co-authored-by: Tim Holy <[email protected]>
Co-authored-by: Ian Butterworth <[email protected]>
(cherry picked from commit 6d5787a)
Co-authored-by: Prem Chintalapudi <[email protected]>
(cherry picked from commit 341e9d0)
@KristofferC
Copy link
Member Author

We need #51725 here (Basically everything in that PR except for the SparseArrays version bump)

I think this was already done for rc1?

5ded9ab

Anyway, it would be better for the SparseArrays.jl maintainers to push updates to that package to this branch because it has gotten a bit confusing to me what should be included and not etc.

@N5N3 N5N3 force-pushed the backports-release-1.10 branch from dce3bce to d295d7c Compare November 27, 2023 12:45
aviatesk and others added 6 commits November 27, 2023 15:23
…l expression (#51834)

fix #51827

---------

Co-authored-by: Kristoffer Carlsson <[email protected]>
(cherry picked from commit 3b1ba62)
In `jl_print_task_backtraces()`. Follow-on to
#51430.

(cherry picked from commit cde964f)
Teach value_to_pointer to convert primitive types to their stored
representation first, to avoid exposing undef bits later (via memcpy).

Take this opportunity to also generalizes the support for zext Bool to
anywhere inside any struct for changing any bitwidth to a multiple of 8
bytes. This would change a vector like <2 x i4> from occupying i8 to i16
(c.f. LLVM's LangRef), if such an operation were expressible in Julia
today. And take this opportunity to do a bit of code cleanup, now that
codegen is better and using helpers from LLVM.

Fixes #52127

(cherry picked from commit 9aa7980)
…#51035)

Removes some redundant code.

Credits to Eduardo for pointing this out in the GC meeting.

(cherry picked from commit 5bc558c)
So after struggling with this for a long while it seems there were two
different issues. The first one we lacked coverage over, but the other
was a very subtle issue when we sorted the fptrs.

~I still need to add test that does multiversioning where we call
between multiversioned functions~

Fixes #52079

(cherry picked from commit a386cd1)
@ViralBShah
Copy link
Member

@dkarrasch Would it be possible for you to pull in SparseArrays? My understanding is that we should be pulling in whatever is the top of the 1.10 release branch on SparseArrays.jl.

@KristofferC KristofferC force-pushed the backports-release-1.10 branch from d295d7c to 46617e5 Compare November 27, 2023 14:54
@KristofferC
Copy link
Member Author

My understanding is that we should be pulling in whatever is the top of the 1.10 release branch on SparseArrays.jl.

Yes, that was done in 5ded9ab. I updated it now to include JuliaSparse/SparseArrays.jl#477

@KristofferC
Copy link
Member Author

@nanosoldier runtests()

@nanosoldier
Copy link
Collaborator

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

@KristofferC
Copy link
Member Author

@nanosoldier runtests(["OneRule", "Onda", "MultivariateOrthogonalPolynomials", "ITensorVisualizationBase", "LocalSearchSolvers", "NetcdfIO", "ScientificTypes", "SolverBenchmark", "AbnormalReturns", "SMLMMetrics", "Trading", "AntennaPattern", "SimpleBio", "QUnfold", "MosimoBase", "MatrixImpute", "RobustModels", "QuartetNetworkGoodnessFit", "SchwarzChristoffel", "CategoricalDistributions", "GMT", "PQBaseCamp", "FlexiJoins", "Agents", "Express", "LIBSVM", "LinearRegressionKit", "SoilHydraulics", "SingularIntegrals", "Constraints", "SemiclassicalOrthogonalPolynomials", "Feather", "FrankWolfe", "Normalization", "AoGExtensions", "GeoStatsBase", "HybridArrays", "ONSAS", "MLJTestIntegration", "OrdinalMultinomialModels", "DIVAnd", "MLJ", "TSML", "Equate", "GeoArtifacts", "FreqTables", "Wordlegames", "PoreMatMod", "SoleLogics", "SimpleSDMDatasets", "MembraneEOS", "Attractors", "PauliPopRec", "SeasonalTrendLoess", "Compat", "GroupedTemporalTerms", "VegaLite", "ModiaResult", "Pandas", "JDF", "JuliaBUGS", "DiscretePIDs", "CmdStan", "MIPVerify", "Bio3DView", "GeoDataFrames", "EHTUVData", "Geotherm", "GenerativeTopographicMapping", "Unfolding", "Consensus", "SemanticSpaces", "SaguaroTrader", "SensitivityRankCondition", "ARDESPOT", "BioMart", "TextAnalysis", "ForecastData", "GlobalSensitivity", "GEMPIC", "NASAPrecipitation", "NISTStatisticalReferenceData", "JET", "StoppingInterface", "MicroCanonicalHMC", "CBLS", "Santiago", "BHAtp", "GeoStatsModels", "PiecewiseOrthogonalPolynomials", "HMMER", "SaguaroTraderResults", "Extremes", "FlexiMaps", "TreeParzen", "PortfolioAnalytics", "MultiwayNumberPartitioning", "QuandlAccess", "PubChemCrawler", "TexTables", "OSMToolset", "PointCloudRasterizers", "MonolithicFEMVLFS", "StatisticalMeasures", "DiffEqFinancial", "Petri", "OptimizationOptimJL"])

@nanosoldier
Copy link
Collaborator

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

…gnment (#52182)

The llvm optimizations may increase alignment beyond the initial
MAX_ALIGN. This pool's alignment was previously only `sizeof(struct {
atomic<int> RefCount; size_t Length; char Data[]; })` however,
potentially resulting in segfaults at runtime.

Fixes #52118. Should make CI much happier.

(cherry picked from commit a65bc9a)
Helps to short-circuit calls to large splat calls, since those have all
the same type elements.

Fixes #51011

(cherry picked from commit 3527213)
@KristofferC KristofferC merged commit d9da975 into release-1.10 Dec 2, 2023
7 checks passed
@KristofferC KristofferC deleted the backports-release-1.10 branch December 2, 2023 19:15
@KristofferC
Copy link
Member Author

There are a few new ambiguities related to vcat which is a bit unfortunate but not 100% sure what should be done about that (cc @vtjnash). For now, I think we need to get a new pre-release out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Release management and versioning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.