Skip to content

🎥 Make videos programmatically with React

`@remotion/renderer`: Update libc requirements

Jonny Burger2ab180765d04
diff --git a/packages/docs/docs/getting-started.md b/packages/docs/docs/getting-started.md
index 693a34f4d7..a8683c5a20 100644
--- a/packages/docs/docs/getting-started.md
+++ b/packages/docs/docs/getting-started.md
@@ -107,7 +107,7 @@ Watch out for `apt` wanting to uninstall critical packages (e.g the Desktop) in
</Tabs>
-Linux distros that use libc need at least version 2.35 of it. [Check here](https://github.com/remotion-dev/remotion/issues/2439) if your distro has it.
+Linux distros that use libc need at least version 2.31 of it. [Check here](https://github.com/remotion-dev/remotion/issues/2439) if your distro has it.
Got instructions for more Linux distributions? [Add them to this page](https://github.com/remotion-dev/remotion/edit/main/packages/docs/docs/getting-started.md)!
diff --git a/packages/renderer/src/check-apple-silicon.ts b/packages/renderer/src/check-version-requirements.ts
similarity index 62%
rename from packages/renderer/src/check-apple-silicon.ts
rename to packages/renderer/src/check-version-requirements.ts
index 87035f0dbe..de39535811 100644
--- a/packages/renderer/src/check-apple-silicon.ts
+++ b/packages/renderer/src/check-version-requirements.ts
@@ -1,21 +1,48 @@
+import {isMusl} from './compositor/get-executable-path';
import type {LogLevel} from './log-level';
import {Log} from './logger';
+const getRequired = () => {
+ if (process.platform !== 'linux') {
+ return null;
+ }
+
+ if (isMusl({indent: false, logLevel: 'warn'})) {
+ return null;
+ }
+
+ // Uses Amazon Linux 2 to compile
+ if (process.arch === 'arm64') {
+ return [2, 26];
+ }
+
+ // Uses Ubuntu 20.04 to compile
+ return [2, 31];
+};
+
+const required = getRequired();
+
export const gLibCErrorMessage = (libCString: string) => {
+ if (required === null) {
+ return null;
+ }
+
const split = libCString.split('.');
if (split.length !== 2) {
return null;
}
- if (split[0] === '2' && Number(split[1]) >= 35) {
+ if (split[0] === String(required[0]) && Number(split[1]) >= required[1]) {
return null;
}
- if (Number(split[0]) > 2) {
+ if (Number(split[0]) > required[0]) {
return null;
}
- return `Rendering videos requires glibc 2.35 or higher. Your system has glibc ${libCString}.`;
+ return `Rendering videos requires glibc ${required.join(
+ '.',
+ )} on your or higher on your OS. Your system has glibc ${libCString}.`;
};
const checkLibCRequirement = (logLevel: LogLevel, indent: boolean) => {
diff --git a/packages/renderer/src/compositor/get-executable-path.ts b/packages/renderer/src/compositor/get-executable-path.ts
index a08bb46c27..a0270dce84 100644
--- a/packages/renderer/src/compositor/get-executable-path.ts
+++ b/packages/renderer/src/compositor/get-executable-path.ts
@@ -5,7 +5,13 @@ import {Log} from '../logger';
let warned = false;
-function isMusl({indent, logLevel}: {indent: boolean; logLevel: LogLevel}) {
+export function isMusl({
+ indent,
+ logLevel,
+}: {
+ indent: boolean;
+ logLevel: LogLevel;
+}) {
// @ts-expect-error bun no types
if (!process.report && typeof Bun !== 'undefined') {
if (!warned) {
diff --git a/packages/renderer/src/index.ts b/packages/renderer/src/index.ts
index 1101ee7ef1..7d49767e45 100644
--- a/packages/renderer/src/index.ts
+++ b/packages/renderer/src/index.ts
@@ -12,7 +12,7 @@ import {callFf, dynamicLibraryPathOptions} from './call-ffmpeg';
import {canUseParallelEncoding} from './can-use-parallel-encoding';
import {chalk} from './chalk';
import {isColorSupported} from './chalk/is-color-supported';
-import {checkNodeVersionAndWarnAboutRosetta} from './check-apple-silicon';
+import {checkNodeVersionAndWarnAboutRosetta} from './check-version-requirements';
import {DEFAULT_CODEC, validCodecs} from './codec';
import {combineVideos} from './combine-videos';
import {getExecutablePath} from './compositor/get-executable-path';
diff --git a/packages/renderer/src/test/libc-requirement.test.ts b/packages/renderer/src/test/libc-requirement.test.ts
index 5723d49701..9c5377a3ca 100644
--- a/packages/renderer/src/test/libc-requirement.test.ts
+++ b/packages/renderer/src/test/libc-requirement.test.ts
@@ -1,5 +1,5 @@
import {expect, test} from 'vitest';
-import {gLibCErrorMessage} from '../check-apple-silicon';
+import {gLibCErrorMessage} from '../check-version-requirements';
test('Libc requirement', () => {
expect(gLibCErrorMessage('2.35')).toBe(null);