Trimming is based on the observation that, if the static subset of your call graph encompasses your entire program, Julia ought to be able to compile the whole program to a single, static binary. Trimming has been worked on by the core devs for several years, and recently, their work has born fruit: An early experimental version landed in the 1.12 release and can now be used.
https://julialang.org/blog/2025/10/julia-1.12-highlights/#new_--trim_feature