Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions .ci/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[deps.BinaryBuilder]]
deps = ["ArgParse", "BinaryBuilderBase", "Binutils_jll", "Dates", "Downloads", "GitHub", "HTTP", "JLD2", "JSON", "LibGit2", "Libdl", "Logging", "LoggingExtras", "ObjectFile", "OutputCollectors", "Patchelf_jll", "Pkg", "PkgLicenses", "REPL", "Random", "Registrator", "RegistryTools", "SHA", "Scratch", "Sockets", "TOML", "UUIDs", "ghr_jll"]
git-tree-sha1 = "83b84cf0cee886d6be4f398382da760fc7c898b6"
git-tree-sha1 = "5caeb4f25ead6a04742d9d3140c8d699ceea1fe3"
repo-rev = "master"
repo-url = "https://github.com/JuliaPackaging/BinaryBuilder.jl.git"
uuid = "12aac903-9f7c-5d81-afc2-d9565ea332ae"
version = "0.6.5"

[[deps.BinaryBuilderBase]]
deps = ["Bzip2_jll", "CodecZlib", "Downloads", "Gzip_jll", "HistoricalStdlibVersions", "InteractiveUtils", "JLLWrappers", "JSON", "LibGit2", "LibGit2_jll", "Libdl", "Logging", "OrderedCollections", "OutputCollectors", "Pkg", "Printf", "ProgressMeter", "REPL", "Random", "SHA", "Scratch", "SimpleBufferStream", "TOML", "Tar", "Tar_jll", "UUIDs", "XZ_jll", "Zstd_jll", "p7zip_jll", "pigz_jll", "unzip_jll"]
git-tree-sha1 = "d37350f8d8431a44261e29e37b4a4c1558ad121d"
git-tree-sha1 = "65d5431912c435f0f70e699e1af6f8f3f352fac1"
repo-rev = "master"
repo-url = "https://github.com/JuliaPackaging/BinaryBuilderBase.jl.git"
uuid = "7f725544-6523-48cd-82d1-3fa08ff4056e"
version = "1.41.0"
version = "1.42.0"

[[deps.Binutils_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll", "Zstd_jll"]
Expand All @@ -77,9 +77,9 @@ version = "0.7.8"

[[deps.Compat]]
deps = ["Dates", "LinearAlgebra", "TOML", "UUIDs"]
git-tree-sha1 = "0037835448781bb46feb39866934e243886d756a"
git-tree-sha1 = "9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "4.18.0"
version = "4.18.1"

[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
Expand Down Expand Up @@ -126,9 +126,9 @@ version = "0.1.10"

[[deps.FileIO]]
deps = ["Pkg", "Requires", "UUIDs"]
git-tree-sha1 = "b66970a70db13f45b7e57fbda1736e1cf72174ea"
git-tree-sha1 = "d60eb76f37d7e5a40cc2e7c36974d864b82dc802"
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
version = "1.17.0"
version = "1.17.1"

[[deps.FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
Expand All @@ -153,9 +153,9 @@ version = "1.14.0+0"

[[deps.HTTP]]
deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "PrecompileTools", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"]
git-tree-sha1 = "ed5e9c58612c4e081aecdb6e1a479e18462e041e"
git-tree-sha1 = "5e6fe50ae7f23d171f44e311c2960294aaa0beb5"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "1.10.17"
version = "1.10.19"

[[deps.Hiccup]]
deps = ["MacroTools", "Test"]
Expand Down Expand Up @@ -252,9 +252,9 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[deps.LoggingExtras]]
deps = ["Dates", "Logging"]
git-tree-sha1 = "f02b56007b064fbfddb4c9cd60161b6dd0f40df3"
git-tree-sha1 = "f00544d95982ea270145636c181ceda21c4e2575"
uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36"
version = "1.1.0"
version = "1.2.0"

[[deps.Lz4_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
Expand Down Expand Up @@ -319,16 +319,16 @@ deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"

[[deps.OpenSSL]]
deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"]
git-tree-sha1 = "f1a7e086c677df53e064e0fdd2c9d0b0833e3f6e"
deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "NetworkOptions", "OpenSSL_jll", "Sockets"]
git-tree-sha1 = "386b47442468acfb1add94bf2d85365dea10cbab"
uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c"
version = "1.5.0"
version = "1.6.0"

[[deps.OpenSSL_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "2ae7d4ddec2e13ad3bddf5c0796f7547cf682391"
git-tree-sha1 = "f19301ae653233bc88b1810ae908194f07f8db9d"
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
version = "3.5.2+0"
version = "3.5.4+0"

[[deps.OrderedCollections]]
git-tree-sha1 = "05868e21324cede2207c6f0f466b4bfef6d5e7ee"
Expand Down Expand Up @@ -513,9 +513,9 @@ version = "0.3.0"

[[deps.TimeZones]]
deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "Mocking", "Printf", "RecipesBase", "Scratch", "TZJData", "Unicode", "p7zip_jll"]
git-tree-sha1 = "1f9a3f379a2ce2a213a0f606895567a08a1a2d08"
git-tree-sha1 = "06f4f1f3e8ff09e42e59b043a747332e88e01aba"
uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53"
version = "1.22.0"
version = "1.22.1"

[[deps.TranscodingStreams]]
git-tree-sha1 = "0c45878dcfdcfa8480052b6ab162cdd138781742"
Expand All @@ -541,10 +541,10 @@ uuid = "ffd25f8a-64ca-5728-b0f7-c24cf3aae800"
version = "5.8.1+0"

[[deps.ZMQ]]
deps = ["FileWatching", "PrecompileTools", "Sockets", "ZeroMQ_jll"]
git-tree-sha1 = "2d060e1f014c07561817bf6f3c0eb66b309e04bd"
deps = ["FileWatching", "PrecompileTools", "Printf", "Sockets", "ZeroMQ_jll"]
git-tree-sha1 = "5f1c7008e2258c61af0eafef8c1f536b9fffbbd2"
uuid = "c2297ded-f4af-51ae-bb23-16f91089e4e1"
version = "1.4.1"
version = "1.5.1"

[[deps.ZeroMQ_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "libsodium_jll"]
Expand Down Expand Up @@ -600,6 +600,6 @@ version = "4.7.2+0"

[[deps.unzip_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "5d543463432c2e25027d88f5a314d40d44488391"
git-tree-sha1 = "0cd79af876ba6b5f93229d0e2c5455fcdd9930f7"
uuid = "88f77b66-78eb-5ed0-bc16-ebba0796830d"
version = "6.0.2+0"
version = "6.0.3+0"
14 changes: 10 additions & 4 deletions .ci/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ BinaryBuilder = "12aac903-9f7c-5d81-afc2-d9565ea332ae"
BinaryBuilderBase = "7f725544-6523-48cd-82d1-3fa08ff4056e"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
GitHub = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
HistoricalStdlibVersions = "6df8b67a-e8a0-4029-b4b7-ac196fe72102"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand All @@ -12,10 +13,15 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
ghr_jll = "07c12ed4-43bc-5495-8a2a-d5838ef8d533"
squashfs_tools_jll = "eed32e3e-a7c5-5bf9-9121-5cf3ab653887"

[sources]
BinaryBuilder = {rev = "master", url = "https://github.com/JuliaPackaging/BinaryBuilder.jl.git"}
BinaryBuilderBase = {rev = "master", url = "https://github.com/JuliaPackaging/BinaryBuilderBase.jl.git"}

[compat]
GitHub = "5"
HistoricalStdlibVersions = "=2.0.2"
ghr_jll = "0.14.0"

[sources.BinaryBuilder]
rev = "master"
url = "https://github.com/JuliaPackaging/BinaryBuilder.jl.git"

[sources.BinaryBuilderBase]
rev = "master"
url = "https://github.com/JuliaPackaging/BinaryBuilderBase.jl.git"
94 changes: 49 additions & 45 deletions .ci/register_package.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BinaryBuilder, BinaryBuilderBase, Downloads, Pkg
using BinaryBuilder, BinaryBuilder.Wizard, BinaryBuilderBase, Downloads, Pkg
using GitHub: authenticate, gh_get_json, DEFAULT_API

# FIXME: Golang auto-upgrades to HTTP2, this can cause issue like https://github.com/google/go-github/issues/2113
ENV["GODEBUG"] = "http2client=0"
Expand Down Expand Up @@ -30,7 +31,7 @@ dependencies = Dependency[dep for dep in merged["dependencies"] if !(isa(dep, Bu
lazy_artifacts = merged["lazy_artifacts"]
augment_platform_block = merged["augment_platform_block"]
build_version = BinaryBuilder.get_next_wrapper_version(name, version)
repo = "JuliaBinaryWrappers/$(name)_jll.jl"
repo = "EnzymeAD/$(name)_jll.jl"
code_dir = joinpath(Pkg.devdir(), "$(name)_jll")
julia_compat = merged["julia_compat"]

Expand All @@ -54,17 +55,6 @@ function mvdir(src, dest)
end
end

function download_cached_binaries(download_dir)
NAME = ENV["NAME"]
PROJECT = ENV["PROJECT"]
artifacts = "$(PROJECT)/products/$(NAME)*.tar.*"
cmd = `buildkite-agent artifact download $artifacts $download_dir`
if !success(pipeline(cmd; stderr))
error("Download failed")
end
mvdir(joinpath(download_dir, PROJECT, "products"), download_dir)
end

function download_binaries_from_release(download_dir)
function do_download(download_dir, info)
url = info["url"]
Expand Down Expand Up @@ -96,44 +86,58 @@ for json_obj in [merged, objs_unmerged...]
json_obj["dependencies"] = Dependency[dep for dep in json_obj["dependencies"] if BinaryBuilderBase.is_runtime_dependency(dep)]
end
skip_build = get(ENV, "SKIP_BUILD", "false") == "true"
mktempdir() do download_dir
# Grab the binaries for our package
if skip_build
# We only want to update the wrappers, so download the tarballs from the
# latest build.
download_binaries_from_release(download_dir)
else
# We are going to publish the new binaries we've just baked, take them
# out of the cache while they're hot.
download_cached_binaries(download_dir)
end

# Push up the JLL package (pointing to as-of-yet missing tarballs)
tag = "$(name)-v$(build_version)"
upload_prefix = "https://github.com/$(repo)/releases/download/$(tag)"
# binaries will be automatically placed in the `products/` subdir by the GitHub
# Actions workflow.
download_dir = joinpath(pwd(), "products")
# Grab the binaries for our package
if skip_build
# We only want to update the wrappers, so download the tarballs from the
# latest build.
download_binaries_from_release(download_dir)
end

# Push up the JLL package (pointing to as-of-yet missing tarballs)
tag = "$(name)-v$(build_version)"
upload_prefix = "https://github.com/$(repo)/releases/download/$(tag)"

# If we didn't rebuild the tarballs, save the original Artifacts.toml
artifacts_toml = skip_build ? read(joinpath(code_dir, "Artifacts.toml"), String) : ""
# This loop over the unmerged objects necessary in the event that we have multiple packages being built by a single build_tarballs.jl
for (i,json_obj) in enumerate(objs_unmerged)
from_scratch = (i == 1)
BinaryBuilder.rebuild_jll_package(json_obj; download_dir, upload_prefix, verbose, from_scratch)
end
# If we didn't rebuild the tarballs, save the original Artifacts.toml
artifacts_toml = skip_build ? read(joinpath(code_dir, "Artifacts.toml"), String) : ""
# This loop over the unmerged objects necessary in the event that we have multiple packages being built by a single build_tarballs.jl
for (i,json_obj) in enumerate(objs_unmerged)
from_scratch = (i == 1)
BinaryBuilder.rebuild_jll_package(json_obj; download_dir, upload_prefix, verbose, from_scratch)
end

# Restore Artifacts.toml
if skip_build
write(joinpath(code_dir, "Artifacts.toml"), artifacts_toml)
end
# Restore Artifacts.toml
if skip_build
write(joinpath(code_dir, "Artifacts.toml"), artifacts_toml)
end

# Push JLL package _before_ uploading to GitHub releases, so that this version of the code is what gets tagged
BinaryBuilder.push_jll_package(name, build_version)
# Push JLL package _before_ uploading to GitHub releases, so that this version of the code is what gets tagged
BinaryBuilder.push_jll_package(name, build_version; deploy_repo=repo)

if !skip_build
# Upload the tarballs to GitHub releases
BinaryBuilder.upload_to_github_releases(repo, tag, download_dir; verbose=verbose)
end
if !skip_build
# Upload the tarballs to GitHub releases
BinaryBuilder.upload_to_github_releases(repo, tag, download_dir; verbose=verbose)
end

# Sub off to Registrator to create a PR to General. Note: it's important to pass both
# `augment_platform_block` and `lazy_artifacts` to build the right Project dictionary
BinaryBuilder.register_jll(name, build_version, dependencies, julia_compat; augment_platform_block, lazy_artifacts)
gh_auth = Wizard.github_auth(;allow_anonymous=false)
gh_username = "enzymead-bot[bot]"
registry_url = "https://github.com/JuliaRegistries/General"
registry_fork_org = "EnzymeAD"
registry_fork_url = "https://$(gh_username):$(gh_auth.token)@github.com/EnzymeAD/General"
gh_auth_pr = authenticate(ENV["JLBUILD_GITHUB_TOKEN"])
BinaryBuilder.register_jll(name, build_version, dependencies, julia_compat;
deploy_repo=repo,
augment_platform_block,
lazy_artifacts,
gh_auth,
gh_username,
registry_url,
registry_fork_url,
registry_fork_org,
gh_auth_pr,
)
65 changes: 62 additions & 3 deletions .github/workflows/build-reactant-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: "Build Reactant_jll"

on:
workflow_call:
secrets:
ENZYMEAD_BOT_ID:
required: true
ENZYMEAD_BOT_PRIVATE_KEY:
required: true
inputs:
julia_version:
description: 'Julia version'
Expand Down Expand Up @@ -212,10 +217,36 @@ jobs:
needs: build-platforms

steps:
- uses: actions/create-github-app-token@v2
id: generate_token
with:
app-id: "${{ secrets.ENZYMEAD_BOT_ID }}"
private-key: "${{ secrets.ENZYMEAD_BOT_PRIVATE_KEY }}"
owner: EnzymeAD
repositories: |
Reactant_jll.jl
HelloWorldC_jll.jl
HelloWorldC2_jll.jl
ReactantBuilder
General
- uses: actions/checkout@v5
with:
repository: 'EnzymeAD/ReactantBuilder'
ref: ${{ inputs.reactantbuilder_ref == '' && github.sha || inputs.reactantbuilder_ref }}
- name: Set JULIA_PROJECT
# We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub
# is terrible and the two don't match inside containers:
# https://github.com/actions/runner/issues/2058
run:
echo "JULIA_PROJECT=${GITHUB_WORKSPACE}/.ci" >> "${GITHUB_ENV}"
- name: Set and create PRODUCTS_DIR
# We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub
# is terrible and the two don't match inside containers:
# https://github.com/actions/runner/issues/2058
run: |
PRODUCTS_DIR=${{ inputs.build_project }}/products
mkdir -p "${PRODUCTS_DIR}"
echo "PRODUCTS_DIR=${PRODUCTS_DIR}" >> "${GITHUB_ENV}"
- uses: julia-actions/setup-julia@v2
with:
version: '${{ inputs.julia_version }}'
Expand All @@ -225,13 +256,41 @@ jobs:
- uses: actions/download-artifact@v6
with:
merge-multiple: true
path: ${{ env.PRODUCTS_DIR }}
- name: Change Reactant commit
run: |
if [[ -n "${{ inputs.reactant_commit }}" ]]; then
echo 'Changing Reactant commit to ${{ inputs.reactant_commit }}...'
sed -i 's/reactant_commit = ".*"/reactant_commit = "'${{ inputs.reactant_commit }}'"/' R/Reactant/build_tarballs.jl
fi
- name: Check
- name: Set up git
run: |
git config --global user.name "$enzymead-bot[bot]"
git config --global user.email "238314553+enzymead-bot[bot]@users.noreply.github.com"
- name: Instantiate environment
timeout-minutes: 20
shell: julia --color=yes {0}
run: |
using Pkg
Pkg.instantiate()
- name: Generate meta.json
run: |
pwd
ls -lhrt
julia --color=yes --compile=min ./build_tarballs.jl --meta-json=$(basename ${{ inputs.build_project }}).meta.json
working-directory: ${{ inputs.build_project }}
env:
GITHUB_TOKEN:
- name: Register
run: |
julia --color=yes ${JULIA_PROJECT}/register_package.jl "$(basename ${{ inputs.build_project }}).meta.json" --verbose
working-directory: ${{ inputs.build_project }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
JLBUILD_GITHUB_TOKEN: ${{ secrets.JLBUILD_GITHUB_TOKEN }}
- name: Save Julia depot cache on cancel or failure
id: julia-cache-save
if: cancelled() || failure()
uses: actions/cache/save@v4
with:
path: |
${{ steps.julia-cache.outputs.cache-paths }}
key: ${{ steps.julia-cache.outputs.cache-key }}
1 change: 1 addition & 0 deletions .github/workflows/build-reactant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ jobs:
strategy:
fail-fast: false
uses: ./.github/workflows/build-reactant-reusable.yml
secrets: inherit
Loading