Skip to content

Commit 12a7b04

Browse files
committed
get the interpreter path from the build system
Signed-off-by: Filipe Laíns <[email protected]>
1 parent 2d620c3 commit 12a7b04

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Makefile.pre.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,8 @@ platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
791791
$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
792792

793793
install-details.json: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt $(srcdir)/Tools/build/generate_install_details_file.py
794-
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/generate_install_details_file.py ./install-details.json
794+
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/generate_install_details_file.py ./install-details.json \
795+
--executable $(BINDIR)/python3$(EXE)
795796

796797
# Create build directory and generate the sysconfig build-time data there.
797798
# pybuilddir.txt contains the name of the build dir and is used for

Tools/build/generate_install_details_file.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@
1111
ConfigData = dict[str, SectionData]
1212

1313

14-
def generic_info() -> ConfigData:
14+
def generic_info(executable: str) -> ConfigData:
1515
return {
1616
'python': {
1717
'version': sys.version.split(' ')[0],
1818
'version_parts': {
1919
field: getattr(sys.version_info, field)
2020
for field in ('major', 'minor', 'micro', 'releaselevel', 'serial')
2121
},
22-
'executable': os.path.join(
23-
sysconfig.get_path('scripts'),
24-
os.path.basename(sys.executable),
25-
),
22+
'executable': executable,
2623
'stdlib': sysconfig.get_path('stdlib'),
2724
},
2825
}
@@ -31,10 +28,11 @@ def generic_info() -> ConfigData:
3128
def main() -> None:
3229
parser = argparse.ArgumentParser()
3330
parser.add_argument('output_path', metavar='FILE')
31+
parser.add_argument('--executable', help='The executable path on the system.')
3432

3533
args = parser.parse_args()
3634

37-
config = generic_info()
35+
config = generic_info(args.executable)
3836

3937
with open(args.output_path, 'w') as f:
4038
json.dump(config, f)

0 commit comments

Comments
 (0)