Skip to content

main_binary takes minutes on first run #57

Closed
@epage

Description

@epage

cargo test takes a long time with because the first run of main_binary takes a long time while holding the cargo locking, blocking other tests

Example

running 6 tests
test blackbox_backup ... test blackbox_backup has been running for over 60 seconds
test blackbox_help ... test blackbox_help has been running for over 60 seconds
test blackbox_help ... ok
test blackbox_no_args ... ok
test clean_error_on_non_archive ... ok
test empty_archive ... ok
test incomplete_version ... ok
test blackbox_backup ... ok

From https://ci.appveyor.com/project/sourcefrog/conserve/builds/20036005

Cause

  • If a bare cargo test is run, cargo uses target/debug for the OUT_DIR
  • main_binary passes --target <TRIPLET> to cargo which changes the OUT_DIR to target/<TRIPLE>/debug
    • This means cargo tests build artifacts cannot be reused and those parts need to be rebuilt

Background:

In Issue #4 we had to choose between performance and correctness (if you do specify --target, main_binary should run that target's bin) and sided on correctness

Workarounds

  1. Call into escargot without passing in current_target

  2. Call cargo test --target <TRIPLE>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions