Summary:
How can I install a package locally and on a server, where both locations are in DEPOT_PATH
&/or LOAD_PATH
, but local version takes priority?
I have a setup with multiple machines, and for ease of management, I have configured “centralized” packages. I add and update packages on one machine and all others load from that machine. This has worked well for pure Julia packages, but there can be issues when there are binary dependencies. So I wanted to be able to install a few selected packages (the problematic ones with binary dependencies) on each machine but still have most packages load from the centralized depot.
With DEPOT_PATH
and LOAD_PATH
as follows:
DEPOT_PATH
"C:\\Users\\user\\.julia"
"\\\\Server\\Users\\user\\.julia"
LOAD_PATH
"@"
"@v#.#"
"@stdlib"
If Pkg
environment has not been initialized on remote machine:
Base.load_path()
"\\\\Server\\Users\\user\\.julia\\environments\\v1.4\\Project.toml"
"C:\\Program Files\\Julia-1.4.1\\share\\julia\\stdlib\\v1.4"
If Pkg
environment has been initialized on remote machine:
Base.load_path()
"C:\\Users\\user\\.julia\\environments\\v1.4\\Project.toml"
"C:\\Program Files\\Julia-1.4.1\\share\\julia\\stdlib\\v1.4"
But what I really want (I think) is the following:
Base.load_path()
"C:\\Users\\user\\.julia\\environments\\v1.4\\Project.toml"
"\\\\Server\\Users\\user\\.julia\\environments\\v1.4\\Project.toml"
"C:\\Program Files\\Julia-1.4.1\\share\\julia\\stdlib\\v1.4"
I can do this by adding the servers environment to LOAD_PATH:
"@"
"@v#.#"
"@stdlib"
"\\\\Server\\Users\\user\\.julia\\environments\\v1.4\\Project.toml"
But this still doesn’t work.
If I add a package, it presumably updates the local Project.toml
, but does not install the package locally. If that package has a binary dependency, it can run/load properly.
Is there a way to selectively install packages locally as well as loading from a server?