Skip to content

incompatible_change_rust_test_compilation_output_directory #2827

Closed

Description

@felipeamp

Currently the compilation outputs of a rust_library are put in that specific directory. For example, one of the compilation outputs of my/package:my_library will be the my_library file in my/package.

However, the compilation outputs of rust_test rules are put in a specific test subdirectory containing a hash in its name. For example, the compilation output of my/package:my_test, which tests my/package:my_library, will contain the my_library file in my/package/test-<hash_id>.

This was done as a way to unblock the flaky/failing tests of #1427.

In order to have all compilation outputs in the same directory (i.e. without the test-<hash_id> subdirectory for test rules) we will add a _test suffix to the crate name of rust_test targets. This is a backward-incompatible change, since if the crate_name attribute is set in code (e.g. #![crate_name = "my_crate"]), we need to set the crate_name attribute in the rust_test rule to match it.

Therefore this change will be done behind a feature flag named incompatible_change_rust_test_compilation_output_directory.

Activity

  1. changed the title [-]Put compilation outputs of `rust_library` and `rust_test` rules in same directory without conflicts[/-] [+]`incompatible_change_rust_test_compilation_output_directory`[/+] on Mar 14, 2026
  2. added
    needs-triage
    on Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions