@@ -47,7 +47,7 @@ class _Target(typing.Generic[_S, _R]):
4747 debug : bool = False
4848 verbose : bool = False
4949 known_symbols : dict [str , int ] = dataclasses .field (default_factory = dict )
50- pyconfig : pathlib .Path | None = None
50+ pyconfig_dir : pathlib .Path = pathlib . Path . cwd (). resolve ()
5151
5252 def _get_nop (self ) -> bytes :
5353 if re .fullmatch (r"aarch64-.*" , self .triple ):
@@ -64,8 +64,7 @@ def _compute_digest(self) -> str:
6464 hasher .update (self .debug .to_bytes ())
6565 # These dependencies are also reflected in _JITSources in regen.targets:
6666 hasher .update (PYTHON_EXECUTOR_CASES_C_H .read_bytes ())
67- assert self .pyconfig is not None
68- hasher .update (self .pyconfig .read_bytes ())
67+ hasher .update ((self .pyconfig_dir / "pyconfig.h" ).read_bytes ())
6968 for dirpath , _ , filenames in sorted (os .walk (TOOLS_JIT )):
7069 for filename in filenames :
7170 hasher .update (pathlib .Path (dirpath , filename ).read_bytes ())
@@ -120,15 +119,14 @@ async def _compile(
120119 self , opname : str , c : pathlib .Path , tempdir : pathlib .Path
121120 ) -> _stencils .StencilGroup :
122121 o = tempdir / f"{ opname } .o"
123- assert self .pyconfig is not None
124122 args = [
125123 f"--target={ self .triple } " ,
126124 "-DPy_BUILD_CORE_MODULE" ,
127125 "-D_DEBUG" if self .debug else "-DNDEBUG" ,
128126 f"-D_JIT_OPCODE={ opname } " ,
129127 "-D_PyJIT_ACTIVE" ,
130128 "-D_Py_JIT" ,
131- f"-I{ self .pyconfig . parent } " ,
129+ f"-I{ self .pyconfig_dir } " ,
132130 f"-I{ CPYTHON / 'Include' } " ,
133131 f"-I{ CPYTHON / 'Include' / 'internal' } " ,
134132 f"-I{ CPYTHON / 'Include' / 'internal' / 'mimalloc' } " ,
0 commit comments