# Fine grained control of \_\_precompile\_\_(false)?

**URL:** https://discourse.julialang.org/t/fine-grained-control-of-precompile-false/124811
**Category:** General Usage
**Tags:** package, packages, precompilation, precompile
**Created:** [January 15, 2025, 9:26pm UTC](https://discourse.julialang.org/t/fine-grained-control-of-precompile-false/124811 "2025-01-15T21:26:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)
#### Post date: [January 15, 2025, 9:26pm UTC](https://discourse.julialang.org/t/fine-grained-control-of-precompile-false/124811/1 "2025-01-15T21:26:39Z")

</div>

I am mostly using Julia 1.11.2 but sometimes 1.10.7.

I have some code where a few [function definitions](https://discourse.julialang.org/t/interface-funsql-with-libpq-using-dbinterface/99635/8) cause a precompile warning and then the precompile fails. I have not been able to figure out a way to fix these functions.

This code is in a package we have created. This package has a main module and submodules. In reading the manual section `17.3 Module initialization and precompilation`, it states that I can put the command **precompile** (false) just after the definition of the module. Does this only apply to the main package module or can it be specific to a submodule in the package.

Ideally I would like to be able to turn precompilation off for just the offending functions, but it seems this is not possible?

---

<div class="post-metadata">

### Author: ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)
#### Post date: [January 16, 2025, 9:45pm UTC](https://discourse.julialang.org/t/fine-grained-control-of-precompile-false/124811/2 "2025-01-16T21:45:19Z")

</div>

Precompilation acts at the level of packages, so it is not possible to opt out a the level of a module or function.

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [January 17, 2025, 1:29am UTC](https://discourse.julialang.org/t/fine-grained-control-of-precompile-false/124811/3 "2025-01-17T01:29:52Z")

</div>

Looking at that linked comment, you’re overwriting a `LibPQ` method from your package. Besides dynamic method overwriting being impossible to implement well among precompiled packages, this is a subset of type piracy that risks broken behavior among and within modules, precompiled or not. It might be worth making a separate thread for advice on refactoring.

---

<div class="post-metadata">

### Author: ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)
#### Post date: [January 18, 2025, 3:28pm UTC](https://discourse.julialang.org/t/fine-grained-control-of-precompile-false/124811/4 "2025-01-18T15:28:35Z")

</div>

There is a thread [here](https://discourse.julialang.org/t/interface-funsql-with-libpq-using-dbinterface/99635). I did open an [issue](https://github.com/MechanicalRabbit/FunSQL.jl/issues/77) with FunPQ.
