Skip to content

Commit 00cc78d

Browse files
giordanostaticfloat
authored andcommitted
[skip travis] Improve documentation of Override for JLL packages
1 parent 91e6bd3 commit 00cc78d

File tree

1 file changed

+59
-12
lines changed

1 file changed

+59
-12
lines changed

docs/src/jll.md

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ current JLL package. Among others, they also define the following unexported
9696
variables:
9797

9898
* `artifact_dir`: the absolute path to where the artifact for the current
99-
platform has been installed;
99+
platform has been installed. This is the "prefix" where the
100+
binaries/libraries/files are placed;
100101
* `PATH`: the value of the
101102
[`PATH`](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable
102103
needed to run executables in the current JLL package, if any;
@@ -210,14 +211,60 @@ defined for it are:
210211
* `data_txt_path`: this unexported variable is actually equal to `data_txt`, but
211212
is kept for consistency with all other product types.
212213

213-
214-
## Overriding `dev`'ed JLL packages
215-
216-
In the event that a user wishes to override the content within a JLL package with
217-
their own binaries/libraries/files, the user may use the `dev_jll()` method provided
218-
by JLL packages to check out a mutable copy of the package to their `~/.julia/dev`
219-
directory. An `override` directory will be created within that package directory,
220-
providing a convenient location for the user to copy in their own files over the
221-
typically artifact-sourced ones. See the segment on "Building and testing JLL
222-
packages locally" in the [Building Packages](./building.md) section of this
223-
documentation for more information on this capability.
214+
## Overriding the artifacts in JLL packages
215+
216+
As explained above, JLL packages use the [Artifacts
217+
system](https://julialang.github.io/Pkg.jl/v1/artifacts) to provide the files.
218+
If you wish to override the content of an artifact with their own
219+
binaries/libraries/files, you can use the [`Overrides.toml`
220+
file](https://julialang.github.io/Pkg.jl/v1/artifacts/#Overriding-artifact-locations-1).
221+
222+
We detail below a couple of different ways to override the artifact of a JLL
223+
package, depending on whether the package is `dev`'ed or not. The second method
224+
is particularly recommended to system administrator who wants to use system
225+
libraries in place of the libraries in JLL packages.
226+
227+
### `dev`'ed JLL packages
228+
229+
In the event that a user wishes to override the content within a `dev`'ed JLL
230+
package, the user may use the `dev_jll()` method provided by JLL packages to
231+
check out a mutable copy of the package to their `~/.julia/dev` directory. An
232+
`override` directory will be created within that package directory, providing a
233+
convenient location for the user to copy in their own files over the typically
234+
artifact-sourced ones. See the segment on "Building and testing JLL packages
235+
locally" in the [Building Packages](./building.md) section of this documentation
236+
for more information on this capability.
237+
238+
### Non-`dev`'ed JLL packages
239+
240+
As an example, in a Linux system you can override the Zlib library provided by
241+
[`Zlib_jll.jl`](https://github.com/JuliaBinaryWrappers/Zlib_jll.jl) and the
242+
Bzip2 library provided by
243+
[`Bzip2_jll.jl`](https://github.com/JuliaBinaryWrappers/Bzip2_jll.jl)
244+
respectively with `/usr/lib/libz.so` and `/usr/local/lib/libbz2.so` with the
245+
following `Overrides.toml`:
246+
```toml
247+
[83775a58-1f1d-513f-b197-d71354ab007a]
248+
Zlib = "/usr"
249+
250+
[6e34b625-4abd-537c-b88f-471c36dfa7a0]
251+
Bzip2 = "/usr/local"
252+
```
253+
Some comments about how to write this file:
254+
* The UUIDs are those of the JLL packages,
255+
`83775a58-1f1d-513f-b197-d71354ab007a` for `Zlib_jll.jl` and
256+
`6e34b625-4abd-537c-b88f-471c36dfa7a0` for `Bzip2_jll.jl`. You can either
257+
find them in the `Project.toml` files of the packages (e.g., see [the
258+
`Project.toml` file of
259+
`Zlib_jll`](https://github.com/JuliaBinaryWrappers/Zlib_jll.jl/blob/5c4fb6dc1eaa812eb0d464cb5cb4450877dfeaf1/Project.toml#L2))
260+
or look it up in the registry (e.g., see [the entry for `Zlib_jll` in the
261+
General
262+
registry](https://github.com/JuliaRegistries/General/blob/13c47161711549e3cd20160194ada4a7cca5102a/Z/Zlib_jll/Package.toml#L2)).
263+
* The artifact provided by JLL packages has the same name as the package,
264+
without the trailing `_jll`, `Zlib` and `Bzip2` in this case.
265+
* The artifact location is held in the `artifact_dir` variable mentioned above,
266+
which is the "prefix" of the installation of the package. Recall the paths of
267+
the products in the JLL package is relative to `artifact_dir` and the files
268+
you want to use to override the products of the JLL package must have the same
269+
tree structure as the artifact. In our example we need to use `/usr` to
270+
override Zlib and `/usr/local` for Bzip2.

0 commit comments

Comments
 (0)