Skip to content

Commit

Permalink
Move vcruntime to main folder
Browse files Browse the repository at this point in the history
Remove vcruntime from the main folder, and remove vcruntime from the
DLLs subfolder. I tried using the existing apparatus, but matching a
substring from the exlusion list to the src string does not work as
expected, possibly because of the difference in directories, so I
have flipped the substring matching to look for vcruntime within the
src. It doesn't look as nice, but it produces the correct result.
  • Loading branch information
icanhasmath committed Sep 6, 2024
1 parent 9df584a commit 0c40569
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions PC/layout/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
TCLTK_DIRS_ONLY = FileNameSet("tkinter", "turtledemo")
TCLTK_FILES_ONLY = FileNameSet("turtle.py")

EXCLUDE_FROM_PYDS = FileStemSet("python*", "pyshellext")
EXCLUDE_FROM_PYDS = FileStemSet("python*", "pyshellext", "vcruntime*")
EXCLUDE_FROM_LIB = FileNameSet("*.pyc", "__pycache__", "*.pickle")
EXCLUDE_FROM_PACKAGED_LIB = FileNameSet("readme.txt")
EXCLUDE_FROM_COMPILE = FileNameSet("badsyntax_*", "bad_*")
Expand Down Expand Up @@ -142,6 +142,14 @@ def in_build(f, dest="", new_name=None):
for item in in_build(PYTHON_DLL_NAME):
yield item

# Explicitly move vcruntime.dlls to the Main directory so they are available at startup
found_any = False
for dest, src in rglob(ns.build, "vcruntime*.dll"):
found_any = True
yield dest, src
if not found_any:
log_error("Failed to locate vcruntime DLL in the build.")

yield "LICENSE", "LICENSE"

for dest, src in rglob(ns.build, ("*.pyd", "*.dll")):
Expand All @@ -153,7 +161,9 @@ def in_build(f, dest="", new_name=None):
continue
if src in TCLTK_PYDS_ONLY and not ns.include_tcltk:
continue

# Explicitly remove files containing vcruntime from the DLLs subdirectory.
if "vcruntime" in src:
continue
for item in in_build(os.path.basename(src), dest="" if ns.flat_dlls else "DLLs/"):
yield item

Expand Down

0 comments on commit 0c40569

Please sign in to comment.