Skip to content

Commit

Permalink
mediasoup-worker linux prebuilt with io-uring support (part 1) (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc authored Dec 30, 2023
1 parent f4931c6 commit ee2654b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion npm-scripts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const WORKER_RELEASE_DIR = 'worker/out/Release';
const WORKER_RELEASE_BIN = IS_WINDOWS ? 'mediasoup-worker.exe' : 'mediasoup-worker';
const WORKER_RELEASE_BIN_PATH = `${WORKER_RELEASE_DIR}/${WORKER_RELEASE_BIN}`;
const WORKER_PREBUILD_DIR = 'worker/prebuild';
const WORKER_PREBUILD_TAR = `mediasoup-worker-${PKG.version}-${os.platform()}-${os.arch()}.tgz`;
const WORKER_PREBUILD_TAR = getWorkerPrebuildTarName();
const WORKER_PREBUILD_TAR_PATH = `${WORKER_PREBUILD_DIR}/${WORKER_PREBUILD_TAR}`;
const GH_OWNER = 'versatica';
const GH_REPO = 'mediasoup';
Expand Down Expand Up @@ -300,6 +300,22 @@ function getPython()
return python;
}

function getWorkerPrebuildTarName()
{
let name = `mediasoup-worker-${PKG.version}-${os.platform()}-${os.arch()}`;

// In Linux we want to know about kernel version since kernel >= 6 supports
// io-uring.
if (os.platform() === 'linux')
{
const kernelMajorVersion = Number(os.release().split('.')[0]);

name += `-kernel${kernelMajorVersion}`;
}

return `${name}.tgz`;
}

function installInvoke()
{
if (fs.existsSync(PIP_INVOKE_DIR))
Expand Down

0 comments on commit ee2654b

Please sign in to comment.