FreeBSD Python lookup bugfix#6852
Closed
petermolnar wants to merge 1 commit into
Closed
Conversation
The
```
extension = "m"; // FreeBSD uses 'm' suffix
```
code section is:
a, outdated
b, redundant
and should be removed.
This is a current `ls` of a FreBSD 14.4 install:
```
[:/usr/local/lib] ls -la | grep python
lrwxr-xr-x 1 root wheel 20 Apr 23 02:10 libpython3.11.so -> libpython3.11.so.1.0
lrwxr-xr-x 1 root wheel 20 Apr 23 02:11 libpython3.11.so.1 -> libpython3.11.so.1.0
-rw-r--r-- 1 root wheel 6169904 Apr 23 02:10 libpython3.11.so.1.0
-rw-r--r-- 1 root wheel 71225 Apr 23 02:11 libpython3.11.so.1.0-gdb.py
drwxr-xr-x 39 root wheel 208 Apr 30 10:23 python3.11
```
all python libs are without the additional `m`
However, for backwards compatibility there's already a case for this in
`FindLibrary`:
```
// look in directories covered by ldconfig but 'm' variant
if (!shared_lib_)
{
library = "lib" + sLibrary + "m.so";
shared_lib_ = dlopen(library.c_str(), RTLD_LAZY | RTLD_GLOBAL);
}
```
The combination of these two is preventing Domoticz from finding Python
in runtime, even though it's found at compile time; removing 2 lines
fixes the problem.
Contributor
|
Thank you for reporting. So FreeBSD finally removed the suffix ;) Because you also changed other lines in your PR, I removed it directly from the code base. Thank you again for spotting and the PR! |
Author
Fair point, the other two lines was my auto whitespace cleanup on save in Geany. Apologies, I should have left it out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
code section is outdated and redundant and needs to removed, because it's preventing Domoticz from finding Python on a FreeBSD.
This is a current
lsof a FreBSD 14.4/usr/local/lib; all python libs are without the additionalm.However, for backwards compatibility there's already a case for this in
FindLibrary:I compiled Domoticz (albeit 2025.2, that's the one currently in FreeBSD ports) with the change, and it's finally happy, after about 4-5 hours of trying to pass PATH hacks, only to realize that was not the problem.