Skip to content

Commit 4db63d7

Browse files
committed
Bump Version
1 parent 54fbd6d commit 4db63d7

4 files changed

Lines changed: 40 additions & 4 deletions

File tree

‎build.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ elif [[ "$OS_NAME" == *"MINGW"* ]] || [[ "$OS_NAME" == *"MSYS"* ]] || [[ "$OS_NA
5656
PY_VER=$(python3 -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')")
5757

5858
# Compile the C extension
59-
gcc pycymbal.c pycymbal_go.dll -o _pycymbal.pyd -I"$PY_INC" -L"$PY_LIB" -lpython$PY_VER -shared -w
59+
# Compile the C extension with static linking for MinGW runtimes to avoid DLL dependency issues
60+
gcc pycymbal.c pycymbal_go.dll -o _pycymbal.pyd -I"$PY_INC" -L"$PY_LIB" -lpython$PY_VER -shared -w -static-libgcc -static-libstdc++ -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic
6061

6162
[ -f _pycymbal.pyd ] && mv _pycymbal.pyd ../python/cymbal/_pycymbal.windows.pyd
6263
[ -f pycymbal_go.dll ] && mv pycymbal_go.dll ../python/cymbal/pycymbal_go.windows.dll
@@ -115,7 +116,7 @@ dll_files = glob.glob("python/cymbal/pycymbal_go*")
115116
116117
setup(
117118
name="py-cymbal",
118-
version="0.1.13",
119+
version="0.1.14",
119120
description="Python bindings for Cymbal code indexing and symbol discovery",
120121
author="Cymbal Contributors",
121122
author_email="contact@example.com",

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
88

99
[project]
1010
name = "py-cymbal"
11-
version = "0.1.13"
11+
version = "0.1.14"
1212
description = "Python bindings for Cymbal code indexing and symbol discovery"
1313
readme = "README.md"
1414
requires-python = ">=3.7"

‎python/cymbal/__init__.py‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,41 @@ def _load_binary():
5757
if others:
5858
error_msg += f" Found binaries for: {', '.join(others)}. You may need to rebuild for the current platform."
5959
raise ImportError(error_msg)
60+
# Map platform to our specific Go shared library names
61+
lib_map = {
62+
"linux": (".linux.so", "pycymbal_go.so"),
63+
"windows": (".windows.dll", "pycymbal_go.dll"),
64+
"darwin": (".darwin.dylib", "pycymbal_go.dylib")
65+
}
66+
67+
# On Windows, we must ensure the Go DLL is findable by the .pyd extension.
68+
# The .pyd is compiled to look for 'pycymbal_go.dll', but we distribute it
69+
# as 'pycymbal_go.windows.dll'. We'll create a link/copy if needed.
70+
if system in lib_map:
71+
suff, target_name = lib_map[system]
72+
src_lib = os.path.join(pkg_dir, f"pycymbal_go{suff}")
73+
dst_lib = os.path.join(pkg_dir, target_name)
74+
75+
if os.path.exists(src_lib) and not os.path.exists(dst_lib):
76+
try:
77+
# Try symlink first, fallback to copy if on Windows without permissions
78+
if hasattr(os, "symlink") and system != "windows":
79+
os.symlink(src_lib, dst_lib)
80+
else:
81+
import shutil
82+
shutil.copy2(src_lib, dst_lib)
83+
except Exception as e:
84+
print(f"Warning: Could not create link from {src_lib} to {dst_lib}: {e}", file=sys.stderr)
85+
86+
# DLL search path for Windows Python 3.8+
87+
if system == "windows":
88+
if hasattr(os, "add_dll_directory"):
89+
try:
90+
os.add_dll_directory(pkg_dir)
91+
except Exception:
92+
pass
93+
# Add to PATH as well for older Python versions or specific loader behaviors
94+
os.environ['PATH'] = pkg_dir + os.path.pathsep + os.environ.get('PATH', '')
6095

6196
# Load the module
6297
spec = importlib.util.spec_from_file_location("cymbal._pycymbal", binary_path)

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name="py-cymbal",
11-
version="0.1.13",
11+
version="0.1.14",
1212
description="Python bindings for Cymbal code indexing and symbol discovery",
1313
author="Cymbal Contributors",
1414
author_email="contact@example.com",

0 commit comments

Comments
 (0)