Commit 2a0b3a5
committed
fix(build): Fix FFmpeg cross-platform build on macOS for Windows targets (#145)
* fix(build): fix FFmpeg cross-platform build on macOS for Windows targets
- Add cross-env dependency for cross-platform environment variables
- Update Windows build scripts to set BUILD_TARGET_PLATFORM and BUILD_TARGET_ARCH
- Modify download-ffmpeg.ts to prioritize environment variables over command arguments
- Update vite plugin to avoid duplicate FFmpeg downloads
- Fix release scripts to download all platform FFmpeg binaries before building
- Ensure correct FFmpeg binaries are included for each target platform
Resolves issue where building Windows packages on macOS would include macOS FFmpeg binaries instead of Windows ones.
* fix(build): improve FFmpeg download in CI environments
- Replace direct tsx command with npm run for better CI compatibility
- Add CI-specific handling with proper environment variable passing
- Convert hard failures to warnings to prevent CI build blocking
- Improve error messages and debugging information
Fixes Windows CI build failure: spawn tsx ENOENT
* fix(build): ensure FFmpeg is properly downloaded in Windows CI
- Use npm run ffmpeg:download on Windows for better compatibility
- Pass environment variables to ensure correct platform detection
- Throw errors on download failure to prevent incomplete builds
- Keep direct tsx usage on Unix systems for performance
This ensures CI builds never skip FFmpeg download and always include
the correct FFmpeg binaries for the target platform.1 parent 58fe719 commit 2a0b3a5
4 files changed
Lines changed: 92 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
22 | 36 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 37 | + | |
27 | 38 | | |
| 39 | + | |
28 | 40 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
34 | 62 | | |
35 | | - | |
| 63 | + | |
36 | 64 | | |
37 | 65 | | |
38 | 66 | | |
| |||
48 | 76 | | |
49 | 77 | | |
50 | 78 | | |
51 | | - | |
| 79 | + | |
| 80 | + | |
52 | 81 | | |
53 | 82 | | |
54 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| 133 | + | |
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
384 | 401 | | |
385 | 402 | | |
386 | 403 | | |
| |||
416 | 433 | | |
417 | 434 | | |
418 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
419 | 440 | | |
420 | 441 | | |
421 | 442 | | |
| |||
0 commit comments