For each package name P given, goget.sh examines go.mod to find a
matching module and its pegged version V, then executes “go get P@V” to
install that specific version.
realpath(1) is not available on macOS.
(Funny, because realpath(3) originated in FreeBSD, so it came to macOS
before Linux adopted it, but Linux beat macOS to realpath(1).)
This is because it may fail if the codegen tools are not found.
If failed, skip the status compare step because it may as well return a
false positive, i.e. generated code is not up to date but the codegen
tool to bring it up to date was not found so no diff was detected.
DYLD_LIBRARY_PATH has a “look here first before usual places” semantics,
in order to let users use an alternative version of a shared library.
On the other side, DYLD_FALLBACK_LIBRARY_PATH has a “look here if not
found in usual places” semantics, in order to let users specify
additional locations where a shared library is found.
In our case, if a binary refers to a common shared library found in
usual places, we want to use it; we simply want to specify additional
locations where BLS/MCL/OpenSSL libraries are found. So it is more
appropriate to use DYLD_FALLBACK_LIBRARY_PATH.
This also fixes a nasty symbol table mismatch, which is the main reason
for this change: Certain commonly used shared libraries - such as
libJPEG.dylib, co-located within the ImageIO framework and expected by
the main ImageIO library – are often also found in Homebrew or MacPorts
root (/opt/local//lib for MacPort). If DYLD_LIBRARY_PATH included
/opt/local/lib for OpenSSL, many system programs linked against ImageIO
will erroneously pick up libJPEG.dylib in /opt/local/lib, which lacks
certain internal symbols that the framework version has. Using
DYLD_FALLBACK_LIBRARY_PATH makes dyld honor the full path to the
framework version of libJPEG, which is hardcoded in the main ImageIO
framework library.
We may need to build one binary for testing.
This change enables building one binary only to speed up the testing
process.
Signed-off-by: Leo Chen <leo@harmony.one>