Mercurial > hgrepos > FreeBSD > ports > PyPy
view files/py38/patch-lib-python_3_sysconfig.py @ 101:962a1436b2c0
FIX: Do not try to write sysconfigdata into the current directory: use WRKDIR instead
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 09 Oct 2022 16:48:12 +0200 |
| parents | 56d0e959bcf0 |
| children |
line wrap: on
line source
--- lib-python/3/sysconfig.py.orig 2022-03-28 09:53:47 UTC +++ lib-python/3/sysconfig.py @@ -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' + if pypy_wrkdir is not None: + pybuilddir_txt = os.path.join(pypy_wrkdir, pybuilddir_txt) + with open(pybuilddir_txt, 'w', encoding='utf8') as f: f.write(pybuilddir) def _init_posix(vars):
