Skip to content

Commit 603c363

Browse files
committed
Force copy of GDExtension API headers on Windows CI (avoid weird reparse point on reparse point error)
1 parent 1538f09 commit 603c363

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ jobs:
219219
shell: bash
220220
run: |
221221
set -eux
222-
ARGS="--build-dir=build/ ${{ steps.setup-godot.outputs.EXTRA_RUN_TESTS_ARGS }} -- --headless"
222+
ARGS="--build-dir=build/ ${{ steps.setup-godot.outputs.EXTRA_RUN_TESTS_ARGS }} --custom-gdextension-api=./gdextension_api -- --headless"
223223
python tests/run.py 0-gdscript $ARGS
224224
python tests/run.py 1-gdextension $ARGS
225225
python tests/run.py 2-pythonscript-init $ARGS

tests/run.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
import platform
77
import importlib.util
8-
from typing import List, Sequence
8+
from typing import List, Sequence, Optional
99
from contextlib import contextmanager
1010
import argparse
1111
from pathlib import Path
@@ -114,7 +114,12 @@ def symlink(src: Path, dst: Path) -> None:
114114
os.symlink(str(src.resolve()), str(dst.resolve()))
115115

116116

117-
def create_test_workdir(test_dir: Path, distrib_workdir: Path, test_workdir: Path) -> None:
117+
def create_test_workdir(
118+
test_dir: Path,
119+
distrib_workdir: Path,
120+
test_workdir: Path,
121+
custom_gdextension_api: Optional[Path],
122+
) -> None:
118123
print(
119124
f"{YELLOW}{test_dir.name}: Create&populate test workdir in {test_workdir}{NO_COLOR}",
120125
flush=True,
@@ -123,7 +128,10 @@ def create_test_workdir(test_dir: Path, distrib_workdir: Path, test_workdir: Pat
123128
symlink(distrib_workdir / "addons", test_workdir / "addons")
124129
shutil.copy(distrib_workdir / "pythonscript.gdextension", test_workdir)
125130
# GDExtension headers are needed to compile Cython modules
126-
symlink(build_dir / "gdextension_api", test_workdir / "gdextension_api")
131+
if custom_gdextension_api:
132+
shutil.copytree(custom_gdextension_api, test_workdir / "gdextension_api")
133+
else:
134+
symlink(build_dir / "gdextension_api", test_workdir / "gdextension_api")
127135

128136
build_script = test_workdir / "build.py"
129137
if build_script.exists():
@@ -262,6 +270,11 @@ def run_test(
262270
action="store_true",
263271
help="Only update the addons build symlinked into all test projects",
264272
)
273+
parser.add_argument(
274+
"--custom-gdextension-api",
275+
type=Path,
276+
help="Copy GDExtension API folder from there instead of symlink the build one (useful if you have issues on Windows)",
277+
)
265278

266279
try:
267280
options_separator = sys.argv.index("--")
@@ -312,5 +325,6 @@ def test_workdir_factory():
312325
test_dir=test_dir,
313326
distrib_workdir=distrib_workdir,
314327
test_workdir=test_workdir,
328+
custom_gdextension_api=args.custom_gdextension_api,
315329
)
316330
run_test(test_dir.name, test_workdir, godot_binary_path, godot_extra_args)

0 commit comments

Comments
 (0)