-
Notifications
You must be signed in to change notification settings - Fork 533
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
Split clock
feature into clock
and now
#1343
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## 0.4.x #1343 +/- ##
=======================================
Coverage 91.61% 91.61%
=======================================
Files 38 38
Lines 17482 17489 +7
=======================================
+ Hits 16016 16023 +7
Misses 1466 1466
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
One workflow run appears to be failing on a hashbrown dependency which doesn't make sense. I'll dig into it. EDIT: it looks like the MSRV test is failing on other PRs as well. |
mmastrac
force-pushed
the
split_clock_feature
branch
from
November 7, 2023 22:17
83ada6e
to
da4106c
Compare
djc
approved these changes
Nov 8, 2023
Thanks! |
This was referenced Jan 24, 2024
edmorley
added a commit
to edmorley/opentelemetry-rust
that referenced
this pull request
Feb 23, 2024
In open-telemetry#1192, `chrono` was added as a dependency of the `opentelemetry-stdout` crate in order to support outputting timestamps in human readable format. In that PR, all Chrono features were disabled apart from the `clock` feature. However, since that change landed, `chrono` has added support for an even finer-grained feature named `now`, which is a subset of the `clock` feature which excludes timezone support, and so avoids pulling in many timezone related crates. `opentelemetry-stdout` only uses chrono's UTC features, so we can switch from using the `clock` feature to using `now` instead. After this change, the following transitive dependencies are no longer pulled in: - `android-tzdata` - `android_system_properties` - `cc` - `core-foundation-sys` - `iana-time-zone` - `iana-time-zone-haiku` - `windows-core` - `windows-targets` - `windows_aarch64_gnullvm` - `windows_aarch64_msvc` - `windows_i686_gnu` - `windows_i686_msvc` - `windows_x86_64_gnu` - `windows_x86_64_gnullvm` - `windows_x86_64_msvc` See: chronotope/chrono#1343 https://github.com/chronotope/chrono/blob/main/README.md#crate-features
edmorley
added a commit
to edmorley/opentelemetry-rust
that referenced
this pull request
Feb 23, 2024
In open-telemetry#1192, `chrono` was added as a dependency of the `opentelemetry-stdout` crate in order to support outputting timestamps in human readable format. In that PR, all Chrono features were disabled apart from the `clock` feature. However, since that change landed, `chrono` has added support for an even finer-grained feature named `now`, which is a subset of the `clock` feature which excludes timezone support, and so avoids pulling in many timezone related crates. `opentelemetry-stdout` only uses chrono's UTC features, so we can switch from using the `clock` feature to using `now` instead. After this change, the following transitive dependencies are no longer pulled in: - `android-tzdata` - `android_system_properties` - `cc` - `core-foundation-sys` - `iana-time-zone` - `iana-time-zone-haiku` - `windows-core` - `windows-targets` - `windows_aarch64_gnullvm` - `windows_aarch64_msvc` - `windows_i686_gnu` - `windows_i686_msvc` - `windows_x86_64_gnu` - `windows_x86_64_gnullvm` - `windows_x86_64_msvc` See: chronotope/chrono#1343 https://github.com/chronotope/chrono/blob/main/README.md#crate-features
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1341
Split a
now
feature off fromclock
that enablesUtc::now()
only. This function is useful on its own, and can be included without the small-but-measurable overhead of adding timezone support.For future compatibility, the feature
clock
implies the featurenow
.Build matrix
A
now
-only build run was added to the matrix, though this might be overkill.Tests
This PR updates a few tests to ensure that
--features now
and--feature clock
both continue work. I added a hiddencfg
to one test to ensure that it can pass in bothclock
andnow
feature sets.Tested the following builds successfully: