Don't assume localtime() result is non-nil#280
Merged
tomerd merged 3 commits intoapple:mainfrom Nov 17, 2023
Merged
Conversation
tomerd
approved these changes
Nov 16, 2023
Member
|
fixing CI in #281 |
Member
|
@swift-server-bot test this please |
cgrindel-self-hosted-renovate bot
referenced
this pull request
in cgrindel/rules_swift_package_manager
Jan 22, 2024
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [apple/swift-log](https://togithub.com/apple/swift-log) | patch | `from: "1.5.3"` -> `from: "1.5.4"` | --- ### Release Notes <details> <summary>apple/swift-log (apple/swift-log)</summary> ### [`v1.5.4`](https://togithub.com/apple/swift-log/releases/tag/1.5.4) [Compare Source](https://togithub.com/apple/swift-log/compare/1.5.3...1.5.4) ##### What's Changed ##### Cleanups & minor compatibility improvements - Don't assume localtime() result is non-nil by [@​gwynne](https://togithub.com/gwynne) in [https://github.com/apple/swift-log/pull/280](https://togithub.com/apple/swift-log/pull/280) - Changes to build with Musl. by [@​al45tair](https://togithub.com/al45tair) in [https://github.com/apple/swift-log/pull/283](https://togithub.com/apple/swift-log/pull/283) ##### Non code changes - Add CocoaLumberjack to list of logging backends by [@​ffried](https://togithub.com/ffried) in [https://github.com/apple/swift-log/pull/276](https://togithub.com/apple/swift-log/pull/276) - update CI script by [@​tomerd](https://togithub.com/tomerd) in [https://github.com/apple/swift-log/pull/281](https://togithub.com/apple/swift-log/pull/281) - Update README.md by [@​0xTim](https://togithub.com/0xTim) in [https://github.com/apple/swift-log/pull/279](https://togithub.com/apple/swift-log/pull/279) ##### New Contributors - [@​ffried](https://togithub.com/ffried) made their first contribution in [https://github.com/apple/swift-log/pull/276](https://togithub.com/apple/swift-log/pull/276) - [@​0xTim](https://togithub.com/0xTim) made their first contribution in [https://github.com/apple/swift-log/pull/279](https://togithub.com/apple/swift-log/pull/279) - [@​al45tair](https://togithub.com/al45tair) made their first contribution in [https://github.com/apple/swift-log/pull/283](https://togithub.com/apple/swift-log/pull/283) **Full Changelog**: apple/swift-log@1.5.3...1.5.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDAuMCIsInVwZGF0ZWRJblZlciI6IjM2LjEwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
This file contains hidden or 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
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.
Check for
localtime(3)returning anilresult.Motivation:
This avoids calling
strftime(3)with aNULLpointer in the odd case thatlocaltime(3)fails. It also has the useful, if incidental, side effect of fixing buildingswift-logon Arch Linux (see vapor/toolbox#430 for more info).Modifications:
Added a
guardwhich returns a generic failure string iflocaltime(3)returnsnil.Result:
There should be no visible impact on virtually any users, seeing as how this has not been previously encountered, and the use of
swift-logon at least one unofficial (but apparently commonly used) platform will be fixed.