Skip to content

Commit

Permalink
Replace acid_io by core2 (#40)
Browse files Browse the repository at this point in the history
Hello 👋 

[This advisory](GHSA-x4mq-m75f-mx8m) has
been bothering me since a while.
The origin of it is
[`acid_io`](https://github.com/dataphract/acid_io/blob/v0.1.0/Cargo.toml#L28),
where the [issue has been
fixed](dataphract/acid_io#21), but no release
has been publish 😞 (since 3 years!)

So, after reading this
[discussion/issue](rust-lang/rust#48331), I
decided to replace `acid_io` for
[`core2`](https://crates.io/crates/core2) (which seems quite used, even
if the last release was 2 years ago).

The changes was trivial as `acid_io` and `core2::io` have the same API
as `std::io`. But, while trying to test those changes, the CI failed
(which was also the case [`last
week`](https://github.com/dequbed/rsasl/actions/runs/8870496836)). So I
started to fix the CI, and made changes to make the CI pass.

I also added a `dependabot.yaml`, PR will be created monthly to update
the dependencies in the `Cargo.toml` and `ci.yml`.

I formatted the `README.md` and `Cargo.toml`.

I had to bump MSRV to 1.65.

I bumped the dependencies to their latest versions, and pushed the
`Cargo.lock`, see
[`why`](https://doc.rust-lang.org/cargo/faq.html#why-have-cargolock-in-version-control).

And I ran `cargo clippy --fix` and `cargo fmt`, with not much
modification from myself.



I just finished to write the description of this PR and realize that
someone was working on #36, oops
  • Loading branch information
dequbed authored Aug 10, 2024
2 parents c52959d + 3706a6b commit 299114f
Show file tree
Hide file tree
Showing 67 changed files with 2,336 additions and 381 deletions.
72 changes: 72 additions & 0 deletions .config/spell.dic
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
1000
ABNF
authcid
authid
authzid
bufs
dtolnay
GSSAPI
lifecycle
linkme
Mechname
miri
OAUTHBEARER
repr
rsasl
rustc
sasl
saslprep
SECURID
stringprep
testutils
thiserror
XOAUTH2
ZST
struct
TLS
CHANGELOG
md
README
queryable
config
base64
storable
pluggable
SSO
Kerberos
OpenID
unprotect
unprotects
XMPP
SMTP
IMAP
gsasl
steps
bugfixes
OAuth
structs
impl
IRCv3
semver
KERBEROS_V5
IdP
provide_any
NTLM
DIGEST_MD5
FFI
CRAM_MD5
changelog
implementor
implementors
IPsec
flavours
OPENID20
dtolnay's
SAML20
msrv
behaviour
behaviours
unencrypted
IANA
enum
unprotects
21 changes: 21 additions & 0 deletions .config/spellcheck.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
dev_comments = false
skip_readme = false

[hunspell]
lang = "en_US"
search_dirs = ["."]
skip_os_lookups = false
use_builtin = true
tokenization_splitchars = "\",;:.!?#(){}[]|/_-‒'`&@§¶…"
extra_dictionaries = ["spell.dic"]

[hunspell.quirks]
transform_regex = []
allow_concatenation = false
allow_dashes = false
allow_emojis = true

[nlprules]

[reflow]
max_line_length = 80
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: monthly
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
111 changes: 61 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,62 @@ on:
branches:
- development

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: full
rust_min: 1.65.0

jobs:
rustfmt:
name: rustfmt / stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: cargo fmt
run: cargo fmt --all -- --check
with:
components: rustfmt
- run: cargo fmt --all -- --check

clippy:
name: clippy / stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install required packages (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgssapi-krb5-2 libkrb5-dev
- run: cargo clippy --all-features --all-targets --tests -- -Dwarnings
- if: ${{ runner.os == 'Linux' }}
run: sudo apt update && sudo apt install -y libclang-dev libgssapi-krb5-2 libkrb5-dev
- run: cargo clippy --all-features --all-targets --tests

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- if: ${{ runner.os == 'Linux' }}
run: sudo apt update && sudo apt install -y libclang-dev libgssapi-krb5-2 libkrb5-dev
- run: cargo doc --workspace --no-deps --all-features --document-private-items
env:
RUSTFLAGS: --cfg docsrs -Dwarnings
RUSTDOCFLAGS: --cfg docsrs -Dwarnings

check:
name: check / stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Setup dependency cache
uses: Swatinem/rust-cache@v2
- name: install cargo-hack
run: cargo install cargo-hack
- name: Install required packages (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgssapi-krb5-2 libkrb5-dev
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-hack
- if: ${{ runner.os == 'Linux' }}
run: sudo apt update && sudo apt install -y libclang-dev libgssapi-krb5-2 libkrb5-dev
- run: cargo hack check --each-feature --features=std --skip=testutils

test:
name: test / ${{matrix.rust}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -58,57 +70,56 @@ jobs:
include:
- rust: nightly
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- name: Install required packages (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgssapi-krb5-2 libkrb5-dev
- if: ${{ runner.os == 'Linux' }}
run: sudo apt update && sudo apt install -y libclang-dev libgssapi-krb5-2 libkrb5-dev
- run: cargo test --all
env:
RUSTFLAGS: ${{matrix.rustflags}} ${{env.RUSTFLAGS}}

miri:
name: miri / stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@miri
- name: Install required packages (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgssapi-krb5-2 libkrb5-dev
- if: ${{ runner.os == 'Linux' }}
run: sudo apt update && sudo apt install -y libclang-dev libgssapi-krb5-2 libkrb5-dev
- run: cargo miri test --all --all-features
env:
MIRIFLAGS: -Zmiri-strict-provenance

msrv:
name: Rust 1.61.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.61.0
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_min }}
components: rust-src
- name: Install required packages (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgssapi-krb5-2 libkrb5-dev
- if: ${{ runner.os == 'Linux' }}
run: sudo apt update && sudo apt install -y libclang-dev libgssapi-krb5-2 libkrb5-dev
- run: cargo check --all-features

minimal-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: taiki-e/install-action@cargo-minimal-versions
- uses: taiki-e/install-action@cargo-hack
- if: ${{ runner.os == 'Linux' }}
run: sudo apt update && sudo apt install -y libclang-dev libgssapi-krb5-2 libkrb5-dev
- run: cargo minimal-versions --direct --ignore-private check

spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.61.0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Install required packages (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgssapi-krb5-2 libkrb5-dev
- name: Check
run: |
cargo +nightly update -Z minimal-versions
cargo +1.61 check --workspace --all-targets --all-features
cargo +1.61 test --workspace --all-targets --all-features
env:
RUSTFLAGS: -Dwarnings
toolchain: ${{ env.rust_min }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-spellcheck
- run: cargo spellcheck --code 1
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
target/
Cargo.lock
tags
/.idea/
TODO.md
Expand Down
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"cSpell.customDictionaries": {
"project-words": {
"name": "words",
"path": "${workspaceRoot}/.config/spell.dic",
"description": "Words used",
"addWords": true
},
"custom": true,
"internal-terms": false
}
}
Loading

0 comments on commit 299114f

Please sign in to comment.