Skip to content

Commit a221165

Browse files
authored
fix: use RelocatableFolders.@path for shared precompile path (#5597)
fix: use RelocatableFolders.@path for shared precompile file path The backends computed the path to shared-precompile.jl via pathof(Makie), which bakes in an absolute path that breaks after package relocation. Also removes a stale `import Makie: RelocatableFolders` from GLMakie.
1 parent d3e18e9 commit a221165

File tree

7 files changed

+8
-14
lines changed

7 files changed

+8
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
- Fixed shared precompile file path not being relocatable by using `RelocatableFolders.@path` [#5597](https://github.com/MakieOrg/Makie.jl/pull/5597)
56
- Added possibility to gather legend entries from multiple axes [#5551](https://github.com/MakieOrg/Makie.jl/pull/5551)
67
- Added complete inverse transformation support to `register_projected_positions!` with `apply_inverse_transform`, `apply_inverse_transform_func`, `apply_inverse_float32convert`, and `apply_inverse_model` kwargs. These enable correct projection from non-data spaces back to data space. Includes early-exit optimization to skip redundant transform/inverse pairs when `input_space === output_space`. [#5485](https://github.com/MakieOrg/Makie.jl/pull/5485)
78
- Fixed `bracket` not supporting `LaTeXString` text, which would render with dollar signs instead of mathematical notation [#5536](https://github.com/MakieOrg/Makie.jl/pull/5536)

CairoMakie/src/precompiles.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ end
1010
let
1111
@compile_workload begin
1212
CairoMakie.activate!()
13-
base_path = normpath(joinpath(dirname(pathof(Makie)), "..", "precompile"))
14-
shared_precompile = joinpath(base_path, "shared-precompile.jl")
15-
include(shared_precompile)
13+
include(Makie.SHARED_PRECOMPILE_PATH)
1614
# Cleanup globals to avoid serializing stale state (fonts, figures, tasks)
1715
# Note: __init__ doesn't run during precompilation, so we must always clean up here
1816
Makie.cleanup_globals()

GLMakie/src/GLMakie.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ using Makie: to_native
2020
using Makie: spaces, is_data_space, is_pixel_space, is_relative_space, is_clip_space
2121
using Makie: BudgetedTimer, reset!
2222
import Makie: to_font, el32convert, Shape, CIRCLE, RECTANGLE, ROUNDED_RECTANGLE, DISTANCEFIELD, TRIANGLE
23-
import Makie: RelocatableFolders
2423

2524
using ShaderAbstractions
2625
using FreeTypeAbstraction

GLMakie/src/precompiles.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ let
2121
close(screen)
2222
destroy!(screen)
2323

24-
base_path = normpath(joinpath(dirname(pathof(Makie)), "..", "precompile"))
25-
shared_precompile = joinpath(base_path, "shared-precompile.jl")
26-
include(shared_precompile)
24+
include(Makie.SHARED_PRECOMPILE_PATH)
2725
try
2826
display(plot(x); visible = false)
2927
catch

Makie/src/Makie.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ using ComputePipeline
4949

5050
import Unitful
5151
import UnicodeFun
52-
import RelocatableFolders
52+
using RelocatableFolders: @path
5353
import StatsBase
5454
import Distributions
5555
import KernelDensity
@@ -451,6 +451,8 @@ end
451451

452452
export cleanup_globals
453453

454+
const SHARED_PRECOMPILE_PATH = @path joinpath(@__DIR__, "..", "precompile", "shared-precompile.jl")
455+
454456
include("precompiles.jl")
455457

456458
end # module

Makie/src/precompiles.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ let
2626
f = Figure()
2727
ax = Axis(f[1, 1])
2828
Makie.initialize_block!(ax)
29-
base_path = normpath(joinpath(dirname(pathof(Makie)), "..", "precompile"))
30-
shared_precompile = joinpath(base_path, "shared-precompile.jl")
31-
include(shared_precompile)
29+
include(SHARED_PRECOMPILE_PATH)
3230
# Cleanup globals to avoid serializing stale state (fonts, figures, tasks)
3331
# Note: __init__ doesn't run during precompilation, so we must always clean up here
3432
cleanup_globals()

WGLMakie/src/precompiles.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ end
2323
let
2424
@compile_workload begin
2525
WGLMakie.activate!()
26-
base_path = normpath(joinpath(dirname(pathof(Makie)), "..", "precompile"))
27-
shared_precompile = joinpath(base_path, "shared-precompile.jl")
28-
include(shared_precompile)
26+
include(Makie.SHARED_PRECOMPILE_PATH)
2927
# Cleanup globals to avoid serializing stale state (servers, sessions, fonts, figures, tasks)
3028
# Note: __init__ doesn't run during precompilation, so we must always clean up here
3129
Bonito.cleanup_globals()

0 commit comments

Comments
 (0)