-
-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix relocatability * refactor shader source handling * add relocatability test workflow * rename workflow * fix path * add Test library * fix for linux
- Loading branch information
1 parent
1c2adb6
commit adc5c91
Showing
7 changed files
with
181 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Relocatability | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- '*.md' | ||
branches: | ||
- master | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
glmakie: | ||
name: GLMakie relocatability | ||
env: | ||
MODERNGL_DEBUGGING: "true" # turn on errors when running OpenGL tests | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- '1' # automatically expands to the latest stable 1.x release of Julia | ||
os: | ||
- ubuntu-20.04 | ||
arch: | ||
- x64 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: julia-actions/cache@v1 | ||
- run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev xsettingsd x11-xserver-utils | ||
- name: Relocatability test | ||
run: > | ||
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia ./relocatability.jl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
module_src = """ | ||
module MakieApp | ||
using GLMakie | ||
function julia_main()::Cint | ||
screen = display(scatter(1:4)) | ||
# wait(screen) commented out to test if this blocks anything, but didn't change anything | ||
return 0 # if things finished successfully | ||
end | ||
end # module MakieApp | ||
""" | ||
|
||
using Pkg, Test | ||
|
||
makie_dir = pwd() | ||
tmpdir = mktempdir() | ||
# create a temporary project | ||
cd(tmpdir) | ||
Pkg.generate("MakieApp") | ||
Pkg.activate("MakieApp") | ||
|
||
paths = [makie_dir, joinpath(makie_dir, "MakieCore"), joinpath(makie_dir, "GLMakie")] | ||
|
||
Pkg.develop(map(x-> (;path=x), paths)) | ||
|
||
open("MakieApp/src/MakieApp.jl", "w") do io | ||
print(io, module_src) | ||
end | ||
|
||
Pkg.activate(".") | ||
Pkg.add("PackageCompiler") | ||
|
||
using PackageCompiler | ||
|
||
create_app(joinpath(pwd(), "MakieApp"), "executable"; force=true, incremental=true, include_transitive_dependencies=false) | ||
exe = joinpath(pwd(), "executable", "bin", "MakieApp") | ||
@test success(`$(exe)`) | ||
julia_pkg_dir = joinpath(Base.DEPOT_PATH[1], "packages") | ||
@test isdir(julia_pkg_dir) | ||
mvd_julia_pkg_dir = julia_pkg_dir * ".old" | ||
# Move package dir so that we can test relocatability (hardcoded paths to package dir being invalid now) | ||
try | ||
mv(julia_pkg_dir, mvd_julia_pkg_dir) | ||
@test success(`$(exe)`) | ||
catch e | ||
mv(mvd_julia_pkg_dir, julia_pkg_dir) | ||
end |