Why am I unable to precompile my project?

Hi,
I am quite new to Julia and I am trying to working on and developing a package that my colleague has made.

Following the instructions on pkgdocs, I used dev to clone the project followed by activate . and instantiate

When I tried to instantiate I got the first error:

Warning: The project dependencies or compat requirements have changed since the manifest was last resolved.
│ It is recommended to Pkg.resolve() or consider Pkg.update() if necessary.
└ @ Pkg.API C:\workdir\usr\share\julia\stdlib\v1.8\Pkg\src\API.jl:1535
ERROR: Interpolations is a direct dependency, but does not appear in the manifest. If you intend Interpolations to be a direct dependency, run Pkg.resolve()

After performing Pkg.resolve(), upon trying to instatitate again it fails to precompile.

Any help would be appreciated :slight_smile:
I am using Windows 11 and Julia 1.8.5 (same issue happened on v1.8.3)

I would focus on this error now : UndefVarError: Event is not defined. Look through your colleague’s code. How is Event supposed to be defined?

It is defined as mutable struct Event

The project seems to be working perfectly fine for him.

is BosonSampling.jl a github repo we can take a look?

This one perhaps?

Eight days ago your colleague made this commit introducing a reference to Event in measurement.jl:

However, in types.jl, measurements.jl is loaded before events.jl.

The code in measurements.jl does not know about the mutable struct declared in events.jl. The solution to this is to move all the type declarations to a file included before all the function definitions.

A simple solution for now is to move possible_threshold_detections to events.jl instead of measurements.jl

1 Like

Look what I found in events.jl:

It looks to me like your colleague forgot to commit one or more files. It does not make sense for possible_threshold_detections(ev::Event) to be defined twice.

4 Likes

Yes! That was indeed the problem. I guess it wasn’t a Julia problem after all, but a little software development bug.

Thanks a lot for quickly troubleshooting it @mkitti