Skip to content

Backports for 1.12.0-beta2 #58009

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

Merged
merged 38 commits into from
Apr 25, 2025
Merged

Backports for 1.12.0-beta2 #58009

merged 38 commits into from
Apr 25, 2025

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Apr 4, 2025

Backported PRs:

Need manual backport:

Non-merged PRs with backport label:

nsajko and others added 3 commits April 4, 2025 10:52
Makes the sysimage more resistant to method invalidation, when defining
a new `Integer` subtype with a right bitshift method.

(cherry picked from commit 69a22cf)
… defined) (#57925)

Fixes a discrepancy between the code in C before #57230 and in Julia
afterwards, making sure to sequence these method definitions correctly.
Not sure how to write a reliable test since it is specific to when this
generated function is defined relative to the helpers used by this
thunk, but the issue/fix is visible with:

```
$ ./julia -e 'code_lowered(ntuple, (Returns{Nothing}, Val{1000000}))'
```

Fix #57301

(cherry picked from commit a3c48d7)
Without this change `prevpow` and `nextpow` fail for, e.g., `BigInt`;
incorrectly throwing a `MethodError`. For example, calls like
`prevpow(3, big"10")` or `nextpow(3, big"10")` fail.

The issue is that the code incorrectly assumes the existence of a
`typemax` method.

Another issue was a missing promote for the arguments of a
`mul_with_overflow` call.

Fixes #57906

(cherry picked from commit 3627a85)
@KristofferC KristofferC added the release Release management and versioning. label Apr 4, 2025
Heptazhou and others added 19 commits April 5, 2025 21:44
… to 4e7c3f4 (#58031)

Stdlib: LinearAlgebra
URL: https://github.com/JuliaLang/LinearAlgebra.jl.git
Stdlib branch: release-1.12
Julia branch: backports-release-1.12
Old commit: f0f7a46
New commit: 4e7c3f4
Julia version: 1.12.0-beta1
LinearAlgebra version: 1.12.0
Bump invoked by: @dkarrasch
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/LinearAlgebra.jl@f0f7a46...4e7c3f4

```
$ git log --oneline f0f7a46..4e7c3f4
4e7c3f4 Backports release v1.12 (#1237)
e909af2 Before running any `@allocations` tests, run the workload
2ce3f73 Move `alg` to a keyword argument in symmetric eigen (#1214)
4f203c3 Make use of `mul` indirection (#1215)
```

Co-authored-by: dkarrasch <26658441+dkarrasch@users.noreply.github.com>
After #55575, inference for basic statements got inlined
into `typeinf_local`. But external abstract interpreters like JET.jl
need to overload this inference to customize this behavior. So this
commit extracts the inlined inference logic back out into a separate
`abstract_eval_basic_statement` method.
Edge invalidations of the form

```julia
Package InvalidA:
module InvalidA
f(::Integer) = 1
invokesfs(x) = invoke(f, Tuple{Signed}, x)
end

Package InvalidB:
module InvalidB
using InvalidA
InvalidA.invokesfs(1)   # precompile
end
```

used as

```julia
using PkgA
InvalidA.f(::Signed) = 4
using PkgB
```

did not formerly attribute a "cause":

```
...
Tuple{typeof(InvalidA.f), Signed}
 "insert_backedges_callee"
 CodeInstance for MethodInstance for InvalidA.invokesfs(::Int64)
 nothing
...
```

This fills in the new method that replaced the previous dispatch.

---------

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
(cherry picked from commit 15e0deb)
Closes #57376
Closes #34037

- Adds a lock in `SimpleLogger` and `ConsoleLogger` for use on maxlog
tracking and stream writes to improve threadsafety.
Closely similar to #54497

- Turns the internal `_min_enabled_level` into a `Threads.Atomic`. There
are [some direct
interactions](https://juliahub.com/ui/Search?type=code&q=_min_enabled_level&w=true)
to this internal in the ecosystem, but they should still work
```
julia> Base.CoreLogging._min_enabled_level[] = Logging.Info+1
LogLevel(1)
```

- Brings tests over from #57448

Performance seems highly similar:

### Master
```
julia> @time for i in 1:10000
          @info "foo" maxlog=10000000
       end
[ Info: foo
...
  0.481446 seconds (1.33 M allocations: 89.226 MiB, 0.49% gc time)
```

### This PR
```
  0.477235 seconds (1.31 M allocations: 79.002 MiB, 1.77% gc time)
```

(cherry picked from commit 9af9650)
- Use `local` where variable names accidentally overlapped and caused
boxes
- Use `@lock` to avoid closures
- Move out some recursive closures to top-level normal function to avoid
boxing them
- Use explicit boxes (`Ref`) instead of relying on the typeassert on the
`Core.Box` because it it hard to determine if a `Core.Box` is benign or
not.
- Only assign to `io` once to avoid boxing it.
- Type assert some `Tuple{Int, Int}` on `IO`.

The two remaining boxes after this is `t_print` and `monitor_std`.

(cherry picked from commit 4a3eba3)
By moving the optional `assume_bindings_static` refinement logic into
`abstract_eval_partition_load` and removing the redirect via
`abstract_eval_globalref_partition`.
Also adds test cases with `assume_bindings_static=true`.
GNU MPFR version 4.2.2 was released on 20 March 2025.

Fix #57945

---------

Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com>
(cherry picked from commit 9d4e31f)
…e_dispatch` (#58011)

Matches `@time` `@profile` etc.

(cherry picked from commit 1117df6)
Also a couple builtins had the wrong function name in their error
messages.
fix #58013

(cherry picked from commit 90eb96f)
Also changed the check to compare against the tuple argument, instead of
against the method static parameter for the tuple length. Should be
better when the length isn't known at compile time.

Fixes #58085

(cherry picked from commit b265dba)
We already have an excellent framework for selective code reuse, so use
that tool instead of a sledgehammer for inserting selective coverage and
malloc instrumentation. As a small bonus, this should also be
significantly more accurate by not being vulnerable to precompilation
inserting incorrect (uninstrumented) contents into the caches.

(cherry picked from commit 5fedf47)
Fixes #57962

This reverts the changes to `skip` added in #57570

The code before #57570 was written in a very specific way to avoid
overflow errors, so I'm not sure why this was changed.

(cherry picked from commit b29c808)
I've created an [Install](https://julialang.org/install/) page separate
from the [Downloads](https://julialang.org/downloads/) page on the
website. This updates various references to point to the correct pages.

(cherry picked from commit 48660a6)
@KristofferC KristofferC force-pushed the backports-release-1.12 branch from fd8213d to 9d454dc Compare April 16, 2025 13:41
@KristofferC KristofferC self-assigned this Apr 16, 2025
kpamnany and others added 4 commits April 16, 2025 15:43
A Julia thread runs Julia's scheduler in the context of the switching
task. If no task is found to switch to, the thread will sleep while
holding onto the (possibly completed) task, preventing the task from
being garbage collected. This recent [Discourse
post](https://discourse.julialang.org/t/weird-behaviour-of-gc-with-multithreaded-array-access/125433)
illustrates precisely this problem.

A solution to this would be for an idle Julia thread to switch to a
"scheduler" task, thereby freeing the old task.

This PR uses `OncePerThread` to create a "scheduler" task (that does
nothing but run `wait()` in a loop) and switches to that task when the
thread finds itself idle.

Other approaches considered and discarded in favor of this one:
#57465 and
#57543.

(cherry picked from commit 0d4d6d9)
This unfortunately passed tests because it segfaults (sometimes) on
another thread while the main thread successfully executes. Soon we'll
have a general solution for tasks but this fixes it for now.

(cherry picked from commit df1b07e)
For model simplicity (and eventually for better unspecialized
compilation), try to backdate initial module operations back to world 0
if nobody could have observed them before (no using statements depend
on the module yet), rather than putting each incremental operation in a
separate, but unobserved (and unobservable) world increment.

(cherry picked from commit 3e063f6)
After:
```
julia> convert(Core.Binding, GlobalRef(Base, :Intrinsics))
Binding Base.Intrinsics
   617:∞ - implicit `using` resolved to constant Core.Intrinsics
   0:616 - undefined binding - guard entry

julia> convert(Core.Binding, GlobalRef(Base, :Math))
Binding Base.Math
   22128:∞ - constant binding to Base.Math
   0:22127 - backdated constant binding to Base.Math
```

There is a bit of trickiness here. In particular, the question is, "when
do we check" whether the partition next to the one we currently looked
at happens to have the same implicit resolution as our current one. The
most obvious answer is that we should do it on access, but in practice
that would require essentially scanning back and considering every
possible world age state at every lookup. This is undesirable - the
lookup is not crazy expensive, but it can add up and most world ages we
never touch, so it is also wasteful.

This instead implements a different approach where we only perform the
resolution for world ages that somebody actually asked about, but can
then subsequently merge partitions if we do find that they are
identical. The logic for that is a bit involved, since we need to be
careful to keep the datastructure valid at every point, but does address
the issue.

Fixes #57923

(cherry picked from commit 1c3878c)
@KristofferC
Copy link
Member Author

@nanosoldier runtests(["SIMDTypes", "LazyBroadcast", "MistyClosures", "DontMaterialize", "SyntaxTree", "Fuzzy", "Syslogs", "ModuleDocstrings", "TypeTree", "TraceFuns", "CatViews", "Bits", "FindDefinition", "FuzzyCompletions", "ExprTools", "CoverageTools", "MultiThreadedCaches", "WidthLimitedIO", "WithAlloc", "SingleFloats", "CountFlops", "InterProcessCommunication", "OverflowContexts", "StringAlgorithms", "CellLists", "MappedArrays", "MallocArrays", "PtrArrays", "CompTime", "InternedStrings", "Recyclers", "Infinities", "OperatorScaling", "EnzymeCore", "RNGPool", "Adapt", "ThreadLocalCounters", "ReferenceImplementations", "OptimalSortingNetworks", "ChangePrecision", "RoundingEmulator", "NarrativeTest", "BracedErrors", "StarAlgebras", "FunctionFusion", "TypeStability", "TestEnv", "Match", "RuntimeGeneratedFunctions", "KeywordCalls", "YaoHIR", "FieldFlags", "Interfaces", "CommonRLInterface", "BSON", "Umlaut", "Abaco", "Spec", "LMDB", "JACC", "LoweredCodeUtils", "NormalHermiteSplines", "BorrowChecker", "Baobzi", "TypedSyntax", "GAFramework", "Hygienic", "LambertW", "FileCmp", "MicroFloatingPoints", "MixedStructTypes", "DotCall", "CellularAutomata", "TimeRecords", "StaticArraysBlasInterfaces", "ScikitSpatial", "GridMaps", "TrixiBase", "Tracy", "RBNF", "PlutoMonacoEditor", "DRIPs", "Colors", "Cliffords", "COESA", "SimpleExpressions", "HeterogeneousComputing", "JuliaWorkspaces", "CircularArrayBuffers", "PlutoHooks", "BitBasis", "OpenQASM", "SimJulia", "AStarGridSearch", "Mueller", "MaybeInplace", "BibInternal", "RollingWindowArrays", "DimensionfulAngles", "FixedPointDecimals", "ProgressMeter", "NL2sol", "ConstraintCommons", "Accessors", "BioVossEncoder", "BioAtomsCount", "HypertextTemplates", "GeometryTypes", "SimpleI18n", "QuanticsGrids", "StaticLint", "BioMarkovChains", "GenericSchur", "PDMats", "Divergences", "SHTns", "GraphQLGen", "ADTypes", "GitCommand", "DispatchDoctor", "AutoPrettyPrinting", "DiffieHellman", "ODEInterface", "NiLang", "XDiag", "MCP2221Driver", "SnapshotTests", "DifferentiableFlatten", "FCSFiles", "Binning2D", "RNGTest", "MultiBroadcastFusion", "DocSeeker", "PolarizedTypes", "Cosmology", "ColPack", "SigmaProofs", "RustFFT", "CallableExpressions", "CayleyMengerDeterminant", "MarchingCubes", "SMCExamples", "WGSLTypes", "GenericLinearAlgebra", "FiniteDifferences", "BoundedDegreeGraphs", "DynamicQuantumCircuits", "SpectralKit", "ShuffleProofs", "FastCholesky", "OpenSSLGroups", "SquashFS", "InteractiveErrors", "UCX", "UnitfulAssets", "Stencils", "AllocCheck", "InPartS", "InteratomicPotentials", "MarkovKernels", "NearestNeighborDescent", "ConvexHulls2d", "PlayingCards", "AccessorsExtra", "Polyester", "TerminalGat", "ADOLC", "NestedGraphs", "FeatureSelection", "WannierIO", "LatinHypercubeSampling", "AtomicSymmetries", "DuckDB", "OpticalPropagation", "StructArrays", "NLSolvers", "TypedMatrices", "GridWorlds", "QuasiArrays", "MolecularMinimumDistances", "OpenDSSDirect", "Proj", "NeidArchive", "PkgJogger", "LinkedInAPI", "HuggingFaceTokenizers", "QEDcore", "QXZoo", "PyBullet", "MathematicalSystems", "AdmittanceModels", "PyQDecoders", "Term", "PyMNE", "Toolips", "LFRBenchmarkGraphs", "PyFOOOF", "QEDprocesses", "Pyehtim", "Presentation", "LinearElasticityBase", "DoubleFloats", "DictArrays", "YAAD", "QEDfields", "BurrowsWheelerAligner", "StableHashTraits", "DedekindCutArithmetic", "LinearAlgebraForCAP", "SparseIR", "EcRequests", "UnitfulLinearAlgebra", "Norg", "CometLogger", "IntervalLinearAlgebra", "EnergyExpressions", "XmlStructWriter", "PyCallJLD2", "Kronecker", "AtiyahBott", "PyThermo", "CCBlade", "ScHoLP", "DataToolkit", "AngularMomentumAlgebra", "FiberNlse", "Quante", "Wandb", "PythonPlot", "ThermiaAPI", "QuantumAlgebra", "SymPyCore", "FiniteHorizonGramians", "Rotations", "FinancialToolbox", "BibParser", "AbstractNeuralNetworks", "MvNormalCalibration", "LandauDistribution", "ToyPublicKeys", "Bibliography", "SparseMatricesCOO", "ParaReal", "Tensors", "TensorCrossInterpolation", "RationalPolygons", "NomnomlJS", "MatrixFactorizations", "SparseMatrixColorings", "ASEconvert", "Air", "SLEEFMath", "Experimenter", "Seaborn", "MonotonicSplines", "SymbolicWedderburn", "DataToolkitCommon", "PiccoloQuantumObjects", "NCDatasets", "DistributionFits", "SymFEL", "Ephemerides", "CCDReduction", "HopTB", "ConstitutiveModels", "TrustRegionMethods", "NeutralLandscapes", "Dynesty", "NeptuneAILogger", "FrechetDist", "BlackBoxOptim", "Herb", "ConstrainedShortestPaths", "QEDevents", "PlutoStyles", "JuDGE", "SymPyPythonCall", "ConstrainedControl", "QuantumElectrodynamics", "PlutoSplitter", "RangeEnclosures", "SoleBase", "ConstrainedDynamics", "SymbolicIndexingInterface", "AtomsIOPython", "ContinuumArrays", "PlutoTeachingTools", "OutlierDetectionPython", "JupyterPlutoConverter", "ShiftedProximalOperators", "ImplicitGlobalGrid", "SimilaritySearch", "AbstractLogic", "Ipaper", "SpatialEcology", "ConstraintDomains", "SunAsAStar", "MonteCarloSummary", "MultiScaleTreeGraph", "TemporalGPs", "ReinforcementLearningTrajectories", "StaticWebPages", "AutomotiveSimulator", "GraphPPL", "PRASCapacityCredits", "AbsSmoothFrankWolfe", "StrategicGames", "BitSAD", "UMAP", "SlidingDistancesBase", "TopologicalNumbers", "NeumannKelvin", "LaserTypes", "FlashAttentionWrapper", "PyPlotUtils", "Speasy", "PowerModelsAnnex", "PlutoPlotly", "InventoryManagement", "GEMPIC", "DifferentiableExpectations", "ExplainableAI", "Santiago", "VlasiatorPyPlot", "MatrixProfile", "RadiationPatterns", "WaterModels", "Gaugefields", "EnergyModelsRenewableProducers", "BayesianQuadrature", "ZarrDatasets", "Octavian", "PolynomialAmoebas", "CSDP", "SignalTemporalLogic", "DACE", "MTH229", "Mango", "PoincareInvariants", "GEOTRACES", "Mice", "DocstringAsImage", "DifferentiableFrankWolfe", "Maxnet", "ODEInterfaceDiffEq", "FastTransforms", "InfiniteOpt", "MarkovChainHammer", "PrefectInterfaces", "KiteUtils", "RegressionDynamicCausalModeling", "OSQP", "TransmuteDims", "AbstractCosmologicalEmulators", "FeynmanDiagram", "Galley", "TensorCast", "KomaMRICore", "EHTUVData", "ArDCA", "Sensemakr", "RegNets", "EwaldSummations", "EtherSPH", "ElementaryFluxModes", "XCALibre", "ProfileView", "SimulationLogs", "Jadex", "EmpiricalPotentials", "FinEtools", "MaterialPointGenerator", "SphericalScattering", "SymbolicUtils", "InfrastructureSystems", "ApproxFunFourier", "TensorKitSectors", "ODE", "LowLevelParticleFilters", "SimSpread", "MRFingerprintingRecon", "DecisionMakingPolicies", "HuggingFaceDatasets", "GraphsOptim", "DynamicHMC", "ReferenceFiniteElements", "TensorOperationsTBLIS", "FiniteElementContainers", "PySA", "ImageGather", "SparseKmeansFeatureRanking", "LinearRegressionKit", "PsychometricsBazaarBase", "EclipsingBinaryStars", "TransitionsInTimeseries", "Polynomials4ML", "DifferentiableMetabolism", "PowerSystemCaseBuilder", "PassiveTracerFlows", "ImageSegmentation", "Gadfly", "SUNRepresentations", "RecurrentLayers", "ParallelAnalysis", "SimpleBoundaryValueDiffEq", "MCMCDebugging", "JOLI", "ConstraintExplorer", "DynACof", "CaratheodoryFejerApprox", "FusibleBroadcasts", "PALEOboxes", "ACTRSimulators", "OrdinaryDiffEqSSPRK", "Wflow", "CategoryData", "Jabalizer", "MPIMeasurements", "OrdinaryDiffEqExtrapolation", "TimeSeriesClassification", "Qaintmodels", "StartUpDG", "IterativeLQR", "TaylorInversion", "Spehulak", "WordCloud", "PyBraket", "ImageNetDataset", "JUDI", "UnROOT", "ArviZPythonPlots", "LatticeModels", "NDTensors", "RHEOS", "IESopt", "EvoDynamics", "ConstrainedDynamicsVis", "ElectronLiquid", "PALEOsediment", "GMT", "GeometryOptimization", "MarginalLogDensities", "ProbabilisticCircuits", "PlutoPages", "RingStarProblems", "DeconvOptim", "Tasmanian", "ExpressionTreeForge", "CameraCalibrations", "QSFit", "PowerPlots", "SourceCodeMcCormick", "FastMPOContractions", "ComputerAdaptiveTesting", "SwitchOnSafety", "PALEOmodel", "GeometricalOptics", "KernelInterpolation", "PartiallySeparableNLPModels", "Swalbe", "GridapTopOpt", "EnergySamplers", "BoundaryValueDiffEqMIRKN", "MGVI", "GeoEstimation", "GeoStatsFunctions", "OptimizationOptimJL", "FluxTraining", "DecomposingPolynomialSystems", "FastBEAST", "WaveOpticsPropagation", "GenericCharacterTables", "GtkUtilities", "LogicCircuits", "DistributedStwdLDA", "SpinGlassNetworks", "SymbolicAnalysis", "TropicalNN", "ReinforcementLearningFarm", "DynamicMovementPrimitives", "UnfoldBIDS", "ReinforcementLearningZoo", "SolverBenchmark", "ReinforcementLearningCore", "RvLineList", "PortfolioAnalytics", "GNNGraphs", "NonconvexJuniper", "FractionalSystems", "MultiStateSystems", "HetaSimulator", "vSmartMOM", "Fronts", "DiffusionGarnet", "FSimPlots", "MNPDynamics", "Bactos", "CellMLToolkit", "NuclearToolkit", "MimiRFFSPs", "Pesto", "SequentialSamplingModels", "CDGRNs", "GeneticsMakie", "ChargeTransport", "OpenQuantumSystems", "WGPUgfx", "TemporalNetworks", "Fable", "Biofilm", "SwissVAMyKnife", "SBMLToolkitTestSuite", "MAGEMinApp", "Microstructure", "RigorousInvariantMeasures", "MRINavigator", "DiagrammaticEquations", "DiskArrayEngine", "CalibrateEmulateSample", "CropRootBox", "SMLMSim"], vs = ":release-1.11")

@nanosoldier
Copy link
Collaborator

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

Report summary

❗ Packages that crashed

15 packages crashed only on the current version.

  • The process was aborted: 2 packages
  • Invalid LLVM IR was generated: 1 packages
  • An internal error was encountered: 10 packages
  • GC corruption was detected: 1 packages
  • A segmentation fault happened: 1 packages

✖ Packages that failed

433 packages failed only on the current version.

  • Package has syntax issues: 5 packages
  • Package fails to precompile: 107 packages
  • Illegal method overwrites during precompilation: 12 packages
  • Package has test failures: 100 packages
  • Package tests unexpectedly errored: 140 packages
  • Package is using an unknown package: 1 packages
  • Networking-related issues were detected: 1 packages
  • There were unidentified errors: 1 packages
  • Tests became inactive: 4 packages
  • Test duration exceeded the time limit: 58 packages
  • Test log exceeded the size limit: 4 packages

23 packages failed on the previous version too.

✔ Packages that passed tests

1 packages passed tests only on the current version.

  • Other: 1 packages

49 packages passed tests on the previous version too.

- add missing `@nospecialize` annotation
- add more type annotations to functions
- fixed capturing uninferrable variables
aviatesk referenced this pull request in aviatesk/JET.jl Apr 19, 2025
vtjnash and others added 11 commits April 22, 2025 08:22
Fix #51870

In a different PR, I was making precompile printing slightly more
accurate, and it caused nearly everything to run into this bug and
crashed the build, so I needed to fix this now since an upcoming PR will
rely heavily on this being corrected.

(cherry picked from commit 1faa698)
and avoid eager UnionAll unwrapping to hit more fast path.
close #58129 (test passed locally)
close #56350 (MWE returns `Tuple{Any, Any, Vararg}` now.)

(cherry picked from commit 334c316)
Changed the `::Function` signature to the `::F where F` pattern to allow
specialization of `scan_specified_partitions`.

The changes in `scan_leaf_partitions` and `scan_partitions` are not
actually necessary because those methods are simple and are basically
inlined and optimized down to calling `scan_specified_partitions`.
However, considering the possibility of other code being added in the
future and also for consistency, the same changes were applied.

(cherry picked from commit 39d7483)
Makes this query more accurate for the rare nonfunction_mt dispatch, but
otherwise not expected to be a visible change. (needed for future
followup work, so splitting this out into a small change since it can be
done independently)

(cherry picked from commit fb31b3c)
# Overview

As we add REPL features, bugs related to the ad-hoc parsing done by
`REPLCompletions.completions` have crept in. This pull request replaces
most of the manual parsing (regex, `find_start_brace`) with a new
approach that parses the entire input buffer once, before and after the
cursor, using JuliaSyntax. We then query the parsed syntax tree to
determine the kind of completion to be done.

# Changes
- New, JuliaSyntax-based completions mechanism.

- The `complete_line` interface now has the option of replacing
  arbitrary regions of text in the input buffer by returning a `Region`
  (`Pair{Int, Int}` for consistency with the convention in LineEdit, and
  `pos` being a 0-based byte offset).

- Fixes parsing-related bugs:
  - fix #55420
  - fix #55429
  - fix #55518
  - fix #55520
  - fix #55842
  - fix #56389
  - fix #57307
  - fix #57611
  - fix #57624
  - fix #58099

- Fixes some bugs that exist on 28d3bd5 that were found by fuzzing:
  - `x \"` + `TAB` throws a `FieldError` exception
  - String completion would sometimes delete the entire input buffer.
  - Completions should not happen inside comments.

- The duplicate code for path completion in strings, `Cmd`-strings, and
  the shell has been removed, causing paths to complete the same way for
  all three. Now, `~` is expanded in two situations:
  - If `foo` exists, or if `foo` does not exist but there are no
    possible completions:
    ```
    "~/foo/b|"     =TAB=>   "~/foo/bar|"
    "~/foo/bar|"   =TAB=>   "/home/user/foo/bar|"
       OR
    "~/foo/bar"|   =TAB=>   "/home/user/foo/bar"|
    ```

  - If the current path ends with a `/` and you hit TAB again:
    ```
    "~/foo/|"      =TAB=>   "/home/user/foo/|"
       OR
    "~/foo/"|      =TAB=>   "/home/user/foo/"|
    ```

# Future work
- Method completions could be changed to look for methods with exactly
  the given number of arguments if the closing `)` is present, and search
  for signatures with the right prefix otherwise.

- It would be nice to be able to search by type as well as value
  (perhaps by putting `::T` in place of arguments).

- Other REPL features could benefit from JuliaSyntax, so it might be
  worth sharing the parse tree between completions and other features:

    - Emacs-style sexpr navigation: `C-M-f`/`C-M-b`/`C-M-u`, etc.
    - Improved auto-indent.

- It would be nice if hints worked even when the cursor is between text.

- `CursorNode` is a slightly tweaked copy of `SyntaxNode` from
  JuliaSyntax that tracks the parent node but includes all trivia. It is
  used with `seek_pos`, which navigates to the innermost node at a given
  position so we can examine nearby nodes and the parent. This could
  probably duplicate less code from JuliaSyntax.

(cherry picked from commit ff0a931)
After discussion with Cody, this is an attempt at a more minimal version
of #56194.

The intent is to work around the invalidation issue introduced by the
split design with AnnotatedStrings, resolving the headache for 1.12.

Paired with JuliaLang/StyledStrings.jl#115

Many thanks to @topolarity for working out this approach, the discussion
on balancing the short/long term fixes for this issue.

------

From my understanding of the problem, this should fix the
`write`/`print`/`show` invalidations, but this needs to be checked.

---------

Co-authored-by: Cody Tapscott <topolarity@tapscott.me>
(cherry picked from commit 6d78a4a)
This commit removes `jl_reinit_ccallable` whose purpose is unclear.
Specifically, the function re-adds C-callable functions to the execution
engine during the loading of sysimages/pkgimages, but the consensus is
that the function is largely unnecessary because `ccall` can find
symbols via `dlsym`. The function's only apparent use case is a
contrived `llvmcall` example, only because we currently don't add the
sysimage symbols to the JIT, but we could do anyway. `llvmcall` has
always been experimental, and if it is truly needed, the functionality
for finding the symbols should be properly implemented later.
@KristofferC KristofferC merged commit 71af4b8 into release-1.12 Apr 25, 2025
8 checks passed
@KristofferC KristofferC deleted the backports-release-1.12 branch April 25, 2025 07:03
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.