diff --git a/.githash b/.githash deleted file mode 100644 index f2d1e6df..00000000 --- a/.githash +++ /dev/null @@ -1 +0,0 @@ -3713a2acb6579891706b08f970e99f9ae5e6472f diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d381f5f..3fc64c8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.gitignore b/.gitignore index 0046a57e..8a7dd6c8 100644 --- a/.gitignore +++ b/.gitignore @@ -82,3 +82,4 @@ node_modules *.exe *.out *.app +.githash diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37b95947..03d02289 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/src/utilities/preference.jl b/src/utilities/preference.jl index bb2effb9..1b2852d2 100644 --- a/src/utilities/preference.jl +++ b/src/utilities/preference.jl @@ -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}() diff --git a/src/utilities/version.jl b/src/utilities/version.jl index b2cf79fa..5dabd527 100644 --- a/src/utilities/version.jl +++ b/src/utilities/version.jl @@ -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"""