-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Tracking flaky macOS CI: dlopen … No such file
during import libtiledbsoma
#2237
Comments
dlopen … No such file
during import libtiledbsoma
dlopen … No such file
during import libtiledbsoma
Added one to the list above:
|
And another:
|
This flaky build error is so frustrating. I've been meaning to investigate further, and it just happened to me recently, so I took some time to compare a failed build with its passing build after a simple manual restart. I copy-pasted the raw logs, removed the timestamps, and compared. To begin, in both the failing and passing builds, the required ./venv-soma/lib/python3.11/site-packages/tiledbsoma/pytiledbsoma.cpython-311-darwin.so
./venv-soma/lib/python3.11/site-packages/tiledbsoma/libtiledbsoma.dylib And the RPATH is identical in both the failing and passing builds: Next I Results of diffing the passing and failing logs for all mentions of `libtiledbsoma.dylib`$ grep libtiledbsoma.dylib soma-failed.txt
[ 74%] Linking CXX shared library libtiledbsoma.dylib
-- Installing: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: False
dlopen(libtiledbsoma.dylib, 0x0006): tried: 'libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/libtiledbsoma.dylib' (no such file)
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: True
copying file /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib to /Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/src/tiledbsoma
adding to package_data: ['libtiledbsoma.dylib']
copying src/tiledbsoma/libtiledbsoma.dylib -> build/lib.macosx-10.9-universal2-cpython-311/tiledbsoma
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: True
ld: warning: ignoring file /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: dylib (/Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib) was built for newer macOS version (12.7) than being linked (11.0)
copying build/lib.macosx-10.9-universal2-cpython-311/tiledbsoma/libtiledbsoma.dylib -> build/bdist.macosx-10.9-universal2/wheel/tiledbsoma
build/bdist.macosx-10.9-universal2/wheel/tiledbsoma/libtiledbsoma.dylib
build/bdist.macosx-10.9-universal2/wheel/tiledbsoma/libtiledbsoma.dylib
adding 'tiledbsoma/libtiledbsoma.dylib'
989448 04-10-2024 15:52 tiledbsoma/libtiledbsoma.dylib
##[group]Run unzip -l apis/python/dist/tiledbsoma-*.whl | grep -q libtiledbsoma.dylib
unzip -l apis/python/dist/tiledbsoma-*.whl | grep -q libtiledbsoma.dylib
@rpath/libtiledbsoma.dylib (compatibility version 0.0.0, current version 0.0.0)
./venv-soma/lib/python3.11/site-packages/tiledbsoma/libtiledbsoma.dylib
ImportError: dlopen(/Users/runner/work/TileDB-SOMA/TileDB-SOMA/venv-soma/lib/python3.11/site-packages/tiledbsoma/pytiledbsoma.cpython-311-darwin.so, 0x0002): Library not loaded: '@rpath/libtiledbsoma.dylib'
Reason: tried: '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file)
$ grep libtiledbsoma.dylib soma-passed.txt
[ 71%] Linking CXX shared library libtiledbsoma.dylib
-- Installing: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: False
dlopen(libtiledbsoma.dylib, 0x0006): tried: '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), 'libtiledbsoma.dylib' (no such file), '/usr/local/lib/libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/libtiledbsoma.dylib' (no such file)
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: True
copying file /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib to /Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/src/tiledbsoma
adding to package_data: ['libtiledbsoma.dylib']
copying src/tiledbsoma/libtiledbsoma.dylib -> build/lib.macosx-10.9-universal2-cpython-311/tiledbsoma
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: True
ld: warning: ignoring file /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: dylib (/Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib) was built for newer macOS version (12.7) than being linked (11.0)
build/bdist.macosx-10.9-universal2/wheel/tiledbsoma/libtiledbsoma.dylib
copying build/lib.macosx-10.9-universal2-cpython-311/tiledbsoma/libtiledbsoma.dylib -> build/bdist.macosx-10.9-universal2/wheel/tiledbsoma
build/bdist.macosx-10.9-universal2/wheel/tiledbsoma/libtiledbsoma.dylib
adding 'tiledbsoma/libtiledbsoma.dylib'
1005848 04-11-2024 15:52 tiledbsoma/libtiledbsoma.dylib
##[group]Run unzip -l apis/python/dist/tiledbsoma-*.whl | grep -q libtiledbsoma.dylib
unzip -l apis/python/dist/tiledbsoma-*.whl | grep -q libtiledbsoma.dylib
@rpath/libtiledbsoma.dylib (compatibility version 0.0.0, current version 0.0.0)
./venv-soma/lib/python3.11/site-packages/tiledbsoma/libtiledbsoma.dylib
$ diff <(grep libtiledbsoma.dylib soma-failed.txt) <(grep libtiledbsoma.dylib soma-passed.txt)
1c1
< [ 74%] Linking CXX shared library libtiledbsoma.dylib
---
> [ 71%] Linking CXX shared library libtiledbsoma.dylib
4c4
< dlopen(libtiledbsoma.dylib, 0x0006): tried: 'libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/libtiledbsoma.dylib' (no such file)
---
> dlopen(libtiledbsoma.dylib, 0x0006): tried: '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), 'libtiledbsoma.dylib' (no such file), '/usr/local/lib/libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/libtiledbsoma.dylib' (no such file)
12d11
< copying build/lib.macosx-10.9-universal2-cpython-311/tiledbsoma/libtiledbsoma.dylib -> build/bdist.macosx-10.9-universal2/wheel/tiledbsoma
13a13
> copying build/lib.macosx-10.9-universal2-cpython-311/tiledbsoma/libtiledbsoma.dylib -> build/bdist.macosx-10.9-universal2/wheel/tiledbsoma
16c16
< 989448 04-10-2024 15:52 tiledbsoma/libtiledbsoma.dylib
---
> 1005848 04-11-2024 15:52 tiledbsoma/libtiledbsoma.dylib
21,22d20
< ImportError: dlopen(/Users/runner/work/TileDB-SOMA/TileDB-SOMA/venv-soma/lib/python3.11/site-packages/tiledbsoma/pytiledbsoma.cpython-311-darwin.so, 0x0002): Library not loaded: '@rpath/libtiledbsoma.dylib'
< Reason: tried: '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file) The main difference I observed was that when TileDB-SOMA/apis/python/setup.py Lines 132 to 136 in 0fc3cc0
# failed
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: False
dlopen(libtiledbsoma.dylib, 0x0006): tried: 'libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/libtiledbsoma.dylib' (no such file)
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: True
copying file /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib to /Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/src/tiledbsoma
adding to package_data: ['libtiledbsoma.dylib']
# passed
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: False
dlopen(libtiledbsoma.dylib, 0x0006): tried: '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), 'libtiledbsoma.dylib' (no such file), '/usr/local/lib/libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/libtiledbsoma.dylib' (no such file)
Checking: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib exists: True
copying file /Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib to /Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/src/tiledbsoma
adding to package_data: ['libtiledbsoma.dylib'] So given that, maybe the primary error isn't finding During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/runner/work/TileDB-SOMA/TileDB-SOMA/venv-soma/lib/python3.11/site-packages/tiledbsoma/__init__.py", line 118, in <module>
ctypes.CDLL(os.path.join(lib_dir, libtiledb_name), mode=ctypes.RTLD_GLOBAL)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 376, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: dlopen(/Users/runner/work/TileDB-SOMA/TileDB-SOMA/venv-soma/lib/python3.11/site-packages/tiledbsoma/libtiledb.dylib, 0x000A): tried: '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/venv-soma/lib/python3.11/site-packages/tiledbsoma/libtiledb.dylib' (no such file)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/runner/work/TileDB-SOMA/TileDB-SOMA/venv-soma/lib/python3.11/site-packages/tiledbsoma/__init__.py", line 121, in <module>
ctypes.CDLL(libtiledb_name, mode=ctypes.RTLD_GLOBAL)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 376, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: dlopen(libtiledb.dylib, 0x000A): tried: 'libtiledb.dylib' (no such file), '/usr/lib/libtiledb.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/libtiledb.dylib' (no such file) But why is the search path different between the initial failing run and its passing restarted run? |
Ok, I confirmed that the env vars affecting the library search path are the problem.
$ diff <(grep 'external/lib' soma-failed.txt) <(grep 'external/lib' soma-passed.txt)
7a8
> env vars: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib /Users/runner/hostedtoolcache/Python/3.11.9/x64/lib/pkgconfig /Users/runner/work/TileDB-SOMA/TileDB-SOMA/external
10a12
> dlopen(libtiledbsoma.dylib, 0x0006): tried: '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), 'libtiledbsoma.dylib' (no such file), '/usr/local/lib/libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/apis/python/libtiledbsoma.dylib' (no such file)
44d45
< Reason: tried: '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/dist/lib/libtiledbsoma.dylib' (no such file), '/Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib/libtiledbsoma.dylib' (no such file), '/usr/lib/libtiledbsoma.dylib' (no such file) In the failing build, # failed
env vars: /Users/runner/hostedtoolcache/Python/3.11.9/x64/lib/pkgconfig /Users/runner/work/TileDB-SOMA/TileDB-SOMA/external
# passed
env vars: /Users/runner/work/TileDB-SOMA/TileDB-SOMA/external/lib /Users/runner/hostedtoolcache/Python/3.11.9/x64/lib/pkgconfig /Users/runner/work/TileDB-SOMA/TileDB-SOMA/external So some flaky process is occasionally unsetting |
Nice find. For the record it also bit me maybe four or five times last week when working on |
I think the problem is macOS's System Integrity Protection. From pypa/cibuildwheel#816 (comment):
Looking again at my failing build, I can see that I'm at a bit of a loss on how to proceed here. I can literally see that I have properly set |
Unfortunately SIP can't be toggled on and off in a GitHub Actions runner. However, it appears that SIP is disabled for actions/runner-images#650 (comment) Another idea would be to try |
Describe the bug
The "macos TILEDB_EXISTS: yes TILEDBSOMA_EXISTS: no" job sometimes fails, in the "Confirm linking to installed shared objects" step (python-so-copying.yml#L232), with error:
Example full stack trace
Running list of instances of this failure that I've noticed:
In all cases, 1 re-run was sufficient to mine a successful run.
Aside: mitigation + possible separate segfault issue
#2229 should make it less common (by running the job in question less frequently/superfluously).
Note that a similar flaky CI job was observed there, by @jdblischak (GHA link), in job "macos TILEDB_EXISTS: yes TILEDBSOMA_EXISTS: yes", step Build and install libtiledbsoma:
Full stack trace
Can file a separate issue for that, if we keep seeing it.
The text was updated successfully, but these errors were encountered: