Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Libtask_jll #76

Merged
merged 11 commits into from
Nov 23, 2020
Merged

Use Libtask_jll #76

merged 11 commits into from
Nov 23, 2020

Conversation

devmotion
Copy link
Member

This PR fixes #75 by removing the custom build process with BinaryProvider and instead using the prebuilt libraries in Libtask_jll.

This change requires Julia >= 1.3 but I assume this might be fine since recent versions of Turing only support Julia >= 1.3.

- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -3,16 +3,16 @@ uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
license = "MIT"
desc = "C shim for task copying in Turing"
repo = "https://github.com/TuringLang/Libtask.jl.git"
version = "0.4.2"
version = "0.5.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to backport and release bugfixes for Julia < 1.3 in Libtask 0.4.* if needed.

function __init__()
check_deps()
end
export CTask, consume, produce, TArray, tzeros, tfill, TRef
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to reexport Base.get, so I removed it. I'm wondering if consume and produce should be removed from the exports as well since their names are quite generic.

@devmotion
Copy link
Member Author

devmotion commented Oct 9, 2020

There are some reproducible test errors on Windows32 with Julia 1.5 (and test errors on nightly since apparently internals of Task were changed). Can they be fixed?

Project.toml Outdated Show resolved Hide resolved
@devmotion devmotion requested review from KDr2 and yebai October 11, 2020 11:13
@KDr2
Copy link
Member

KDr2 commented Oct 12, 2020

So where the removed files (c source, makefile, build script, etc) are placed now? I did a simple search and failed to find them...

@devmotion
Copy link
Member Author

The intention was to not keep them in the repo here but to move them to Yggdrasil. That would keep everything together in one place and make it easier to update and rebuild the library, without making PRs to two repositories.

BTW there are efforts to link libraries against Julia on Yggdrasil, and it seems there's already official support for Julia 1.4 (but not all OS) and 1.5. So at some point we might be able to get rid of the different libraries and the checks in Libtask.jl, and instead only use a Julia-versioned libtask library.

@KDr2
Copy link
Member

KDr2 commented Oct 12, 2020

The intention was to not keep them in the repo here but to move them to Yggdrasil.

I think it would be better to move the relevant files to Yggdrasil and build a new version of Libtask_jll before merging this PR, what do you think?

we might be able to get rid of the different libraries and the checks in Libtask.jl, and instead only use a Julia-versioned libtask library.

Great, the build process could be dramatically simplified if it is true :)

@devmotion
Copy link
Member Author

I think it would be better to move the relevant files to Yggdrasil and build a new version of Libtask_jll before merging this PR, what do you think?

Sounds reasonable 👍 At the same time, we should maybe build Julia 1.4 and 1.5 specific versions as well? I'm wondering if this could fix the test issues on Windows 32bit with Julia 1.5.

@yebai
Copy link
Member

yebai commented Nov 19, 2020

@KDr2 let's get this PR merged asap.

@devmotion
Copy link
Member Author

We have to wait until the libraries are available in the registry.

@KDr2
Copy link
Member

KDr2 commented Nov 20, 2020

We have to wait until the libraries are available in the registry.

How many versions of the JLL should we build in Yggdrasil? At least 3 I think? As discussed in JuliaPackaging/Yggdrasil#2087, we have to file a PR for each version and wait until all of them are available in the registry。

@devmotion
Copy link
Member Author

Yes, exactly. I wanted to test this PR locally with the library for Julia 1.3 first before opening the other PRs. However, the library is not available in the general registry since automerging failed: JuliaRegistries/General#24916

@devmotion
Copy link
Member Author

The new library is still not registered but tests passed locally: JuliaRegistries/General#24916

@devmotion devmotion closed this Nov 22, 2020
@devmotion devmotion reopened this Nov 22, 2020
@devmotion
Copy link
Member Author

It seems to work 🎉

The pre-built Libtask_jll is now available for Julia 1.3 (Libtask_jll 0.4.0), Julia 1.4 (Libtask_jll 0.4.1), and Julia 1.5 (Libtask_jll 0.4.2). In the tests the correct version of Libtask_jll is installed for these Julia versions.

Tests for Julia nightly fail since there is no compatible version of Libtask_jll available.

@yebai
Copy link
Member

yebai commented Nov 23, 2020

Tests for Julia nightly fail since there is no compatible version of Libtask_jll available.

Maybe consider falling back to most recent Libtask_jll release (e.g. 0.4.2) for the nightly build?

@devmotion
Copy link
Member Author

Maybe consider falling back to most recent Libtask_jll release (e.g. 0.4.2) for the nightly build?

I think Pkg does not allow this. And actually I think it is reasonable since otherwise we basically create "unbounded" Libtask_jll versions and newer Julia versions might just fall back to completely broken libraries. As far as I know, however, it would be possible to add the Libtask_jll repo manually which then circumvents the checks in the registry. At least that was the case in my local tests - Pkg then just prints a warning about incompatible Julia versions but still installs the latest version. We could add this to the CI tests?

@yebai
Copy link
Member

yebai commented Nov 23, 2020

We could add this to the CI tests?

Makes sense since we'll know when breaking changes are introduced into the nightly build.

Also, maybe consider adding a line in the README file, informing potential nightly Julia users how to install manually?

@devmotion
Copy link
Member Author

OK, tests run now on Julia nightly as well with the latest version of Libtask_jll but cause a Julia segfault (not too surprising, they were already broken on master since base Julia removed fields of Task etc.). I also added a section to the README.

@yebai
Copy link
Member

yebai commented Nov 23, 2020

Excellent work, many thanks @devmotion!

@yebai yebai merged commit a664d3d into TuringLang:master Nov 23, 2020
@devmotion devmotion deleted the libtask_jll branch November 23, 2020 18:09
@devmotion
Copy link
Member Author

@yebai Can you fix #76 (comment) and add a secret for CompatHelper? Or maybe that has been done already?

@yebai
Copy link
Member

yebai commented Nov 23, 2020

@yebai Can you fix #76 (comment) and add a secret for CompatHelper? Or maybe that has been done already?

Done - pls give it a try and see whether it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Artifacts instead of BinaryProvider/build.jl
4 participants