8000 Fix linking with Python 3.8 by Self-Perfection · Pull Request #3344 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix linking with Python 3.8 #3344

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

Merged
merged 1 commit into from
Dec 9, 2019
Merged

Fix linking with Python 3.8 #3344

merged 1 commit into from
Dec 9, 2019

Conversation

Self-Perfection
Copy link
Contributor
@Self-Perfection Self-Perfection commented Nov 16, 2019

Since Python 3.8 --embed flag needs to be provided to python-config to embed python.
Reference: https://bugs.python.org/issue36721

This was partially addressed in #3170 but only fixed building and not linking with python.

ChangeLog: Fix linking with Python 3.8

Since Python 3.8 --embed flag needs to be provided to python-config to embed python.
Reference: https://bugs.python.org/issue36721

This was partially addressed in #3170 but only fixed building and not linking with python.
@@ -4711,7 +4711,7 @@ if test "$PYTHON_CONFIG" != ""; then
if test $? -ne 0; then
with_libpython="no"
fi
LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags --embed`" || LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please redirect stderr of the first command to /dev/null, otherwise an error shows up on all systems where we don't have python 3.8.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have checked python2-config --unsupported-flag and python3-config --unsupported-flag behaviour on couple of systems. And everywhere python-config sent error message to stdout. So on systems with python older than 3.8 error message would be stored in $LIBPYTHON_LDFLAGS and not displayed.

On the other hand, future versions of python might correctly give error to stderr if something went wrong unrelated to --embed flag.

Therefore it seems to me current variant, without devnulling of stderr, is better.

Do you insist on stderr redirection anyway?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me and is also consistent with the other part of python3.8 work

@mrunge mrunge added this to the 5.11.0 milestone Dec 9, 2019
@mrunge mrunge added the Bug A genuine bug label Dec 9, 2019
Copy link
Member
@mrunge mrunge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix

@@ -4711,7 +4711,7 @@ if test "$PYTHON_CONFIG" != ""; then
if test $? -ne 0; then
with_libpython="no"
fi
LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags --embed`" || LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me and is also consistent with the other part of python3.8 work

@mrunge mrunge merged commit 22e0f18 into collectd:master Dec 9, 2019
to-ha added a commit to to-ha/fritzcollectd-docker that referenced this pull request Dec 27, 2019
Currently container will fail with error (dlopen("/usr/lib/collectd/python.so") failed) if collectd configuration loads python plugin
See https://bugs.archlinux.org/task/64533
Fixed in source (collectd/collectd#3344) but not in pre-built packages.
Solution for now is building Collectd from source.
@octo octo added Fix A pull request fixing a bug and removed Bug A genuine bug labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix A pull request fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0