You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Makefile caching helpers for lazy, expensive evaluations
Makefiles natively offer two variable expansion modes: immediate and
deferred. When expanding variables that require invocations of external
programs (such as `llvm-config`) immediate expansion is almost always
preferred, as it will run the external command once, exactly when the
makefile variable is defined. Deferred mode, on the other hand, will
expand the variable every time it is used, running the external program
again and again.
When the external program is expensive, this cost can slow down the
build significantly, however when the external program requires some
setup (for instance, when it itself is downloaded through other rules in
the Makefile) it cannot always be immediately expanded. To address
this, we build a caching layer that allows for deferred expansion, but
once it has been expanded once, the variable is replaced with the result
of running the command, and further hits to the same variable will
return the cached value. (With the slight caveat that an empty result
will cause the external command to be run again in the future).
As an example usecase, this commit converts our relative path
calculation to use a python script and showcases how to cache this
operation. This will be used for further JLL stdlib work where the
invocation is much more expensive.
Copy file name to clipboardExpand all lines: contrib/README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Installation
14
14
|[ julia-config.jl ](https://github.com/JuliaLang/julia/blob/master/contrib/julia-config.jl)| Determines build parameters required by an embedded Julia |
|[ mac/ ](https://github.com/JuliaLang/julia/blob/master/contrib/mac/)| Mac install files |
17
-
|[ relative_path.sh](https://github.com/JuliaLang/julia/blob/master/contrib/relative_path.sh)| Convert absolute path into relative path script|
17
+
|[ relative_path.py](https://github.com/JuliaLang/julia/blob/master/contrib/relative_path.py)| Convert absolute paths into relative paths|
18
18
|[ repackage_system_suitesparse4.make ](https://github.com/JuliaLang/julia/blob/master/contrib/repackage_system_suitesparse4.make)| Links shared libraries from static-library for suitesparse4 |
19
19
|[ stringreplace.c ](https://github.com/JuliaLang/julia/blob/master/contrib/stringreplace.c)| Replace strings to hardcoded paths in binaries during `make install`|
20
20
|[ travis_fastfail.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/travis_fastfail.sh)| Checks for queued build tests in Travis |
0 commit comments