Skip to content

Commit ea6cf5a

Browse files
authored
Merge pull request #47 from nickrobinson251/npr-jl-1-12
Try fix `static_method*` for Julia v1.12
2 parents 6cbf20a + a7e0e31 commit ea6cf5a

File tree

4 files changed

+15
-40
lines changed

4 files changed

+15
-40
lines changed

.github/workflows/CI.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
version:
16-
#- "1.0" is currently broken: https://github.com/oxinabox/Tricks.jl/issues/33
17-
#- "1.0" # LTS: limited compat features
18-
- "1.3" # most features work only on 1.3+
16+
#- "1.0" is currently broken: https://github.com/oxinabox/Tricks.jl/issues/33
17+
- "1.3" # most features work only on 1.3+
1918
- "1" # Latest Release
19+
- "1.11"
20+
- "~1.12.0-rc1"
2021
os:
2122
- ubuntu-latest
22-
- macOS-latest
23-
- windows-latest
2423
arch:
2524
- x64
2625
steps:
@@ -29,17 +28,7 @@ jobs:
2928
with:
3029
version: ${{ matrix.version }}
3130
arch: ${{ matrix.arch }}
32-
- uses: actions/cache@v2
33-
env:
34-
cache-name: cache-artifacts
35-
with:
36-
path: ~/.julia/artifacts
37-
key: ${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
38-
restore-keys: |
39-
${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-
40-
${{ runner.os }}-${{ matrix.arch }}-test-
41-
${{ runner.os }}-${{ matrix.arch }}-
42-
${{ runner.os }}-
31+
- uses: julia-actions/cache@v2
4332
- uses: julia-actions/julia-buildpkg@v1
4433
- uses: julia-actions/julia-runtest@v1
4534
- uses: julia-actions/julia-processcoverage@v1
@@ -62,4 +51,3 @@ jobs:
6251
with:
6352
github-token: ${{ secrets.GITHUB_TOKEN }}
6453
parallel-finished: true
65-

.github/workflows/JuliaNightly.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,14 @@ jobs:
1717
- 'nightly'
1818
os:
1919
- ubuntu-latest
20-
- macOS-latest
21-
- windows-latest
2220
arch:
23-
- x86
2421
- x64
25-
exclude:
26-
# 32-bit Julia binaries are not available on macOS
27-
- os: macOS-latest
28-
arch: x86
2922
steps:
3023
- uses: actions/checkout@v2
3124
- uses: julia-actions/setup-julia@v1
3225
with:
3326
version: ${{ matrix.version }}
3427
arch: ${{ matrix.arch }}
35-
- uses: actions/cache@v2
36-
env:
37-
cache-name: cache-artifacts
38-
with:
39-
path: ~/.julia/artifacts
40-
key: ${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
41-
restore-keys: |
42-
${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-
43-
${{ runner.os }}-${{ matrix.arch }}-test-
44-
${{ runner.os }}-${{ matrix.arch }}-
45-
${{ runner.os }}-
28+
- uses: julia-actions/cache@v2
4629
- uses: julia-actions/julia-buildpkg@v1
4730
- uses: julia-actions/julia-runtest@v1

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Tricks"
22
uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
33
authors = ["Frames White"]
4-
version = "0.1.10"
4+
version = "0.1.11"
55

66
[compat]
77
julia = "1.0"

src/Tricks.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ else
9696
end
9797

9898
function _method_table_all_edges_all_methods(f, T, world = Base.get_world_counter())
99-
mt = f.name.mt
100-
10199
# We add an edge to the MethodTable itself so that when any new methods
102100
# are defined, it recompiles the function.
103-
@static if VERSION < v"1.12.0-DEV.1531"
101+
@static if VERSION < v"1.12.0-DEV"
102+
mt = f.name.mt
104103
mt_edges = Core.Compiler.vect(mt, Tuple{f,Vararg{Any}})
105104
else
105+
mt = Core.GlobalMethods
106106
mt_edges = Core.Compiler.vect(Tuple{f, Vararg{Any}}, mt)
107107
end
108108

@@ -171,7 +171,11 @@ function _methods(@nospecialize(f_type), @nospecialize(t_type),
171171
else
172172
ms = Base.Method[_get_method(m) for m in mft if (mod === nothing || m.method.module mod)]
173173
end
174-
return Base.MethodList(ms, f_type.name.mt)
174+
@static if VERSION < v"1.12.0-DEV"
175+
return Base.MethodList(ms, f_type.name.mt)
176+
else
177+
return Base.MethodList(ms, f_type.name)
178+
end
175179
end
176180

177181
# Like Core.Compiler.method_instances, but accepts f as a _type_ instead of an instance.

0 commit comments

Comments
 (0)