Skip to content

Commit c648f2a

Browse files
committed
fix: fix build causing crash on install
Modified: • build_hooks.py (+9/-9 lines) [gitship-generated]
1 parent 5702630 commit c648f2a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

build_hooks.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434

3535
def _run_post_install():
3636
if sys.platform in ('emscripten', 'wasm32'):
37-
print(" [build_hooks] WASM environment detected, skipping C dispatcher build.")
3837
return
3938
marker = Path(sys.executable).parent / ".omnipkg_dispatch_compiled"
4039
if marker.exists():
4140
marker.unlink()
42-
# Import and call the setup.py installer which has full MSVC/gcc support
43-
setup_py = Path(__file__).parent / "setup.py"
44-
if setup_py.exists():
45-
import importlib.util
46-
spec = importlib.util.spec_from_file_location("setup", setup_py)
47-
mod = importlib.util.module_from_spec(spec)
48-
spec.loader.exec_module(mod)
49-
mod._install_dispatcher_binary(Path(sys.executable).parent)
41+
# Delegate to the runtime installer in dispatcher.py which has full MSVC support
42+
try:
43+
src_dir = Path(__file__).parent / "src" / "omnipkg"
44+
if src_dir not in sys.path:
45+
sys.path.insert(0, str(Path(__file__).parent / "src"))
46+
from omnipkg.dispatcher import _maybe_install_c_dispatcher
47+
_maybe_install_c_dispatcher()
48+
except Exception as e:
49+
print(f" [dispatcher] post-install skipped: {e}")
5050

5151
# Override build_editable — this is what `pip install -e .` calls
5252
def build_editable(wheel_directory, config_settings=None, metadata_directory=None):

0 commit comments

Comments
 (0)