Julia Nightly fails with an error on overwritten method

I need to work with someone else’s code repository and I have zero experience in Julia (although I know how to program). This code repository runs workflows on GitHub Actions, and one of the workflows that runs under Julia nightly version, fails with the following error:

WARNING: Method definition eval(Any) in module OpenInterfaces at /home/runner/work/open-interfaces/open-interfaces/lang_julia/package/src/OpenInterfaces.jl:1 overwritten at /home/runner/work/open-interfaces/open-interfaces/lang_julia/package/src/OpenInterfaces.jl:18.
ERROR: LoadError: Method overwriting is not permitted during Module precompile.

When I look at the module OpenInterfaces.jl, the code looks like this (I left only relevant staff):

module OpenInterfaces

function eval(expression)
    ret = @ccall "liboif_connector".oif_connector_eval_expression(expression::Cstring)::Cint
    check_call(ret, "cannot eval $expression")
end
end

What I do not understand is that I do not see any rewrite of the function eval in this module. The Julia manual on modules says that each module is a separate namespace, so it seems that there is no implicit override of this method from built-in Julia libraries. At the same time the warning implies that at line 1 of this module (at the very beginning) somehow the function eval is already defined.

Could someone explain to me the issue and how to fix it? Thanks!

First of all welcome to discourse. I am not very experienced in using eval so I cannot help you much, but Julia automatically defines an eval function and an include function in every module. You can see this by executing code like:

module A
end
using Main.A
println(A.eval("Hello"))

If you are completely new to Julia, I would suggest playing around with Julia a bit to learn how these functions and keywords work, while at the same time reading the documentation. This looks like some very advanced code.

Perhaps the issue here is that eval is a Julia function that’s included by default in each module, and that’s being overwritten by the custom definition in OpenInterfaces. If it’s not too much trouble, changing the name of the function should resolve this issue.

Dear @GHTaarn and @jishnub, thank you very much for the explanations and advice. I have renamed the function eval and the tests run now with the nightly version of Julia.

2 Likes