This is an archive of the discontinued Mercurial Phabricator instance.

rhg: use a release-mode executable in tests
ClosedPublic

Authored by SimonSapin on Jan 12 2021, 12:41 PM.

Details

Summary

This allows the rhg build for test-rhg.t to share compiled dependencies
such as hg-core with the hg-cpython build for other tests.

For context, my wrapper script for the typical edit-compile-test
cycle now looks like this:

(cd rust && cargo +nightly-2020-10-04 fmt)
(cd rust && cargo build --release -p rhg)
make --silent local PURE=--rust
python test/run-tests.py --local "$@"

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

SimonSapin created this revision.Jan 12 2021, 12:41 PM
Alphare accepted this revision.Jan 13 2021, 4:06 AM
Alphare added a subscriber: Alphare.

I thought I'd already sent this patch. heh

I wonder if that means that noone will ever run the debug_assert!s.

pulkit accepted this revision.Jan 13 2021, 5:15 AM
pulkit added a subscriber: pulkit.

I thought I'd already sent this patch. heh
I wonder if that means that noone will ever run the debug_assert!s.

Maybe all those debug_assert!s should be replaced by errors or normal assert.

This revision is now accepted and ready to land.Jan 13 2021, 5:15 AM

Yes, having debug assertions enabled when running tests would be valuable, but at the moment they’re already disabled in hg-cpython since setup.py always runs Cargo with --release.

Ideally setup.py itself would have two different modes: release when building a Mercurial for end users, and dev when running a test suite or otherwise contributing to Mercurial itself. If running the test suite without Rust optimizations is too slow we can configure the dev "profile" to enable optimizations, while keeping other dev configuration.

However I’ll leave touching setup.py to another patch :)

This revision was automatically updated to reflect the committed changes.