[Buildroot] [PATCH 3/3] package/python-iptables: use installed iptables by default
frank.vanbever at essensium.com
Thu Feb 27 14:56:34 UTC 2020
Thank you for the comments.
> But overall, is there a better way ? Like some official way to pass
> these values at build time as setup.py options, with the environment
> variable taking precedence if available ? That would make this
> hopefully acceptable by upstream. Perhaps the setup.py logic could even
> check the xtables-version.h by itself ?
For installations from source this would work.  However Python also has the
option of distributing Wheel binary packages, where this logic would not be
executed.  This would mean that we put the burden of handling the difference
between installations on the upstream.
I took a second look and actually I think I can propose a workaround to the
upstream. There's 2 problems that need to be tackled.
The first one is loading libxtables.so. iptables installs a libxtables.so
symlink without any version. CDLL has no issues with this so it can just try
and load that if all the other attempts fail.
The second problem is the location of the XTABLES_LIBDIR. Right now it tries
all paths that are mentioned in the output of ldconfig -N -v. I guess it
wouldn't be that much of a stretch to test some sensible locations (/usr/
local/lib/xtables, /usr/lib/xtables etc) if that should fail, in the same vein
as the libc solution. It's not clean but it gets the job done.
I'll see if I can whip something up and submit it upstream.
More information about the buildroot