Skip to contentSkip to conversation

package/cracklib: python needs autoreconf

PATCH Applied Fabrice Fontaine 2 participants 2 messages Feb 12, 2024 – Jul 13, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/cracklib: python needs autoreconf

Set CRACKLIB_AUTORECONF when building python to regenerate py-compile and avoid the following build failure with python 3.12 (which removed imp module) raised since commit 36e635d2d5c0166476858aa239ccbe78e8f2af14:

Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'imp' make[3]: *** [Makefile:485: install-pythonPYTHON] Error 1

Indeed, after autoreconf, py-compile will contain:

if test "$python_major" -le 2; then
import_lib=imp
import_test="hasattr(imp, 'get_tag')" import_call=imp.cache_from_source
import_arg2=', False' # needed in one call and not the other
else
import_lib=importlib import_test="hasattr(sys.implementation, 'cache_tag')" import_call=importlib.util.cache_from_source import_arg2=
fi

$PYTHON -c "
import sys, os, py_compile, $import_lib

instead of:

import sys, os, py_compile, imp

Fixes 36e635d2d5c0166476858aa239ccbe78e8f2af14

- http://autobuild.buildroot.org/results/aec4c19fdf8087c76c1d5f472e855e0f84fcf7fd

---
Changes v1 -> v2 (after review of Thomas Petazzoni):
- Give more details in commit message

 package/cracklib/cracklib.mk | 2 ++
 1 file changed, 2 insertions(+)
package/cracklib/cracklib.mk +2 -0
index c5226b3326..9f5f32c87a 100644
@@ -22,6 +22,8 @@ CRACKLIB_CONF_OPTS += --without-zlib
 endif
 
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
+# py-compile must be rebuilt because python 3.12 removed imp module
+CRACKLIB_AUTORECONF = YES
 CRACKLIB_CONF_OPTS += --with-python
 CRACKLIB_CONF_ENV += \
 	ac_cv_path_PYTHON=$(HOST_DIR)/bin/python3 \
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 31 lines · On Mon, 12 Feb 2024 18:52:51 +0100 Fabrice Fontaine…

Set CRACKLIB_AUTORECONF when building python to regenerate py-compile and avoid the following build failure with python 3.12 (which removed imp module) raised since commit 36e635d2d5c0166476858aa239ccbe78e8f2af14:

Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'imp' make[3]: *** [Makefile:485: install-pythonPYTHON] Error 1

Indeed, after autoreconf, py-compile will contain:

if test "$python_major" -le 2; then
import_lib=imp
import_test="hasattr(imp, 'get_tag')" import_call=imp.cache_from_source
import_arg2=', False' # needed in one call and not the other
else
import_lib=importlib import_test="hasattr(sys.implementation, 'cache_tag')" import_call=importlib.util.cache_from_source import_arg2=
fi

$PYTHON -c "
import sys, os, py_compile, $import_lib

instead of:

import sys, os, py_compile, imp

Quoted 7 lines
Fixes 36e635d2d5c0166476858aa239ccbe78e8f2af14

- http://autobuild.buildroot.org/results/aec4c19fdf8087c76c1d5f472e855e0f84fcf7fd

---
Changes v1 -> v2 (after review of Thomas Petazzoni):
- Give more details in commit message

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot