Skip to content

v0.27.0 issue — unexpected keyword argument "metadata_files" #2146

Closed

Description

@ryanpbrewster

I upgraded a workspace from v0.26.0 to v0.27.0 and got an error:

ERROR: /private/var/tmp/_bazel/59027761c515cdd22b50f405ce0ec00f/external/rules_rust_tinyjson/BUILD.bazel:4:37: in rust_library_without_process_wrapper rule @rules_rust_tinyjson//:tinyjson: 
Traceback (most recent call last):
        File "/private/var/tmp/_bazel/59027761c515cdd22b50f405ce0ec00f/external/rules_rust/rust/private/rust.bzl", line 199, column 32, in _rust_library_impl
                return _rust_library_common(ctx, "rlib")
        File "/private/var/tmp/_bazel/59027761c515cdd22b50f405ce0ec00f/external/rules_rust/rust/private/rust.bzl", line 293, column 32, in _rust_library_common
                return rustc_compile_action(
        File "/private/var/tmp/_bazel/59027761c515cdd22b50f405ce0ec00f/external/rules_rust/rust/private/rustc.bzl", line 1417, column 48, in rustc_compile_action
                coverage_common.instrumented_files_info(
Error in instrumented_files_info: instrumented_files_info() got unexpected keyword argument 'metadata_files'
ERROR: /private/var/tmp/_bazel/59027761c515cdd22b50f405ce0ec00f/external/rules_rust_tinyjson/BUILD.bazel:4:37: Analysis of target '@rules_rust_tinyjson//:tinyjson' failed

Downgrading back to v0.26.0 fixes the issue. Is it possible that there's been a regression? Or do I need to do something to update my WORKSPACE file?

Activity

  1. ryanpbrewster commented on Sep 1, 2023

    @ryanpbrewster
    ContributorAuthor

    Ah, I dug around and saw this PR #2000 which hinted towards

    --@rules_rust//rust/settings:experimental_use_coverage_metadata_files=false
    

    which fixes the issue I'm running into

    I have a workaround, but I imagine this will be unexpected for other users. Is there a good way to fix this without explicitly opting out via build settings?

  2. UebelAndre commented on Sep 4, 2023

    @UebelAndre
    Collaborator

    There isn't another way to "fix" this without using a flag. The flag exists so users who are updating rules_rust but not updating Bazel can continue to use the repo as they were before. And at some point in the future, the flag will be removed, thus communicating the newest release of rules_rust at that time requires a newer version of Bazel. I can maybe agree flipping the flag was done a bit earlier than needed but I think this is an effective way to provide forward and backward compatibility. Is there another method you would prefer?

    #2082 is the tracking issue for the flag.

  3. ryanpbrewster commented on Sep 4, 2023

    @ryanpbrewster
    ContributorAuthor

    I think an explicit check somewhere that bazel is >= v6.3.0, with an informative error message, like

    rules_rust requires bazel to be on at least v6.3.0; if you cannot upgrade, pass in --@rules_rust//rust/settings:experimental_use_coverage_metadata_files=false as a flag

    would be helpful. This was a fairly mysterious error when I encountered it.

  4. ibigbug commented on Sep 7, 2023

    @ibigbug
    Contributor

    getting a similar but different error?

    Error in instrumented_files_info: private API only for use in builtins
    
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions