How to use a forked Github project

I am trying to use a fork of the Ogg package, but having problems. Ogg itself is easy to use as it is a registered package. The fork I want to use is as ssfrr created a streaming branch that allows access to specific OggPages. I first tried to clone the repo and use activate as described at 4. Working with Environments · Pkg.jl, but then found I couldn’t build or test as there was no Project.toml in the forked version.

So what is the best way for me to proceed? Do I create a new Project.toml file and new uuid for the cloned fork? Or, do I use the registered version of Ogg and use ]dev as described at ? I actually tried the latter, but still ran into issues where I would get problems building, with

ERROR: LoadError: libogg not properly installed. Please run"Ogg")

ERROR: LoadError: Failed to precompile Ogg [796d8c31-69d0-5366-9081-a3bf997f4f0d] to ~/julia/julia-depot/compiled/v1.5/Ogg/CEzZT_9qSkO.ji.   

The answer to the question in your title is straightforward, you can do:

pkg> add

As to why this specific branch of this fork is not working, it may just be that that branch hasn’t received an update in 2 years. The most recent version of Julia that it compiles/loads succesfully on seems to be 1.1 (docker run -it julia:X.Y where you can put any version for X.Y can be really helpful in super quickly testing different versions).

The easiest path forward may be to clone the fork and manually merge Ogg.jl’s current master branch (which is more up to date and seems to work on 1.6) into streaming. I’m not familiar with the package so can’t say how hard resolving any merge conflicts may be though.

@marius311 That is a great tip about using docker for testing different versions. I got the errors above when I created a dev version from the registered and started trying to merge in the changes from the streaming branch. After you pointed out that it functions in versions 1.1, I figured out that the divergence happened at 1.3, and merged everything successfully.

I’m marking this solved as you got me where I wanted to be, although I am wondering if I should have followed your advice to do things in the opposite order and clone the branch, then merge in the changes from the up to date, registered version. I’m not sure which repo is the more appropriate place to submit a PR if I make some useful changes.

1 Like