Skip to content

Commit

Permalink
Make mysql use the native rust tls stack by default (tgstation#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
optimumtact authored and itsmeow committed Dec 28, 2023
1 parent 613d8d5 commit db877ce
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 16 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ jobs:
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: build
args: --target i686-pc-windows-msvc --release --all-features
- name: Upload artifact (all features)
uses: actions/upload-artifact@v1
command: clippy
args: --target i686-pc-windows-msvc --features all --locked -- -D warnings

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
name: full_rust_g.dll
path: target/i686-pc-windows-msvc/release/rust_g.dll
Expand All @@ -31,9 +32,9 @@ jobs:
with:
toolchain: stable
command: build
args: --target i686-pc-windows-msvc --release
- name: Upload artifact (release)
uses: actions/upload-artifact@v1
args: --target i686-pc-windows-msvc --locked --release

- uses: actions/upload-artifact@v3
with:
name: rust_g.dll
path: target/i686-pc-windows-msvc/release/rust_g.dll
Expand All @@ -54,18 +55,29 @@ jobs:
with:
toolchain: stable
target: i686-unknown-linux-gnu
- name: Build (Debug)

- uses: Swatinem/rust-cache@v2

- name: Check (all features)
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: check
args: --target i686-unknown-linux-gnu --locked --features all

- name: Build (Debug) (all features)
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: build
args: --target i686-unknown-linux-gnu
- name: Run tests
args: --target i686-unknown-linux-gnu --locked --features all

- name: Run tests (all features)
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: test
args: --target i686-unknown-linux-gnu
args: --target i686-unknown-linux-gnu --locked --features all
env:
BYOND_BIN: /home/runner/BYOND/byond/bin
- name: Build (all features)
Expand All @@ -84,9 +96,9 @@ jobs:
with:
toolchain: stable
command: build
args: --target i686-unknown-linux-gnu --release
- name: Upload artifact (release)
uses: actions/upload-artifact@v1
args: --target i686-unknown-linux-gnu --locked --release

- uses: actions/upload-artifact@v3
with:
name: librust_g.so
path: target/i686-unknown-linux-gnu/release/librust_g.so
15 changes: 14 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 30 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ serde = { version = "1.0", optional = true, features = ["derive"] }
serde_json = { version = "1.0", optional = true }
lazy_static = { version = "1.4", optional = true }
once_cell = { version = "1.17", optional = true }
mysql = { version = "24.0", optional = true }
mysql = { version = "24.0", default_features = false, optional = true}
dashmap = { version = "5.4", optional = true }
zip = { version = "0.6", optional = true }
rand = { version = "0.8", optional = true }
Expand All @@ -69,12 +69,37 @@ default = [
"json",
"log",
"noise",
"rustls_tls",
"sql",
"time",
"toml",
"url",
]

all = [
"acreplace",
"cellularnoise",
"dmi",
"file",
"git",
"http",
"json",
"log",
"noise",
"rustls_tls",
"sql",
"time",
"toml",
"url",
"batchnoise",
"hash",
"pathfinder",
"redis_pubsub",
"redis_reliablequeue",
"unzip",
"worleynoise"
]

# default features
acreplace = ["aho-corasick"]
cellularnoise = ["rand", "rayon"]
Expand Down Expand Up @@ -108,6 +133,10 @@ redis_reliablequeue = ["flume", "redis", "serde", "serde_json"]
unzip = ["zip", "jobs"]
worleynoise = ["rand", "rayon"]

# Use the native tls stack for the mysql db
native_tls = ["mysql/default"]
rustls_tls = ["mysql/default-rustls"]

# internal feature-like things
jobs = ["flume"]

Expand Down

0 comments on commit db877ce

Please sign in to comment.