mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-11 01:22:15 +00:00
* AG4: xtask ci --affected cargo xtask ci --affected [--base REV] [--dry-run] runs fmt, clippy, tests (nextest + doctests when available), layers, assets (only on asset changes) and wasm (only for affected L0-L4/web crates) for the packages a change can affect: changed files map to the owning package and to packages whose sources read them via ../ paths, expanded to reverse dependents. Workspace-wide inputs (root Cargo.toml, Cargo.lock, .cargo/, xtask/, toolchain, clippy.toml) fall back to full CI. Documented in docs/testing.md, AGENTS.md and CLAUDE.md. (cherry picked from commit f3ca84fc2ee3948582cbc94e4c99ee510e829540) (cherry picked from commit 8a2cdcadf447eafa57ab14016beae4420f002af0) (cherry picked from commitd8a4301bc1) (cherry picked from commit 36402c61ac2f7e29ecd76a6cfc89365cc2572e0a) * AO1: fast CI profile, looser timing tests - [profile.ci] (release without LTO, 16 codegen units); `xtask ci` runs clippy and tests with --profile ci instead of --release. - Wall-clock asserts in engine memory_tick, gpu OpenGL decline and script socket tests keep their intent with bounds that survive a loaded machine. - docs/testing.md and CONTRIBUTING.md mention the profile. (cherry picked from commit b45c8a379351ebdfda0d7076ad4b740baf6f2087) (cherry picked from commit fa1ea6a107c4c1936cde89b518a05adc73f2b4b0) (cherry picked from commite5d5ed80e9) (cherry picked from commit d2c67660c70764f9c56880a642ad7f0d004a7f92) * AG6: journal replay repros Bug reports become replay scripts and crash regression tests become data files: - engine::replay: a JSON-lines repro format (start line, command steps with expect_error, expect queries with JSON pointer + equals, expect_no_error), a never-panicking runner that reports per-step ok/error and the first failure, and journal export (from the last project open; saves left out; size-capped). - journal.export {path?} and help.exportRepro {path?} (not journaled). - Crash capture: when the last-resort guard catches a panic in the outermost command, the journal plus that command is saved to Repros/crash-*.jsonl in the settings store (newest 20 kept) and the error names the file. - Commands run by a journaled command (script steps) are no longer journaled twice. - effectcraft-cli replay SCRIPT.jsonl [--json] [--keep-going]: exits 1 on a failed step, unmet expectation or panic. - crates/host/tests/repros.rs replays every tests/repros/*.jsonl; three samples from past crash fixes (zero frame rate, Layer Settings with no selection, New Comp from Selection with hostile overlap). - Docs: docs/agents.md "Repro scripts"; AGENTS.md: crash fix regression test = a .jsonl in tests/repros. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit c38509d7dafe507856c48c78db65e00b94b0cebc) (cherry picked from commit e55b56dbf76716adfcbfe4cc773df19a74edc419) (cherry picked from commit96a63855a9) (cherry picked from commit c59351ab3bd697f0868e41230dd883960d94a540) * xtask: ci and ci --affected run cargo test and nextest with --no-fail-fast One run now lists every failing crate instead of stopping at the first. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019qXL3GPNnY9BSFF2XoU2Yu (cherry picked from commit e46c7debe738eca62b35bf7392ab77637f6a33ae) * Agents: confinement write-checks journal.export, help.exportRepro and file.exportTimeline Review on #859 (split into this PR): their output paths were only read-checked (relative ones not at all). Test: confinement_covers_every_command_that_writes_a_file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014d65YdNxQmjRkbXRtP2NwH * #1224: handle bin-only CI targets and BOM repros without weakening timing tests * #1224: run the full gate when nextest policy changes --------- Co-authored-by: Elias <hakifx91@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: FredApps <FredApps@users.noreply.github.com> Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
110 lines
5.1 KiB
Markdown
110 lines
5.1 KiB
Markdown
# Contributing to EffectCraft
|
|
|
|
Thanks for helping. Please read [AGENTS.md](AGENTS.md) first: its rules on assets and clean-room
|
|
work apply to everyone, people and AI agents alike, and they are not negotiable.
|
|
|
|
## Setup
|
|
|
|
You need [Rust](https://rustup.rs/) 1.95 or newer.
|
|
|
|
On Linux the desktop app plays preview sound through `cpal`, so the build needs a usable ALSA
|
|
pkg-config package: an `alsa.pc` that pkg-config can find, naming the linkable ALSA runtime
|
|
library (usually `libasound.so.2`). `alsa-sys` runs pkg-config at build time; it does not compile
|
|
ALSA's headers. Without a usable package the build fails at link time with an unrelated-looking
|
|
error; `cargo xtask ci` probes pkg-config up front and names the package:
|
|
|
|
```sh
|
|
sudo dnf install alsa-lib-devel # Fedora
|
|
sudo apt install libasound2-dev # Debian / Ubuntu
|
|
sudo pacman -S alsa-lib # Arch
|
|
```
|
|
|
|
If you cannot install the package, point `PKG_CONFIG_PATH` at a directory holding an `alsa.pc`
|
|
whose `Libs` line names your system's `libasound` (usually `libasound.so.2`); every CI run needs
|
|
that variable set.
|
|
|
|
```sh
|
|
cargo run -p effectcraft -- --demo # the desktop app, with the demo project
|
|
cargo test --workspace
|
|
cargo xtask ci # what every commit must pass (dev-profile checks and tests)
|
|
```
|
|
|
|
The default `dev` profile keeps debug info to line tables: builds are fast and panics/backtraces
|
|
still name the file and line, but a debugger cannot show local variables. For an interactive
|
|
debugger session use the `dev-full` profile, which is the same build with full debug info:
|
|
|
|
```sh
|
|
cargo run --profile dev-full -p effectcraft -- --demo
|
|
```
|
|
|
|
### Windows
|
|
|
|
The MSVC toolchain, rustup's default on Windows, is what the releases use: with the Visual Studio
|
|
C++ build tools installed, the commands above work as they are.
|
|
|
|
The GNU toolchain (`x86_64-pc-windows-gnu`) needs a current mingw-w64 GCC and binutils first on
|
|
`PATH`. They provide the linker and the Windows import libraries, such as `libshlwapi.a` for
|
|
opening links from the app. With MSYS2:
|
|
|
|
```powershell
|
|
C:\msys64\usr\bin\pacman.exe -S --needed mingw-w64-x86_64-gcc
|
|
$env:PATH = "C:\msys64\mingw64\bin;$env:PATH"
|
|
cargo +stable-x86_64-pc-windows-gnu run -p effectcraft -- --demo
|
|
```
|
|
|
|
An older MinGW earlier on `PATH` can break the build: CodeBlocks' GCC 8.1 fails to link
|
|
`boa_engine` ([#1882](https://github.com/storytold/effectcraft/issues/1882)).
|
|
|
|
Rust's bundled LLD and self-contained libraries don't include every import library EffectCraft
|
|
needs, so on their own they stop with `unable to find library` for `-lshlwapi`, `-lktmw32`,
|
|
`-lpropsys` and `-lversion` ([#1886](https://github.com/storytold/effectcraft/issues/1886)). To
|
|
link that way, copy those four from mingw-w64 into a folder of its own and add that folder to the
|
|
search path in your own Cargo config (`%USERPROFILE%\.cargo\config.toml`). Don't add all of
|
|
mingw-w64's `lib` folder: its C runtime clashes with Rust's bundled one
|
|
(`undefined symbol: DllEntryPoint`).
|
|
|
|
```powershell
|
|
New-Item -ItemType Directory -Force C:\gnu-import-libs
|
|
foreach ($lib in "shlwapi", "ktmw32", "propsys", "version") {
|
|
Copy-Item "C:\msys64\mingw64\lib\lib$lib.a" C:\gnu-import-libs\
|
|
}
|
|
```
|
|
|
|
```toml
|
|
[target.x86_64-pc-windows-gnu]
|
|
linker = "rust-lld"
|
|
rustflags = ["-C", "link-self-contained=yes", "-L", "native=C:/gnu-import-libs"]
|
|
```
|
|
|
|
## Ground rules
|
|
|
|
- **Clean room.** Work from After Effects' public documentation and its observable behaviour only.
|
|
Never use Adobe artwork, presets or code, and never copy GPL/LGPL/AGPL code.
|
|
- **Every asset is attributed.** Add a `.attribution` sidecar and an [ATTRIBUTION.md](ATTRIBUTION.md)
|
|
row; `cargo xtask assets` checks it.
|
|
- **Layering.** Nothing below the interface layer depends on UI or OS crates; see
|
|
[docs/architecture.md](docs/architecture.md).
|
|
- **Everything is a command.** New features are engine commands with an id, label, menu path,
|
|
shortcut and parameters, so the UI, the CLI and the MCP server get them at once. Interactive
|
|
widgets register an automation id.
|
|
- **Never crash.** Non-test code returns errors instead of panicking: no `unwrap()`, `expect()`,
|
|
`panic!`, `unreachable!`, `todo!`, `unimplemented!` or `unsafe`, checked indexing and arithmetic on
|
|
input-derived values, and a regression test with every crash fix. See the "Never crash" section of
|
|
[AGENTS.md](AGENTS.md).
|
|
- **Tests with every change**, and green `cargo xtask ci` before every commit. One task per commit.
|
|
|
|
## How to add…
|
|
|
|
- **An effect:** add an `EffectSpec` in `crates/effects` (AE display name, category, parameters
|
|
with AE's names, defaults and ranges) and its render function, with a determinism test and a
|
|
behaviour test. If it reads the clock directly, add it to `TIME_DEPENDENT`.
|
|
- **A command:** register it with `cmd!` in `crates/engine/src/commands/`, place it in the menu
|
|
tree in `crates/engine/src/menus.rs`, and test it including undo.
|
|
- **A panel or dialog:** `crates/ui-egui/src/panels/`; look at the result with the headless
|
|
snapshot tool described in [docs/testing.md](docs/testing.md).
|
|
|
|
## Talk to us
|
|
|
|
Questions, ideas and bug reports are welcome on [Discord](https://discord.gg/artcraft) and in
|
|
GitHub issues.
|