Mercurial > hgrepos > FreeBSD > ports > PyPy
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 100:a36fc15432fc | 101:962a1436b2c0 |
|---|---|
| 1 --- lib-python/3/sysconfig.py.orig 2022-03-28 09:53:47 UTC | 1 --- lib-python/3/sysconfig.py.orig 2022-03-28 09:53:47 UTC |
| 2 +++ lib-python/3/sysconfig.py | 2 +++ lib-python/3/sysconfig.py |
| 3 @@ -436,7 +436,11 @@ def _generate_posix_vars(args): | 3 @@ -423,7 +423,11 @@ def _generate_posix_vars(args): |
| 4 module.build_time_vars = vars | |
| 5 sys.modules[name] = module | |
| 6 | |
| 7 + pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port | |
| 8 + | |
| 9 pybuilddir = 'build/lib.%s-%s' % (get_platform(), _PY_VERSION_SHORT) | |
| 10 + if pypy_wrkdir is not None: | |
| 11 + pybuilddir = os.path.join(pypy_wrkdir, pybuilddir) | |
| 12 if hasattr(sys, "gettotalrefcount"): | |
| 13 pybuilddir += '-pydebug' | |
| 14 os.makedirs(pybuilddir, exist_ok=True) | |
| 15 @@ -436,7 +440,10 @@ def _generate_posix_vars(args): | |
| 4 pprint.pprint(vars, stream=f) | 16 pprint.pprint(vars, stream=f) |
| 5 | 17 |
| 6 # Create file used for sys.path fixup -- see Modules/getpath.c | 18 # Create file used for sys.path fixup -- see Modules/getpath.c |
| 7 - with open('pybuilddir.txt', 'w', encoding='utf8') as f: | 19 - with open('pybuilddir.txt', 'w', encoding='utf8') as f: |
| 8 + pybuilddir_txt = 'pybuilddir.txt' | 20 + pybuilddir_txt = 'pybuilddir.txt' |
| 9 + pypy_wrkdir = os.environ.get("PYPY_WRKDIR") # this is set by FreeBSD port | |
| 10 + if pypy_wrkdir is not None: | 21 + if pypy_wrkdir is not None: |
| 11 + pybuilddir_txt = os.path.join(pypy_wrkdir, pybuilddir_txt) | 22 + pybuilddir_txt = os.path.join(pypy_wrkdir, pybuilddir_txt) |
| 12 + with open(pybuilddir_txt, 'w', encoding='utf8') as f: | 23 + with open(pybuilddir_txt, 'w', encoding='utf8') as f: |
| 13 f.write(pybuilddir) | 24 f.write(pybuilddir) |
| 14 | 25 |
