Closed shenxianpeng closed 2 weeks ago
I was looking at what recently changed in the MacOS runners, and I found that XCode v15.4.0 was updated to a stable release (see this PR). Maybe there was some other change in the std lib that is included with XCode v15.4.0?
EDIT: See XCode changelog here
I don't understand why only versions 15~18 were affected not all versions on MacOS. maybe it is also related to the llvm-project source code from version 15 to 18?
I'm not sure why the binaries are linked to a zstd library. Recently, the macos-14 image had bumped zstd from v1.5.5 to v1.5.6.
maybe I can try to create a link for zstd lib
sudo ln -s /opt/homebrew/Cellar/zstd/1.5.6/lib/libzstd.1.5.6.dylib /usr/lib/libzstd.1.dylib
# or just
sudo ln -s /opt/homebrew/Cellar/zstd/1.*/lib/libzstd.1.*.dylib /usr/lib/libzstd.1.dylib
The wildcard might be better, but you'd have to recreate that symbol link on every Mac machine that uses the static binary.
I skimmed the zstd lib's manual, and I found
Advanced experimental functions can be accessed using
#define ZSTD_STATIC_LINKING_ONLY
before including zstd.h.Advanced experimental APIs should never be used with a dynamically-linked library. They are not "stable"; their definitions or signatures may change in the future. Only static linking is allowed.
I haven't checked the workflow to see if mac builds use -DZSTD_STATIC_LINKING_ONLY=1
use -DZSTD_STATIC_LINKING_ONLY=1 works 👍
From the test the following issue still occurs when running clang-format --version command, so I reopened this ticket.
== Output clang-format version
dyld[3452]: Library not loaded: /usr/local/opt/zstd/lib/libzstd.1.dylib
Referenced from: <182FA4B3-05C4-32D1-B379-F93C1FA28DC0> /Users/runner/work/clang-tools-static-binaries/clang-tools-static-binaries/clang-format-15_macosx-amd64
Reason: tried: '/usr/local/opt/zstd/lib/libzstd.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/zstd/lib/libzstd.1.dylib' (no such file), '/usr/local/opt/zstd/lib/libzstd.1.dylib' (no such file), '/usr/local/lib/libzstd.1.dylib' (no such file), '/usr/lib/libzstd.1.dylib' (no such file, not in dyld cache)
/Users/runner/work/_temp/d23ec023-0cb7-410c-9fcd-8c17b55eae17.sh: line 5: 3452 Abort trap: 6 ./clang-format-15_macosx-amd64 --version
Error: Process completed with exit code 134.
It's my bad, use -DZSTD_STATIC_LINKING_ONLY=1
does not make the build fail, my brain just assumed the problem was solved 😕
Well, we haven't released the new builds yet. I don't think the current test CI uses pre-releases. So I think that error is just from running the last (erroneous) release's builds, specifically the release that github thinks is the "latest": https://github.com/cpp-linter/clang-tools-static-binaries/releases/latest.
gh release download -h
```
Download assets from a GitHub release.
Without an explicit tag name argument, assets are downloaded from the
latest release in the project. In this case, `--pattern` or `--archive`
is required.
USAGE
gh release download [
We could add a tag named latest and keep moving the tag when we publish a release (or pre-release). That way we can have the test CI use gh release download latest <tool-name>
.
For proof that the seg fault was fixed see this CI run for cpp-linter/clang-tools-pip#99
Thank you for pointing out @2bndy5
I have added tag
as input for the test CI, and tested the pre-release build successfully.
I tested the new pre-release master-a13caef5, the static binaries on macOS still has the problem from version 15~18.
More details please see the test job https://github.com/cpp-linter/clang-tools-static-binaries/actions/runs/9353719255/job/25744898037#step:3:40
Originally posted by @shenxianpeng in https://github.com/cpp-linter/clang-tools-static-binaries/issues/16#issuecomment-2145636865