Fine grained control of __precompile__(false)?

I am mostly using Julia 1.11.2 but sometimes 1.10.7.

I have some code where a few function definitions 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?

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

2 Likes

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.

3 Likes

There is a thread here. I did open an issue with FunPQ.