# HG changeset patch # User Franz Glasner # Date 1665326892 -7200 # Node ID 962a1436b2c091314d7aff7489850bb187017758 # Parent a36fc15432fc2ad212d844aedcd116cb0ae08322 FIX: Do not try to write sysconfigdata into the current directory: use WRKDIR instead diff -r a36fc15432fc -r 962a1436b2c0 files/py37/patch-lib-python_3_sysconfig.py --- a/files/py37/patch-lib-python_3_sysconfig.py Sun Oct 09 12:57:54 2022 +0200 +++ b/files/py37/patch-lib-python_3_sysconfig.py Sun Oct 09 16:48:12 2022 +0200 @@ -1,12 +1,23 @@ ---- lib-python/3/sysconfig.py.orig 2022-03-28 09:53:47 UTC +--- lib-python/3/sysconfig.py.orig 2022-03-28 09:51:49 UTC +++ lib-python/3/sysconfig.py -@@ -436,7 +436,11 @@ def _generate_posix_vars(args): +@@ -442,7 +442,11 @@ def _generate_posix_vars(args): + module.build_time_vars = vars + sys.modules[name] = module + ++ pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port ++ + pybuilddir = 'build/lib.%s-%s' % (get_platform(), _PY_VERSION_SHORT) ++ if pypy_wrkdir is not None: ++ pybuilddir = os.path.join(pypy_wrkdir, pybuilddir) + if hasattr(sys, "gettotalrefcount"): + pybuilddir += '-pydebug' + os.makedirs(pybuilddir, exist_ok=True) +@@ -455,7 +459,10 @@ def _generate_posix_vars(args): pprint.pprint(vars, stream=f) # Create file used for sys.path fixup -- see Modules/getpath.c - with open('pybuilddir.txt', 'w', encoding='ascii') as f: + pybuilddir_txt = 'pybuilddir.txt' -+ pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port + if pypy_wrkdir is not None: + pybuilddir_txt = os.path.join(pypy_wrkdir, pybuilddir_txt) + with open(pybuilddir_txt, 'w', encoding='utf8') as f: diff -r a36fc15432fc -r 962a1436b2c0 files/py38/patch-lib-python_3_sysconfig.py --- a/files/py38/patch-lib-python_3_sysconfig.py Sun Oct 09 12:57:54 2022 +0200 +++ b/files/py38/patch-lib-python_3_sysconfig.py Sun Oct 09 16:48:12 2022 +0200 @@ -1,12 +1,23 @@ --- lib-python/3/sysconfig.py.orig 2022-03-28 09:53:47 UTC +++ lib-python/3/sysconfig.py -@@ -436,7 +436,11 @@ def _generate_posix_vars(args): +@@ -423,7 +423,11 @@ def _generate_posix_vars(args): + module.build_time_vars = vars + sys.modules[name] = module + ++ pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port ++ + pybuilddir = 'build/lib.%s-%s' % (get_platform(), _PY_VERSION_SHORT) ++ if pypy_wrkdir is not None: ++ pybuilddir = os.path.join(pypy_wrkdir, pybuilddir) + if hasattr(sys, "gettotalrefcount"): + pybuilddir += '-pydebug' + os.makedirs(pybuilddir, exist_ok=True) +@@ -436,7 +440,10 @@ def _generate_posix_vars(args): pprint.pprint(vars, stream=f) # Create file used for sys.path fixup -- see Modules/getpath.c - with open('pybuilddir.txt', 'w', encoding='utf8') as f: + pybuilddir_txt = 'pybuilddir.txt' -+ pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port + if pypy_wrkdir is not None: + pybuilddir_txt = os.path.join(pypy_wrkdir, pybuilddir_txt) + with open(pybuilddir_txt, 'w', encoding='utf8') as f: diff -r a36fc15432fc -r 962a1436b2c0 files/py39/patch-lib-python_3_sysconfig.py --- a/files/py39/patch-lib-python_3_sysconfig.py Sun Oct 09 12:57:54 2022 +0200 +++ b/files/py39/patch-lib-python_3_sysconfig.py Sun Oct 09 16:48:12 2022 +0200 @@ -1,12 +1,23 @@ ---- lib-python/3/sysconfig.py.orig 2022-03-28 09:53:47 UTC +--- lib-python/3/sysconfig.py.orig 2022-03-29 05:15:20 UTC +++ lib-python/3/sysconfig.py -@@ -436,7 +436,11 @@ def _generate_posix_vars(args): +@@ -421,7 +421,11 @@ def _generate_posix_vars(args): + module.build_time_vars = vars + sys.modules[name] = module + ++ pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port ++ + pybuilddir = 'build/lib.%s-%s' % (get_platform(), _PY_VERSION_SHORT) ++ if pypy_wrkdir is not None: ++ pybuilddir = os.path.join(pypy_wrkdir, pybuilddir) + if hasattr(sys, "gettotalrefcount"): + pybuilddir += '-pydebug' + os.makedirs(pybuilddir, exist_ok=True) +@@ -434,7 +438,10 @@ def _generate_posix_vars(args): pprint.pprint(vars, stream=f) # Create file used for sys.path fixup -- see Modules/getpath.c - with open('pybuilddir.txt', 'w', encoding='utf8') as f: + pybuilddir_txt = 'pybuilddir.txt' -+ pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port + if pypy_wrkdir is not None: + pybuilddir_txt = os.path.join(pypy_wrkdir, pybuilddir_txt) + with open(pybuilddir_txt, 'w', encoding='utf8') as f: