File: test-freeze-strip-libdir.diff

package info (click to toggle)
python3.13 3.13.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 121,328 kB
  • sloc: python: 704,014; ansic: 653,914; xml: 31,250; sh: 5,844; cpp: 4,326; makefile: 1,981; objc: 787; lisp: 502; javascript: 213; asm: 75; csh: 12
file content (25 lines) | stat: -rw-r--r-- 1,072 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From f6966024e86e2530fb6c7fe26b69e5054fc8e310 Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stefano@rivera.za.net>
Date: Wed, 2 Oct 2024 18:24:57 +0200
Subject: [PATCH] Strip absolute --libdir paths from configure args in
 test_freeze

We are trying to install into a prefix, any absolute path would not
necessarily be writeable. e.g. if Python is configured with
--libdir=/usr/lib/$(MULTIARCH)/ during a Debian build.

Forwarded: https://github.com/python/cpython/pull/124916
---
 Tools/freeze/test/freeze.py | 1 +
 1 file changed, 1 insertion(+)

--- a/Tools/freeze/test/freeze.py
+++ b/Tools/freeze/test/freeze.py
@@ -128,6 +128,7 @@
     # Run configure.
     print(f'configuring python in {builddir}...')
     config_args = shlex.split(sysconfig.get_config_var('CONFIG_ARGS') or '')
+    config_args = [arg for arg in config_args if not arg.startswith("--libdir=/")]
     cmd = [os.path.join(srcdir, 'configure'), *config_args]
     ensure_opt(cmd, 'cache-file', os.path.join(outdir, 'python-config.cache'))
     prefix = os.path.join(outdir, 'python-installation')