From 77f4449246370418d96bbbaeae4d5bd7ca834cc8 Mon Sep 17 00:00:00 2001 From: Clonkk Date: Mon, 21 Oct 2024 10:29:36 +0200 Subject: [PATCH 1/5] Fix Julia 1.11 jl_array_data -> jl_array-data_; TODO investigate new API --- nimjl/config.nim | 10 +++++----- nimjl/private/jlarrays.nim | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/nimjl/config.nim b/nimjl/config.nim index 8489a9d..6e28207 100644 --- a/nimjl/config.nim +++ b/nimjl/config.nim @@ -23,11 +23,11 @@ when exitCode != 0: const JuliaArrayVersion* = cmdOutput.split("\"")[1].split(".") - # For release : result has the form ["v", "1.6.0", ""] -> splitting [1] yiels ["1", "6, "0"] - # For dev: result has the form ["v", "1.7.0-DEV", "667"] -> splitting [1] yiels ["1", "7, "0-DEV", "667"] -const JuliaMajorVersion* = JuliaArrayVersion[0].parseInt -const JuliaMinorVersion* = JuliaArrayVersion[1].parseInt -const JuliaPatchVersion* = JuliaArrayVersion[2].parseInt + # For release : result has the form ["v", "1.6.0", ""] -> splitting [1] yields ["1", "6, "0"] + # For dev: result has the form ["v", "1.7.0-DEV", "667"] -> splitting [1] yields ["1", "7, "0-DEV", "667"] +const JuliaMajorVersion* = JuliaArrayVersion[0].parseInt() +const JuliaMinorVersion* = JuliaArrayVersion[1].parseInt() +const JuliaPatchVersion* = JuliaArrayVersion[2].parseInt() const libPrefix = "lib" const libSuffix = ".so" const JuliaLibName* = JuliaLibPath / libPrefix & "julia" & libSuffix diff --git a/nimjl/private/jlarrays.nim b/nimjl/private/jlarrays.nim index ab0a548..9bc8da4 100644 --- a/nimjl/private/jlarrays.nim +++ b/nimjl/private/jlarrays.nim @@ -11,7 +11,12 @@ template julia_type(arg: typedesc): ptr jl_datatype = ## Array bindings {.push nodecl, header: JuliaHeader, dynlib: JuliaLibName.} -proc jl_array_data*(values: ptr jl_array): pointer {.importc.} + +when (JuliaMajorVersion, JuliaMinorVersion) >= (1, 11): + proc jl_array_data*(values: ptr jl_array): pointer {.importc: "jl_array_data_".} +else: + proc jl_array_data*(values: ptr jl_array): pointer {.importc: "jl_array_data".} + proc jl_array_dim*(a: ptr jl_array, dim: cint): cint {.importc.} proc jl_array_len*(a: ptr jl_array): cint {.importc.} proc jl_array_rank*(a: ptr jl_value): cint {.importc.} From 0e1616be85c92b6ec8a3b5a711fe6173b168be61 Mon Sep 17 00:00:00 2001 From: Clonkk Date: Mon, 21 Oct 2024 10:43:38 +0200 Subject: [PATCH 2/5] add Julia test matrix --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c2fe4c..200d380 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,10 @@ jobs: os: - ubuntu-latest - macOS-latest + julia: + - 1.10 + - 1.11 + - lts steps: - uses: actions/checkout@v4 @@ -34,6 +38,8 @@ jobs: uses: julia-actions/setup-julia@latest with: show-versioninfo: 'true' + arch: ${{ runner.arch }} + version: '${{ matrix.julia }}' - run: nimble install -y env: From b29fc635d3a614f15fba1282d484177ffaa7d299 Mon Sep 17 00:00:00 2001 From: Clonkk Date: Mon, 21 Oct 2024 10:44:59 +0200 Subject: [PATCH 3/5] julai lts do not support ac os --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 200d380..03ece06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,6 @@ jobs: julia: - 1.10 - 1.11 - - lts steps: - uses: actions/checkout@v4 From 920e932e95c9f61268ef08d449330538354d3476 Mon Sep 17 00:00:00 2001 From: Clonkk Date: Mon, 21 Oct 2024 10:49:03 +0200 Subject: [PATCH 4/5] fix yaml formatting in gh action --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03ece06..93d3d82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,8 @@ jobs: - ubuntu-latest - macOS-latest julia: - - 1.10 - - 1.11 + - '1.10' + - '1.11' steps: - uses: actions/checkout@v4 @@ -38,7 +38,7 @@ jobs: with: show-versioninfo: 'true' arch: ${{ runner.arch }} - version: '${{ matrix.julia }}' + version: ${{ matrix.julia }} - run: nimble install -y env: From 442ed5130d13a8f42488b6f492d0421e23cacca2 Mon Sep 17 00:00:00 2001 From: Clonkk Date: Mon, 21 Oct 2024 11:07:54 +0200 Subject: [PATCH 5/5] only tests standard Linux --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93d3d82..184c43d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,10 +18,11 @@ jobs: - devel os: - ubuntu-latest - - macOS-latest + # - macOS-latest julia: - '1.10' - '1.11' + - 'lts' steps: - uses: actions/checkout@v4