Skip to content

Commit 38ba1d0

Browse files
authored
Set JULIA_PKGDIR before Julia ever starts up when building docs (#25009)
Attempting to set `ENV["JULIA_PKGDIR"]` from within Julia doesn't work, as the `LOAD_CACHE_PATH` is initialized within an `__init__()` function within `Pkg`, causing compile cache files to be saved to the default location (within the user's `$HOME`) rather than the override location. This change ensures that the docs pkg environment is properly confined.
1 parent d9a0049 commit 38ba1d0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

doc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SRCDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
77
JULIAHOME := $(abspath $(SRCDIR)/..)
88
include $(JULIAHOME)/Make.inc
99
JULIA_EXECUTABLE := $(call spawn,$(build_bindir)/julia)
10+
export JULIA_PKGDIR := $(abspath $(SRCDIR)/deps)
1011

1112
.PHONY: help clean cleanall html pdf linkcheck doctest check deps deploy
1213

doc/make.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Install dependencies needed to build the documentation.
2-
ENV["JULIA_PKGDIR"] = joinpath(@__DIR__, "deps")
2+
if ENV["JULIA_PKGDIR"] != joinpath(@__DIR__, "deps")
3+
# We clobber package repositories here, so don't let the user hurt themselves
4+
error("Must set JULIA_PKGDIR to $(joinpath(@__DIR__, "deps"))")
5+
else
6+
info(ENV["JULIA_PKGDIR"])
7+
end
38
Pkg.init()
49
cp(joinpath(@__DIR__, "REQUIRE"), Pkg.dir("REQUIRE"); remove_destination = true)
510
Pkg.update()

0 commit comments

Comments
 (0)