Skip to content

build: use --profile=dev-release as the default cargo profile#70

Draft
darioush wants to merge 1 commit into
masterfrom
darioush/use-dev-release-profile
Draft

build: use --profile=dev-release as the default cargo profile#70
darioush wants to merge 1 commit into
masterfrom
darioush/use-dev-release-profile

Conversation

@darioush
Copy link
Copy Markdown
Contributor

Summary

Switch the nayduck worker's default (non---release) build to use the dev-release cargo profile instead of plain dev. The profile is defined in nearcore/Cargo.toml as release with lto=false, codegen-units=16, and debug-assertions=true — so we get release-style optimisations while keeping debug asserts on.

Motivation: expensive nightly tests run a long time. e.g. `tests::doomslug::ultra_slow_test_fuzzy_doomslug_liveness_and_safety` does heavy simulation in a 25ms-tick outer loop and is bottlenecked by codegen quality rather than I/O. The same logic applies to most other entries in nearcore's `nightly/expensive.txt`.

This is contained to nayduck's own build machines — pre-merge CI and local developer compiles are unaffected.

Changes

  • `workers/builder.py`: pass `--profile=dev-release` to cargo when the test spec did not request `--release`; `build_type` returns `dev-release` so artefact copies pick the right `target/` subdir.
  • `frontend/src/a_test.js`: the rendered cargo command on each test page now shows `--profile=dev-release` (or `--release`), matching what the worker actually runs.
  • `frontend/src/Build.js`: build-page label changes from "Dev" to "Dev-release" to match.

`lib/testspec.py` and the DB schema are untouched — the test-spec grammar is unchanged.

Risk

Test runtime behavior may shift since `opt-level=3` enables aggressive inlining and the test profile changes from `dev`-inherited to `release`-inherited (overflow-checks on, panic=abort). Worth a manual nightly run before un-drafting to confirm no regressions in the expensive suite.

Test plan

  • Run `python3 -c "import lib.testspec_test as m; m.test_testspec()"` — passed locally.
  • Trigger a full nightly run against this branch and compare pass-rate + wall-time vs. current master.
  • Spot-check a test page in the UI to confirm the rendered `cargo` command shows `--profile=dev-release`.

Speeds up expensive tests by building with release-style optimisations
(opt-level=3, codegen-units=16, no LTO) while keeping debug-assertions
on.  Pre-merge CI in nearcore is unaffected; only nayduck builds use
this profile.

The displayed cargo commands in the web UI are updated to match what
the worker actually runs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant