Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mediasoup-worker linux prebuilt with io-uring support (part 1) #1283

Merged
merged 1 commit into from
Dec 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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