Skip to content

🎥 Make videos programmatically with React

update toolchains

Jonny Burger6fc4bee65eee
diff --git a/packages/renderer/README.md b/packages/renderer/README.md
index 5600779876..bf51929b42 100644
--- a/packages/renderer/README.md
+++ b/packages/renderer/README.md
@@ -12,22 +12,6 @@ First, install Cargo, if you don't have it, or upgrade to a version that support
curl https://sh.rustup.rs -sSf | sh
```
-Second, install components that allow for cross-compilation:
-
-```sh
-sh install_platforms.sh
-```
-
-Third, install linkers for cross compilation:
-
-```sh
-brew install MaterializeInc/crosstools/x86_64-unknown-linux-gnu
-brew install MaterializeInc/crosstools/aarch64-unknown-linux-gnu
-brew install messense/macos-cross-toolchains/x86_64-unknown-linux-musl
-brew install messense/macos-cross-toolchains/aarch64-unknown-linux-musl
-brew install mingw-w64
-```
-
> This will take a few minutes.
## Building
@@ -38,10 +22,20 @@ To build the Rust parts for your operating system, run:
node build.mjs
```
-To build the Rust binaries for all supported platforms, run:
+## Building for all platforms
+
+These instructions currently are for macOS. Contributions for other platforms are appreciated.
+
+To build the Rust binaries for all supported platforms, you need to install some dependencies:
+
+```sh
+node install-toolchains.mjs
+```
+
+You can then build all binaries with:
```
-node build.mjs --all
+pnpm build-all
```
The resulting artifacts should be checked into Git.
diff --git a/packages/renderer/install-toolchain.mjs b/packages/renderer/install-toolchain.mjs
index 01d100527e..50a181e677 100644
--- a/packages/renderer/install-toolchain.mjs
+++ b/packages/renderer/install-toolchain.mjs
@@ -1,21 +1,25 @@
import {execSync} from 'child_process';
-import {existsSync, mkdirSync, unlinkSync, writeFileSync} from 'fs';
+import {existsSync, mkdirSync, unlinkSync} from 'fs';
const toolchains = [
'x86_64_gnu_toolchain',
'aarch_gnu_toolchain',
'x86_64_musl_toolchain',
- 'aarch64-musl-toolchain'
+ 'aarch64-musl-toolchain',
];
-for (const toolchain of toolchains) {
- const res = await fetch(
- `https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/${toolchain}.zip`
- );
+const unpatched = [
+ 'x86_64-apple-darwin',
+ 'aarch64-apple-darwin',
+ 'x86_64-pc-windows-gnu',
+];
- const blob = await res.arrayBuffer();
+for (const toolchain of toolchains) {
+ process.stdout.write(toolchain + '...');
- writeFileSync(`${toolchain}.zip`, Buffer.from(blob));
+ execSync(
+ `curl https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/${toolchain}.zip -o ${toolchain}.zip`
+ );
if (!existsSync('toolchains')) {
mkdirSync('toolchains');
@@ -30,4 +34,9 @@ for (const toolchain of toolchains) {
});
unlinkSync(`${toolchain}.zip`);
+ process.stdout.write('Done.\n');
+}
+
+for (const target of unpatched) {
+ execSync(`rustup target add ${target}`);
}
diff --git a/packages/renderer/install_platforms.sh b/packages/renderer/install_platforms.sh
deleted file mode 100644
index 638388cf00..0000000000
--- a/packages/renderer/install_platforms.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-rustup target add x86_64-unknown-linux-gnu
-rustup target add aarch64-unknown-linux-gnu
-rustup target add x86_64-unknown-linux-musl
-rustup target add aarch64-unknown-linux-musl
-rustup target add x86_64-apple-darwin
-rustup target add aarch64-apple-darwin
-rustup target add x86_64-pc-windows-gnu