Files
anki/tools/ninja.bat
Abdo 3c9b1daf35 CI: Apply a consistent Cargo profile (#5133)
## Linked issue

Related:
https://github.com/ankitects/anki/pull/5102#issuecomment-4923922894

## Summary / motivation


This adds a new Cargo profile (`ci`) for use in all Rust build commands
on CI. The goal is to reduce unnecessary recompilation of the same
crates in dev/release profiles.

## Steps to reproduce (before)

View the logs of the last CI run on main and notice that some crates are
getting compiled with the `release` profile, e.g. compilation ends with
"Finished `release` profile [optimized]".

## How to test (after)

View the logs of the last CI run in this PR and confirm all Rust
compilation commands end with "Finished `ci` profile [unoptimized]",
indicating that only a single profile is being used.

### Checklist (minimum)

- [x] I ran `./ninja check` or an equivalent relevant check locally.
- [ ] I added or updated tests when the change is non-trivial or
behavior changed.

## Scope

- [x] This PR is focused on one change (no unrelated edits).
2026-08-12 10:17:29 +03:00

9 lines
369 B
Batchfile
Executable File

@echo off
set CARGO_TARGET_DIR=%~dp0..\out\rust
set "RECONFIGURE_KEY=%SOURCEMAP%;%HMR%;%CI%"
set RUNNER_PROFILE=release
if "%CI%"=="true" if "%RELEASE%"=="" set RUNNER_PROFILE=ci
REM separate build+run steps so build env doesn't leak into subprocesses
cargo build -p runner --profile %RUNNER_PROFILE% || exit /b 1
out\rust\%RUNNER_PROFILE%\runner build %* || exit /b 1