Skip to content

Commit

Permalink
Use Libtask_jll (#76)
Browse files Browse the repository at this point in the history
* Use Libtask_jll

* Update README

* Add CompatHelper

* Bump version

* Do not test old Julia versions

* Do not export `get`

* Clean list of dependencies

* Update to Libtask_jll 0.4

* Add Libtask_jll manually on Julia nightly

* Add cache

* Add section to README
  • Loading branch information
devmotion authored Nov 23, 2020
1 parent 7b9540a commit a664d3d
Show file tree
Hide file tree
Showing 13 changed files with 110 additions and 444 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/BuildDylib.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper
on:
schedule:
- cron: '00 00 * * *'
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
9 changes: 6 additions & 3 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.DEPLOY_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 12 additions & 8 deletions .github/workflows/Testing.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
name: Libtask Testing

on:
push:
branches:
- master
# tags: '*'
release:
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
matrix:
version:
- '1.0'
- '1.1'
- '1.2'
- '1.3'
- '1.4'
- '1'
Expand All @@ -32,12 +25,23 @@ jobs:
exclude:
- os: macOS-latest
arch: x86

steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- if: ${{ matrix.version == 'nightly' }}
run: julia --color=yes --project -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/JuliaBinaryWrappers/Libtask_jll.jl.git"))'
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
10 changes: 4 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ 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"

[deps]
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Libtask_jll = "3ae2931a-708c-5973-9c38-ccf7496fb450"

[compat]
BinaryProvider = "0.5"
julia = "1"
Libtask_jll = "0.4"
julia = "1.3"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
43 changes: 16 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Libtask
[![Libtask Testing](https://github.com/TuringLang/Libtask.jl/workflows/Libtask%20Testing/badge.svg)](https://github.com/TuringLang/Libtask.jl/actions)
[![Dylib Build](https://github.com/TuringLang/Libtask.jl/workflows/Build%20Dylib/badge.svg)](https://github.com/TuringLang/Libtask.jl/actions)

[![Libtask Testing](https://github.com/TuringLang/Libtask.jl/workflows/Libtask%20Testing/badge.svg)](https://github.com/TuringLang/Libtask.jl/actions?branch=master)

C shim for [task copying](https://github.com/JuliaLang/julia/issues/4085) in Turing

Expand Down Expand Up @@ -90,28 +89,18 @@ a = copy(ctask)

Note: The [Turing](https://github.com/TuringLang/Turing.jl) probabilistic programming language uses this task copying feature in an efficient implementation of the [particle filtering](https://en.wikipedia.org/wiki/Particle_filter) sampling algorithm for arbitary order [Markov processes](https://en.wikipedia.org/wiki/Markov_model#Hidden_Markov_model).

Disclaimer: This feature is still experimental and should only be used with caution. Some discussions on its potential caveats can be found [here](https://github.com/JuliaLang/julia/pull/15078).

## For Developer

### Release a new version
- If you have updates of the binary dylib (files under the `deps`
directory), you should:
- Update the version/commit information in [this
file](https://github.com/JuliaPackaging/Yggdrasil/blob/master/L/Libtask/build_tarballs.jl)
by a pull request
- Wait for that PR being merged, then you will find a new
release of the dylib
[here](https://github.com/JuliaBinaryWrappers/Libtask_jll.jl/releases)
- Then, in the root directory of the Yggdrasil project, run
`https://github.com/JuliaBinaryWrappers/Libtask_jll.jl/releases`,
you will get a build file like
`build/build_Libtask.v0.3.1.jl`. Copy the binary download
information (the variables `bin_prefix` and `download_info`)
from that generated file to `deps/build.jl` in our repo and
commit the changes.
- If you don't make any changes about the dylib, just ignore the
first step and go to next one.
- Update the new version number in `Project.toml`, ping
@JuliaRegistrator with `@JuliaRegistrator register` in a
comment.
## Disclaimer

This feature is still experimental and should only be used with caution. Some discussions on its potential caveats can be found [here](https://github.com/JuliaLang/julia/pull/15078).

## Julia nightly

Libtask uses the `libtask_julia` library which is pre-built for Julia versions 1.3, 1.4, and 1.5 and
distributed via the [Libtask_jll](https://github.com/JuliaBinaryWrappers/Libtask_jll.jl/) package.

Julia nightly might not be compatible with the latest version of the `libtask_julia` library and is
not officially supported. If you want to use Julia nightly, you have to add the Libtask_jll package
manually:
```julia
julia> ] add https://github.com/JuliaBinaryWrappers/Libtask_jll.jl.git
```
49 changes: 0 additions & 49 deletions deps/Makefile

This file was deleted.

59 changes: 0 additions & 59 deletions deps/build.jl

This file was deleted.

59 changes: 0 additions & 59 deletions deps/build_dylib.sh

This file was deleted.

Loading

2 comments on commit a664d3d

@devmotion
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/25179

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.0 -m "<description of version>" a664d3dc5ee8e56ab85dc9368e94f68c8b150083
git push origin v0.5.0

Please sign in to comment.