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

fix msrv (v0.1.x edition) #1581

Merged
merged 3 commits into from
Sep 19, 2021
Merged

fix msrv (v0.1.x edition) #1581

merged 3 commits into from
Sep 19, 2021

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Sep 19, 2021

Due to the CI issue fixed by PR #1580, we accidentally merged
tracing-subscriber changes that don't compile on our MSRV, Rust
1.42.0. This includes:

  • use of associated consts on primitive types (u64::MAX rather than
    std::u64::MAX)
  • use of #[cfg(...)] on if expressions
  • use of the str::strip_suffix method, which wasn't stable on 1.42.0

This branch backports #1508 to v0.1.x, and also fixes additional issues
in code that only exists on v0.1.x.

These changes are mostly very simple and mechanical. The only
significant change is changing the StaticDirective parsing code to not
use strip_suffix, which changes the implementation around a bit...but
it's still pretty straightforward.

This should fix 1.42.0 compatibility.

So...it turns out that passing `--bins` actually makes `cargo check` do
*nothing* on library-only projects without binaries. This
was...surprising.

It turns out that because of this, our MSRV check CI run is basically a
nop, and we accidentally merged code that doesn't compile on 1.42.0. I'm
very dumb lol.
This fixes the build on Rust 1.42.0, where primitive types don't have
associated consts. My bad!
Due to the CI issue fixed by PR #1580, we accidentally merged
`tracing-subscriber` changes that don't compile on our MSRV, Rust
1.42.0. This includes:

- use of associated consts on primitive types (`u64::MAX` rather than
  `std::u64::MAX`)
- use of `#[cfg(...)]` on `if` expressions
- use of the `str::strip_suffix` method, which wasn't stable on 1.42.0

This commit fixes these issues. These changes are mostly very simple and
mechanical. The only significant change is changing the
`StaticDirective` parsing code to not use `strip_suffix`, which changes
the implementation around a bit...but it's still pretty straightforward.

This should fix 1.42.0 compatibility.
@hawkw hawkw requested a review from davidbarsky September 19, 2021 18:52
@hawkw hawkw self-assigned this Sep 19, 2021
@hawkw hawkw requested a review from a team as a code owner September 19, 2021 18:52
@hawkw
Copy link
Member Author

hawkw commented Sep 19, 2021

Looks like the build failure here is that the nightly compiler is trying to download a version of h2 that doesn't exist?

@hawkw
Copy link
Member Author

hawkw commented Sep 19, 2021

interestingly when i curl the cratesio URL it's trying to download, i get a 301:

:; curl http://crates.io/api/v1/crates/h2/0.3.4/download
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>CloudFront</center>
</body>
</html>

...but in firefox, it actually tries to download the crate tarball? i love the computer!

@hawkw
Copy link
Member Author

hawkw commented Sep 19, 2021

anyway the nightly build failure isn't our fault and we allow merging things when nightly fails so, whatever!!

@hawkw hawkw merged commit 36476ac into v0.1.x Sep 19, 2021
@hawkw hawkw deleted the eliza/fix-msrv-v0.1.x branch September 19, 2021 19:35
hawkw added a commit that referenced this pull request Sep 19, 2021
# 0.2.24 (September 19, 2021)

This release contains a number of bug fixes, including a fix for
`tracing-subscriber` failing to compile on the minimum supported Rust
version of 1.42.0. It also adds `IntoIterator` implementations for the
`Targets` type.

### Fixed

- Fixed compilation on Rust 1.42.0 ([#1580], [#1581])
- **registry**: Ensure per-layer filter `enabled` state is cleared when
  a global filter short-circuits filter evaluation ([#1575])
- **layer**: Fixed `Layer::on_layer` not being called for `Box`ed
  `Layer`s, which broke  per-layer filtering ([#1576])

### Added

- **filter**: Added `Targets::iter`, returning an iterator over the set
  of target-level pairs enabled by a `Targets` filter ([#1574])
- **filter**:  Added `IntoIterator` implementations for `Targets` and
  `&Targets` ([#1574])

Thanks to new contributor @connec for contributing to this release!

[#1580]: #1580
[#1581]: #1581
[#1575]: #1575
[#1576]: #1576
[#1574]: #1574
hawkw added a commit that referenced this pull request Sep 20, 2021
# 0.2.24 (September 19, 2021)

This release contains a number of bug fixes, including a fix for
`tracing-subscriber` failing to compile on the minimum supported Rust
version of 1.42.0. It also adds `IntoIterator` implementations for the
`Targets` type.

### Fixed

- Fixed compilation on Rust 1.42.0 ([#1580], [#1581])
- **registry**: Ensure per-layer filter `enabled` state is cleared when
  a global filter short-circuits filter evaluation ([#1575])
- **layer**: Fixed `Layer::on_layer` not being called for `Box`ed
  `Layer`s, which broke  per-layer filtering ([#1576])

### Added

- **filter**: Added `Targets::iter`, returning an iterator over the set
  of target-level pairs enabled by a `Targets` filter ([#1574])
- **filter**:  Added `IntoIterator` implementations for `Targets` and
  `&Targets` ([#1574])

Thanks to new contributor @connec for contributing to this release!

[#1580]: #1580
[#1581]: #1581
[#1575]: #1575
[#1576]: #1576
[#1574]: #1574
kaffarell pushed a commit to kaffarell/tracing that referenced this pull request May 22, 2024
# 0.2.24 (September 19, 2021)

This release contains a number of bug fixes, including a fix for
`tracing-subscriber` failing to compile on the minimum supported Rust
version of 1.42.0. It also adds `IntoIterator` implementations for the
`Targets` type.

### Fixed

- Fixed compilation on Rust 1.42.0 ([tokio-rs#1580], [tokio-rs#1581])
- **registry**: Ensure per-layer filter `enabled` state is cleared when
  a global filter short-circuits filter evaluation ([tokio-rs#1575])
- **layer**: Fixed `Layer::on_layer` not being called for `Box`ed
  `Layer`s, which broke  per-layer filtering ([tokio-rs#1576])

### Added

- **filter**: Added `Targets::iter`, returning an iterator over the set
  of target-level pairs enabled by a `Targets` filter ([tokio-rs#1574])
- **filter**:  Added `IntoIterator` implementations for `Targets` and
  `&Targets` ([tokio-rs#1574])

Thanks to new contributor @connec for contributing to this release!

[tokio-rs#1580]: tokio-rs#1580
[tokio-rs#1581]: tokio-rs#1581
[tokio-rs#1575]: tokio-rs#1575
[tokio-rs#1576]: tokio-rs#1576
[tokio-rs#1574]: tokio-rs#1574
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