From 1342ead87fa53da228c9ee8e2538a0947ab50290 Mon Sep 17 00:00:00 2001 From: Karstein Phobic Nyvold Kvistad Date: Fri, 12 Jun 2026 15:16:25 +0200 Subject: [PATCH] fix: compiled-library default extension is .compiled-library (hyphen) on SP21 --- src/scripts/save_as_compiled_library.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/scripts/save_as_compiled_library.py b/src/scripts/save_as_compiled_library.py index b984bb5..20ced79 100644 --- a/src/scripts/save_as_compiled_library.py +++ b/src/scripts/save_as_compiled_library.py @@ -14,8 +14,15 @@ try: effective = DESTINATION if not effective: + # SP21 writes '.compiled-library' (hyphen); the API docs say + # '.compiled_library' (underscore). Check both. base, _ext = os.path.splitext(PROJECT_FILE_PATH) - effective = base + ".compiled_library" + for ext in (".compiled-library", ".compiled_library"): + if os.path.exists(base + ext): + effective = base + ext + break + else: + effective = base + ".compiled-library" exists_note = "yes" if os.path.exists(effective) else "not found at expected path (check CODESYS messages)" print("Destination: %s" % effective)