From b28132b7fb7c71e0cc4acc801b5e91e5e769ad47 Mon Sep 17 00:00:00 2001 From: SteveLauC Date: Sat, 7 Oct 2023 09:38:09 +0800 Subject: [PATCH] chore: use towncrier for CHANGELOG (#2149) --- CHANGELOG.md | 70 +-------------------------------------- CONTRIBUTING.md | 27 ++++++++++++--- RELEASE_PROCEDURE.md | 3 ++ changelog/.keep | 5 +++ changelog/1946.fixed.md | 1 + changelog/1959.added.md | 4 +++ changelog/2074.added.md | 2 ++ changelog/2103.added.md | 1 + changelog/2119.changed.md | 1 + changelog/2119.fixed.md | 1 + changelog/2134.changed.md | 2 ++ changelog/2136.changed.md | 2 ++ changelog/2137.changed.md | 8 +++++ changelog/2139.changed.md | 1 + changelog/2141.fixed.md | 1 + changelog/2142.added.md | 1 + changelog/2144.changed.md | 1 + changelog/2152.added.md | 1 + release.toml | 4 --- towncrier.toml | 27 +++++++++++++++ 20 files changed, 86 insertions(+), 77 deletions(-) create mode 100644 changelog/.keep create mode 100644 changelog/1946.fixed.md create mode 100644 changelog/1959.added.md create mode 100644 changelog/2074.added.md create mode 100644 changelog/2103.added.md create mode 100644 changelog/2119.changed.md create mode 100644 changelog/2119.fixed.md create mode 100644 changelog/2134.changed.md create mode 100644 changelog/2136.changed.md create mode 100644 changelog/2137.changed.md create mode 100644 changelog/2139.changed.md create mode 100644 changelog/2141.fixed.md create mode 100644 changelog/2142.added.md create mode 100644 changelog/2144.changed.md create mode 100644 changelog/2152.added.md delete mode 100644 release.toml create mode 100644 towncrier.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index f085067a07..934d611e84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,75 +1,7 @@ -# Change Log - All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). -## [Unreleased] - ReleaseDate - -### Fixed -- Fix `SigSet` incorrect implementation of `Eq`, `PartialEq` and `Hash` - ([#1946](https://github.com/nix-rust/nix/pull/1946)) - -- Fixed the function signature of `recvmmsg`, potentially causing UB - ([#2119](https://github.com/nix-rust/nix/issues/2119)) -### Added - -- Added `impl From for SigSet`. - ([#1959](https://github.com/nix-rust/nix/pull/1959)) - -- Added `impl std::ops::BitOr for SigSet`. - ([#1959](https://github.com/nix-rust/nix/pull/1959)) - -- Added `impl std::ops::BitOr for Signal`. - ([#1959](https://github.com/nix-rust/nix/pull/1959)) - -- Added `impl std::ops::BitOr for SigSet` - ([#1959](https://github.com/nix-rust/nix/pull/1959)) - -- Fix `SignalFd::set_mask`. In 0.27.0 it would actually close the file - descriptor. - ([#2141](https://github.com/nix-rust/nix/pull/2141)) - -- Added `Icmp` and `IcmpV6` to `SockProtocol`. - (#[2103](https://github.com/nix-rust/nix/pull/2103)) - -- Added `F_GETPATH` FcntlFlags entry on Apple/NetBSD/DragonflyBSD for `::nix::fcntl`. - ([#2142](https://github.com/nix-rust/nix/pull/2142)) - -- Added `Ipv6HopLimit` to `::nix::sys::socket::ControlMessage` for Linux, - MacOS, FreeBSD, DragonflyBSD, Android, iOS and Haiku. - ([#2074](https://github.com/nix-rust/nix/pull/2074)) - -- Added `F_KINFO` FcntlFlags entry on FreeBSD for `::nix::fcntl`. - ([#2152](https://github.com/nix-rust/nix/pull/2152)) - -### Changed - -- The MSRV is now 1.69 - ([#2144](https://github.com/nix-rust/nix/pull/2144)) - -- The following APIs now take an implementation of `AsFd` rather than a - `RawFd`: - - - `unistd::tcgetpgrp` - - `unistd::tcsetpgrp` - - `unistd::fpathconf` - - `unistd::ttyname` - - `unistd::getpeereid` - - ([#2137](https://github.com/nix-rust/nix/pull/2137)) - -- Changed `openat()` and `Dir::openat()`, now take optional `dirfd`s - ([#2139](https://github.com/nix-rust/nix/pull/2139)) - -- `PollFd::new` now takes a `BorrowedFd` argument, with relaxed lifetime - requirements relative to the previous version. - ([#2134](https://github.com/nix-rust/nix/pull/2134)) - -- `FdSet::{insert, remove, contains}` now take `BorrowedFd` arguments, and have - relaxed lifetime requirements relative to 0.27.1. - ([#2136](https://github.com/nix-rust/nix/pull/2136)) - -- Simplified the function signatures of `recvmmsg` and `sendmmsg` +# Change Log ## [0.27.1] - 2023-08-28 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 70e7cd7f95..a45fc9905c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,11 +61,30 @@ pull' model described there. Please make pull requests against the `master` branch. If you change the API by way of adding, removing or changing something or if -you fix a bug, please add an appropriate note to the [change log][cl]. We -follow the conventions of [Keep A CHANGELOG][kacl]. +you fix a bug, please add an appropriate note, every note should be a new markdown +file under the [changelog directory][cl] stating the change made by your pull request, +the filename should be in the following foramt: -[cl]: https://github.com/nix-rust/nix/blob/master/CHANGELOG.md -[kacl]: https://github.com/olivierlacan/keep-a-changelog/tree/18adb5f5be7a898d046f6a4acb93e39dcf40c4ad +``` +..md +``` + +These are 4 `TYPE`s available: + +1. `added` +2. `changed` +3. `fixed` +4. `removed` + +Let's say you have added a new API to nix, then a change log like this should +be added (assume it is PR #0) + +```md +# file: 0.added.md +Added a new API xxx +``` + +[cl]: https://github.com/nix-rust/nix/tree/master/changelog [pr-docs]: https://help.github.com/articles/using-pull-requests/ ## Testing diff --git a/RELEASE_PROCEDURE.md b/RELEASE_PROCEDURE.md index 9c68f78b18..1ffd21aa84 100644 --- a/RELEASE_PROCEDURE.md +++ b/RELEASE_PROCEDURE.md @@ -13,6 +13,9 @@ The release is prepared as follows: - Ask for a new libc version if, necessary. It usually is. Then update the dependency in Cargo.toml accordingly. +- Update the version number in `Cargo.toml` +- Generate `CHANGELOG.md` for this release by + `towncrier build --version= --yes` - Confirm that everything's ready for a release by running `cargo release ` - Create the release with `cargo release -x ` diff --git a/changelog/.keep b/changelog/.keep new file mode 100644 index 0000000000..f36597d920 --- /dev/null +++ b/changelog/.keep @@ -0,0 +1,5 @@ +Do not remove this file. This is used to keep the `changelog` dir around after +generating new changelog file. + +Without this, `towncrier` would remove the changelog files as well as the +directory if it is empty. diff --git a/changelog/1946.fixed.md b/changelog/1946.fixed.md new file mode 100644 index 0000000000..7c96cde003 --- /dev/null +++ b/changelog/1946.fixed.md @@ -0,0 +1 @@ +Fix `SigSet` incorrect implementation of `Eq`, `PartialEq` and `Hash` diff --git a/changelog/1959.added.md b/changelog/1959.added.md new file mode 100644 index 0000000000..c7dfb49465 --- /dev/null +++ b/changelog/1959.added.md @@ -0,0 +1,4 @@ +- Added `impl From for SigSet`. +- Added `impl std::ops::BitOr for SigSet`. +- Added `impl std::ops::BitOr for Signal`. +- Added `impl std::ops::BitOr for SigSet` \ No newline at end of file diff --git a/changelog/2074.added.md b/changelog/2074.added.md new file mode 100644 index 0000000000..e11a09c47e --- /dev/null +++ b/changelog/2074.added.md @@ -0,0 +1,2 @@ +Added `Ipv6HopLimit` to `::nix::sys::socket::ControlMessage` for Linux, +MacOS, FreeBSD, DragonflyBSD, Android, iOS and Haiku. diff --git a/changelog/2103.added.md b/changelog/2103.added.md new file mode 100644 index 0000000000..dc39d75258 --- /dev/null +++ b/changelog/2103.added.md @@ -0,0 +1 @@ +Added `Icmp` and `IcmpV6` to `SockProtocol` diff --git a/changelog/2119.changed.md b/changelog/2119.changed.md new file mode 100644 index 0000000000..88b88fa595 --- /dev/null +++ b/changelog/2119.changed.md @@ -0,0 +1 @@ +Simplified the function signatures of `recvmmsg` and `sendmmsg` diff --git a/changelog/2119.fixed.md b/changelog/2119.fixed.md new file mode 100644 index 0000000000..d0d665fc5c --- /dev/null +++ b/changelog/2119.fixed.md @@ -0,0 +1 @@ +Fixed the function signature of `recvmmsg`, potentially causing UB diff --git a/changelog/2134.changed.md b/changelog/2134.changed.md new file mode 100644 index 0000000000..d884c596c6 --- /dev/null +++ b/changelog/2134.changed.md @@ -0,0 +1,2 @@ +`PollFd::new` now takes a `BorrowedFd` argument, with relaxed lifetime + requirements relative to the previous version. diff --git a/changelog/2136.changed.md b/changelog/2136.changed.md new file mode 100644 index 0000000000..991a6c5d03 --- /dev/null +++ b/changelog/2136.changed.md @@ -0,0 +1,2 @@ +`FdSet::{insert, remove, contains}` now take `BorrowedFd` arguments, and have +relaxed lifetime requirements relative to 0.27.1. diff --git a/changelog/2137.changed.md b/changelog/2137.changed.md new file mode 100644 index 0000000000..d5df4836c9 --- /dev/null +++ b/changelog/2137.changed.md @@ -0,0 +1,8 @@ +The following APIs now take an implementation of `AsFd` rather than a + `RawFd`: + + - `unistd::tcgetpgrp` + - `unistd::tcsetpgrp` + - `unistd::fpathconf` + - `unistd::ttyname` + - `unistd::getpeereid` diff --git a/changelog/2139.changed.md b/changelog/2139.changed.md new file mode 100644 index 0000000000..e6df6a0000 --- /dev/null +++ b/changelog/2139.changed.md @@ -0,0 +1 @@ +Changed `openat()` and `Dir::openat()`, now take optional `dirfd`s diff --git a/changelog/2141.fixed.md b/changelog/2141.fixed.md new file mode 100644 index 0000000000..d14401b93c --- /dev/null +++ b/changelog/2141.fixed.md @@ -0,0 +1 @@ +Fix `SignalFd::set_mask`. In 0.27.0 it would actually close the file descriptor. diff --git a/changelog/2142.added.md b/changelog/2142.added.md new file mode 100644 index 0000000000..077a800927 --- /dev/null +++ b/changelog/2142.added.md @@ -0,0 +1 @@ +Added `F_GETPATH` FcntlFlags entry on Apple/NetBSD/DragonflyBSD for `::nix::fcntl`. diff --git a/changelog/2144.changed.md b/changelog/2144.changed.md new file mode 100644 index 0000000000..250c9fde9d --- /dev/null +++ b/changelog/2144.changed.md @@ -0,0 +1 @@ +The MSRV is now 1.69 diff --git a/changelog/2152.added.md b/changelog/2152.added.md new file mode 100644 index 0000000000..3b39063a2b --- /dev/null +++ b/changelog/2152.added.md @@ -0,0 +1 @@ +Added `F_KINFO` FcntlFlags entry on FreeBSD for `::nix::fcntl`. diff --git a/release.toml b/release.toml deleted file mode 100644 index 23488fbfa5..0000000000 --- a/release.toml +++ /dev/null @@ -1,4 +0,0 @@ -pre-release-replacements = [ - { file="CHANGELOG.md", search="Unreleased", replace="{{version}}" }, - { file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}" } -] diff --git a/towncrier.toml b/towncrier.toml new file mode 100644 index 0000000000..d324433ed5 --- /dev/null +++ b/towncrier.toml @@ -0,0 +1,27 @@ +# towncrier configuration document: +# https://towncrier.readthedocs.io/en/stable/configuration.html + +[tool.towncrier] +# Read news fragments from this directory +directory = "changelog" +# Concatenate fragments, and prepend to this file +filename = "CHANGELOG.md" +title_format = "## [{version}] - {project_date}" +# Used to disable towncrier's "=====" title header +underlines = ["", "", ""] +# Wrap news fragments to a line length of 79 +wrap = true +# Every news fragement under the `changelog` directory is named "..md", +# this `id` field, is called issue/ticket number in towncrier's term +# `issue_format` controls how this will be rendered in the final CHANGELOG +# We use this for Pull Request even though it is called "issue" +issue_format = "[#{issue}](https://github.com/nix-rust/nix/pull/{issue})" +# Ask towncrier to add new notes after this +start_string = "# Change Log\n" + +# nix's change log typs (in alphabetical order) +# These types will be capitalized by default. +[tool.towncrier.fragment.added] +[tool.towncrier.fragment.changed] +[tool.towncrier.fragment.fixed] +[tool.towncrier.fragment.removed]