Skip to content

Commit 419573d

Browse files
[Docs] Improve documentation of ExecutableProduct wrappers (#1028)
* [Docs] Improve documentation of `ExecutableProduct` wrappers Mention the new recommended (and thread-safe) syntax to call the function wrapper. * Apply suggestions from code review Co-authored-by: Elliot Saba <[email protected]> Co-authored-by: Elliot Saba <[email protected]>
1 parent a3d21e6 commit 419573d

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

docs/src/jll.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,25 +165,34 @@ defines the following variables:
165165
An [`ExecutableProduct`](@ref) is a binary executable that can be run on the
166166
current platform. If, for example, the `ExecutableProduct` has been called
167167
`mungify_exe`, the wrapper defines an exported function named `mungify_exe` that
168-
should run by the user in the following way:
168+
should run by the user in one the following ways:
169+
versions:
170+
171+
```julia
172+
# Only available in Julia v1.6+
173+
run(`$(mungify_exe()) $arguments`)
174+
```
169175

170176
```julia
171177
mungify_exe() do exe
172178
run(`$exe $arguments`)
173179
end
174180
```
175181

176-
Note that in this example `exe` can be replaced with any name of your choice:
182+
Note that in the latter form `exe` can be replaced with any name of your choice:
177183
with the
178184
[`do`-block](https://docs.julialang.org/en/v1/manual/functions/#Do-Block-Syntax-for-Function-Arguments-1)
179185
syntax you are defining the name of the variable that will be used to actually
180186
call the binary with
181187
[`run`](https://docs.julialang.org/en/v1/base/base/#Base.run).
182188

189+
The former form is only available when using Julia v1.6, but should be
190+
preferred going forward, as it is thread-safe and generally more flexible.
191+
183192
A common point of confusion about `ExecutableProduct`s in JLL packages is why
184-
this function is needed: while in principle you could directly run the
185-
executable directly by using its absolute path in `run`, this wrapper function
186-
ensures that the executable will find all shared libraries it needs while running.
193+
these function wrappers are needed: while in principle you could run the
194+
executable directly by using its absolute path in `run`, these functions ensure
195+
that the executable will find all shared libraries it needs while running.
187196

188197
In addition to the function called `mungify_exe`, for this product there will be
189198
the following unexported variables:

0 commit comments

Comments
 (0)