# Help with JuliaC, \`trim=safe\` and packages wrapping C-libraries

**URL:** <https://discourse.julialang.org/t/help-with-juliac-trim-safe-and-packages-wrapping-c-libraries/135818>\
**Category:** General Usage\
**Tags:** package, trim\
**Created:** [February 24, 2026, 8:39pm UTC](https://discourse.julialang.org/t/help-with-juliac-trim-safe-and-packages-wrapping-c-libraries/135818 "2026-02-24T20:39:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ErikBuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erikbuer/32/44411_2.png) [@ErikBuer](https://discourse.julialang.org/u/ErikBuer)\
**Post date:** [February 24, 2026, 8:39pm UTC](https://discourse.julialang.org/t/help-with-juliac-trim-safe-and-packages-wrapping-c-libraries/135818/1 "2026-02-24T20:39:02Z")

</div>

The way i see it, being able to build applications into small-ish binaries is key for widespread adoption of Julia in the industry. The introduction of `trim` in 1.12 is therefore a massive leap forward!

Unfortunately i have found that getting my package [Fugl](https://github.com/ErikBuer/Fugl.jl) working with `trim=safe` is a big undertaking. I’ve found that my dependencies and their dependencies need to be updated.

My package [Fugl](https://github.com/ErikBuer/Fugl.jl) for instance, depends on a bunch of packages that wraps and abstracts C-libraries. From my little research, it seems these does not play to well with JuliaC.jl.  
In my case i might need to update GLFW.jl, GLAbstraction.jl (perhaps ModernGL.jl, FreeType.jl, FreeTypeAbstraction.jl also). Quite an undertaking.

Could anyone give some guidance on writing packages wrapping/interfacing C-libraries, such that they play nice with `trim=safe`?  
Are there some patterns to avoid?  
Are there limitations that `trim=safe` introduce?

For instance it seems callback functions (like in GLFW.jl) is an issue with trim.
