Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the custom sysimage when running documentation (and doctests) as well #1226

Merged
merged 4 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .ci/create_sysimage.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using PackageCompiler, Libdl

function create_sysimage_linear_algebra()
sysimage = tempname() * "." * Libdl.dlext

if haskey(ENV, "BUILDKITE")
ncores = Sys.CPU_THREADS
else
ncores = ceil(Int, Sys.CPU_THREADS / 2)
end

withenv("JULIA_IMAGE_THREADS" => ncores) do
create_sysimage(["LinearAlgebra", "Test", "Distributed", "Dates", "Printf", "Random"]; sysimage_path=sysimage, incremental=false, filter_stdlibs=true)
end
return sysimage, ncores
end
6 changes: 6 additions & 0 deletions .ci/create_sysimage_and_run_docs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include("create_sysimage.jl")
sysimage, ncores = create_sysimage_linear_algebra()
doc_file = joinpath(@__DIR__, "..", "docs", "make.jl")
withenv("JULIA_NUM_THREADS" => 1) do
run(`$(Base.julia_cmd()) --sysimage=$sysimage --project=$(dirname(doc_file)) $doc_file`)
end
16 changes: 2 additions & 14 deletions .ci/create_sysimage_and_run_tests.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
using PackageCompiler, Libdl

sysimage = tempname() * "." * Libdl.dlext

if haskey(ENV, "BUILDKITE")
ncores = Sys.CPU_THREADS
else
ncores = ceil(Int, Sys.CPU_THREADS / 2)
end

withenv("JULIA_IMAGE_THREADS" => ncores) do
create_sysimage(["LinearAlgebra", "Test", "Distributed", "Dates", "Printf", "Random"]; sysimage_path=sysimage, incremental=false, filter_stdlibs=true)
end

include("create_sysimage.jl")
sysimage, ncores = create_sysimage_linear_algebra()
current_dir = @__DIR__
cmd = """Base.runtests(["LinearAlgebra"]; propagate_project=true, ncores=$ncores)"""
withenv("JULIA_NUM_THREADS" => 1) do
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
version: 'nightly'
- name: Generate docs
run: |
julia --project --color=yes -e ''
julia --project --color=yes -e 'using Pkg; Pkg.respect_sysimage_versions(false); Pkg.activate("docs"); Pkg.develop(PackageSpec(path = pwd()))'
julia --project=docs --color=yes docs/make.jl
julia --color=yes --project=.ci -e 'using Pkg; Pkg.instantiate()'
julia --color=yes --project=docs -e 'using Pkg; Pkg.instantiate()'
julia --color=yes --project=.ci .ci/create_sysimage_and_run_docs.jl
env:
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[sources]
LinearAlgebra = {path = ".."}
4 changes: 2 additions & 2 deletions src/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ julia> C.U
⋅ ⋅ 3.0

julia> C.L
3×3 LowerTriangular{Float64, Adjoint{Matrix{Float64}}}:
3×3 LowerTriangular{Float64, Adjoint{Float64, Matrix{Float64}}}:
2.0 ⋅ ⋅
6.0 1.0 ⋅
-8.0 5.0 3.0
Expand Down Expand Up @@ -530,7 +530,7 @@ julia> C.U
⋅ ⋅ 3.0

julia> C.L
3×3 LowerTriangular{Float64, Adjoint{Matrix{Float64}}}:
3×3 LowerTriangular{Float64, Adjoint{Float64, Matrix{Float64}}}:
2.0 ⋅ ⋅
6.0 1.0 ⋅
-8.0 5.0 3.0
Expand Down