diff --git a/.gitignore b/.gitignore index 171c225..1eb63cd 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ composer.lock .idea/ .vscode/ -# Rust build artifacts (Cargo.lock IS committed — bin crate, reproducible releases) +# Rust build artifacts (Cargo.lock IS committed — bin crate, reproducible releases). +# rust/target/ is local build output. rust/dist/ IS committed: it holds the +# prebuilt release binaries (+ .sha256) SHIPPED with the package for plug-and-play +# (BinaryManager::find resolves rust/dist/blax-webrtc-sfu- — no download). /rust/target/ -/rust/dist/ diff --git a/rust/dist/blax-webrtc-sfu-linux-x86_64 b/rust/dist/blax-webrtc-sfu-linux-x86_64 new file mode 100755 index 0000000..1d9e948 Binary files /dev/null and b/rust/dist/blax-webrtc-sfu-linux-x86_64 differ diff --git a/rust/dist/blax-webrtc-sfu-linux-x86_64.sha256 b/rust/dist/blax-webrtc-sfu-linux-x86_64.sha256 new file mode 100644 index 0000000..90d2a6a --- /dev/null +++ b/rust/dist/blax-webrtc-sfu-linux-x86_64.sha256 @@ -0,0 +1 @@ +79840ef020c334d9bdab5fcf5f72be918d444a6bdc6e9236574bd019357672b5 blax-webrtc-sfu-linux-x86_64 diff --git a/src/Media/Rust/BinaryManager.php b/src/Media/Rust/BinaryManager.php index 3ff8d07..a399fa6 100644 --- a/src/Media/Rust/BinaryManager.php +++ b/src/Media/Rust/BinaryManager.php @@ -45,7 +45,7 @@ class BinaryManager return (string) ($this->config['version'] ?? self::VERSION); } - /** First usable binary (override → dev build → installed), or null. */ + /** First usable binary (override → dev build → shipped → installed), or null. */ public function find(): ?string { $packageRoot = dirname(__DIR__, 3); @@ -54,6 +54,11 @@ class BinaryManager $this->config['binary'] ?? null, $devBuilds ? $packageRoot.'/rust/target/release/blax-webrtc-sfu' : null, $devBuilds ? $packageRoot.'/rust/target/debug/blax-webrtc-sfu' : null, + // Plug-and-play: the prebuilt binary SHIPPED with the package (composer + // installs it alongside the PHP), resolved per platform. This is what + // makes backend-hosted rooms work on `composer require`/`update` with + // no download step — see rust/dist/ (committed). + $packageRoot.'/rust/dist/blax-webrtc-sfu-'.$this->platform(), $this->installPath(), ]);