Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-1268

Client handshake metadata omits platforms field whenever rustc is not available

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The driver currently only appends the platforms field to the handshake metadata when version_check::triple(), which we use to check the Rust version the user is using, returns a non-null value.
      However, there are some limitations with that crate:

      The version is queried by calling the Rust compiler with --version. The path to the compiler is determined first via the RUSTC environment variable. If it is not set, then rustc is used. If that fails, no determination is made, and calls return None.

      This presents a couple of different problems for us:
      1. Many of our users deploy Rust binaries somewhere differently from where they were compiled, and don't even install Rust wherever their binary is deployed.
      2. This could report an incorrect value because the current Rust version being used on a machine doesn't necessarily have to match the version used to compile any binaries currently being run there.

      Instead, we should switch to using rustc_version_runtime (https://crates.io/crates/rustc_version_runtime) which uses a build script to store the version at compile time and then allows us to read that version at runtime.

            Assignee:
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Reporter:
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: