Skip to content
Merged
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
1 change: 0 additions & 1 deletion .githash

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,37 @@ jobs:

- uses: julia-actions/cache@v2

- name: Detect Legate branch override
id: legate-branch
run: |
MSG=$(printf '%s\n%s' \
"${{ github.event.head_commit.message }}" \
"${{ github.event.pull_request.body }}")
BRANCH=$(echo "$MSG" | grep -oiP 'legate[-_]branch:\s*\K\S+' | head -1 | tr -d '[]' || true)
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
if [[ -n "$BRANCH" ]]; then
echo "Using Legate.jl branch override: $BRANCH"
else
echo "No Legate.jl branch override — using JLL"
fi

- name: Checkout Legate.jl branch override
if: steps.legate-branch.outputs.branch != ''
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/Legate.jl
ref: ${{ steps.legate-branch.outputs.branch }}
path: Legate.jl

- name: Develop Legate.jl branch override
if: steps.legate-branch.outputs.branch != ''
run: |
julia --color=yes -e '
using Pkg;
Pkg.develop(PackageSpec(path = "Legate.jl/lib/LegatePreferences"))
Pkg.develop(PackageSpec(path = "Legate.jl"))
'

- name: Run tests
env:
GPUTESTS: "0" # parsed by runtests.jl
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ node_modules
*.exe
*.out
*.app
.githash
9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,3 @@ repos:
entry: julia --project=. -e 'using JuliaFormatter; format(ARGS, verbose=true)'
language: system
types: [julia]

- id: update-githash
name: Update .githash
description: "Write the current git commit hash to .githash"
entry: bash -c 'git rev-parse HEAD > .githash'
language: system
always_run: true
pass_filenames: false
stages: [post-commit]
7 changes: 6 additions & 1 deletion src/utilities/preference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,10 @@ function find_dependency_paths(::Type{CNPreferences.JLL})
return results
end

find_dependency_paths(::Type{CNPreferences.Developer}) = Dict{String,String}()
function find_dependency_paths(::Type{CNPreferences.Developer})
isdefined(@__MODULE__, :cupynumeric_jll) || return Dict{String,String}()
paths = getfield(@__MODULE__, :cupynumeric_jll).LIBPATH_list
return Dict(name => dirname(Libdl.find_library(lib, paths)) for (name, lib) in DEPS_MAP)
end

find_dependency_paths(::Type{CNPreferences.Conda}) = Dict{String,String}()
9 changes: 7 additions & 2 deletions src/utilities/version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ function get_cxx_version(libpath::AbstractString)
end

function read_githash()
githash_path = joinpath(@__DIR__, "../", "../", ".githash")
return isfile(githash_path) ? readchomp(githash_path) : "unknown"
try
pkg_root = joinpath(@__DIR__, "..", "..")
hash = readchomp(`git -C $pkg_root rev-parse HEAD`)
isempty(hash) || return hash
catch
end
return "unknown"
end

@doc"""
Expand Down
Loading