Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix MSRV breakage #937

Merged
merged 2 commits into from
Aug 17, 2020
Merged

chore: fix MSRV breakage #937

merged 2 commits into from
Aug 17, 2020

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Aug 17, 2020

This branch contains two commits that fix MSRV issues.

  • attributes: remove use of non-MSRV-compliant Option::flatten

    PR #[instrument] - support use of the 'self' variable in async-trait contexts #875 added code to tracing-attributes that uses
    Option::flatten, which was only added to the standard library in
    Rust 1.40. This broke our MSRV, but we missed it because the MSRV CI
    checks weren't working correctly (fixed in chore: correct the MSRV check #934).

    This commit removes the use of Option::flatten, and replaces it with
    a manual implementation. It's a little less pretty, but it builds on
    our MSRV (1.39.0).

    Once this merges, we'll publish a new tracing-attributes version,
    and yank 0.1.10.

  • examples: disable opentelemetry's default features

    The opentelemetry crate depends on prometheus, which depends on
    protobuf, a crate which doesn't compile on our MSRV (Rust 1.39).
    This was missed due to issues with the MSRV CI checks, which will be
    fixed fixed in chore: correct the MSRV check #934. Therefore, once the MSRV checks work properly,
    the protobuf dependency will break our builds.

    We don't need the opentelemetry/metrics feature, which is what
    enables the prometheus (and thus protobuf) dependency.
    tracing-opentelemetry already has a default-features = false
    dependency on opentelemetry, but the examples don't. Therefore, I've
    changed the examples crate to disable opentelemetry's default
    features as well.

PR #875 added code to `tracing-attributes` that uses `Option::flatten`,
which was only added to the standard library in Rust 1.40. This broke
our MSRV, but we missed it because the MSRV CI checks weren't working
correctly (fixed in #934).

This commit removes the use of `Option::flatten`, and replaces it with a
manual implementation. It's a little less pretty, but it builds on our
MSRV (1.39.0).
The `opentelemetry` crate depends on `prometheus`, which depends on
`protobuf`, a crate which doesn't compile on our MSRV (Rust 1.39). This
was missed due to issues with the MSRV CI checks, which will be fixed
fixed in #934. Therefore, once the MSRV checks work properly, the
`protobuf` dependency will break our builds.

We don't _need_ the `opentelemetry/metrics` feature, which is what
enables the `prometheus` (and thus `protobuf`) dependency.
`tracing-opentelemetry` already has a `default-features = false`
dependency on `opentelemetry`, but the examples don't. Therefore, I've
changed the examples crate to disable `opentelemetry`'s default features
as well.
@hawkw hawkw requested a review from a team as a code owner August 17, 2020 17:43
@hawkw hawkw merged commit b358201 into master Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants