Skip to content

Bump to v1.1.0: rust-samp v3, universal binary and general cleanup#9

Merged
NullSablex merged 2 commits into
masterfrom
upgrade
May 18, 2026
Merged

Bump to v1.1.0: rust-samp v3, universal binary and general cleanup#9
NullSablex merged 2 commits into
masterfrom
upgrade

Conversation

@NullSablex

Copy link
Copy Markdown
Owner

Migrate to rust-samp v3.0.0 (git tag) and produce a single .so/.dll that loads on SA-MP and on Open Multiplayer — as a native component or in legacy mode. The unified on_tick removes the need for SetTimer + mysql_tick() on open.mp. The Pawn API stays compatible (nothing removed or renamed; mysql_tick is kept only for backwards compatibility).

Plugin

  • Migrated to enable_tick() / on_tick(TickContext); added on_component_free to help correlate incidents across neighbouring components
  • Strict typing: 36 as casts replaced by explicit TryFrom/From (saturate on overflow, reject negative for u16/u32/usize)
  • mysql_format refactored into parse_format / collect_format_values / render_format / truncate_to_buffer (UTF-8-safe truncation + warning, no more abort)
  • mysql_options_set_int rejects out-of-range port/timeout instead of silently wrapping
  • parse_variadic_params logs a warning for unknown format chars
  • Logger: I/O failure on logs/mysql.log is reported once via samp::log::error! and then suppressed
  • ORM raw natives (select/update/insert/delete/save) deduplicated via OrmOp enum + run_orm_op helper (-120 lines, same error semantics)
  • Pawn natives return bare T where infallible (no AmxResult wrapper)
  • Named constants: MAX_ORM_STRING_LEN, PARALLEL_KEY_THRESHOLD
  • 113 unit tests (up from 93)

Build & tooling

  • Scripts replaced: scripts/build-linux.sh + scripts/build-windows.sh (was scripts/build.sh); Windows target moved to MSVC via cargo-xwin (required for the Open Multiplayer native ABI)
  • build.rs generates include/mysql_samp.inc from include/mysql_samp.inc.in, injecting CARGO_PKG_VERSION; runs on every build (no rerun-if-changed) so a version bump propagates without touch or cargo clean
  • Exposes #define MYSQL_SAMP_VERSION in the .inc
  • Removed: samp-only feature and .cargo/config.toml (both unused)
  • Cargo.toml: samp pinned to git tag v3.0.0; log dropped as direct dep

CI (.github)

  • Per-job explicit permissions (contents:read at top level, opt-in where needed)
  • Actions bumped to the latest major: checkout v6, setup-python v6, cache v5, upload-artifact v7, action-gh-release v3, audit-check v2
  • rust.yml: new fmt (cargo fmt --check), audit (rustsec/audit-check) and coverage (cargo llvm-cov) jobs
  • release.yml: tag-vs-Cargo.toml sanity check; automatic injection of the relevant CHANGELOG section into the release body; raw artifacts (.so/.dll/.inc) instead of zipped folders
  • docs.yml: strict build (mkdocs build --strict) separated from deploy

Documentation

  • Everything migrated to en-US (CLAUDE.md and CHECKLIST.md are explicit exceptions: pt-BR and en-US respectively)
  • Files renamed: installation.md, connection.md, errors.md, security.md, migration.md, migration-changes.md, migration-examples.md, api-reference.md
  • mkdocs.yml with full MkDocs Material setup + site_url pointing to mysql-samp.nullsablex.com; docs/CNAME synced with origin/master
  • Factual corrections in the old docs: native count (was 51, actually 55), removed references to a nonexistent cache_next_row(), added an honest caveat about SSL options being accepted but no-op (TODO in src/connection.rs:67)
  • README rewritten in en-US, CHECKLIST.md synced with the .inc
  • CHANGELOG.md reorganised: current major (v1.x) at the root file + changelog/v0.x.md for history
  • docs/requirements.txt pinning mkdocs / material / pymdown-extensions

Cargo.toml: 1.0.0 → 1.1.0

Migrate to rust-samp v3.0.0 (git tag) and produce a single .so/.dll that
loads on SA-MP and on Open Multiplayer — as a native component or in
legacy mode. The unified on_tick removes the need for SetTimer +
mysql_tick() on open.mp. The Pawn API stays compatible (nothing removed
or renamed; mysql_tick is kept only for backwards compatibility).

Plugin
- Migrated to enable_tick() / on_tick(TickContext); added on_component_free
  to help correlate incidents across neighbouring components
- Strict typing: 36 `as` casts replaced by explicit TryFrom/From
  (saturate on overflow, reject negative for u16/u32/usize)
- mysql_format refactored into parse_format / collect_format_values /
  render_format / truncate_to_buffer (UTF-8-safe truncation + warning,
  no more abort)
- mysql_options_set_int rejects out-of-range port/timeout instead of
  silently wrapping
- parse_variadic_params logs a warning for unknown format chars
- Logger: I/O failure on logs/mysql.log is reported once via
  samp::log::error! and then suppressed
- ORM raw natives (select/update/insert/delete/save) deduplicated via
  OrmOp enum + run_orm_op helper (-120 lines, same error semantics)
- Pawn natives return bare T where infallible (no AmxResult wrapper)
- Named constants: MAX_ORM_STRING_LEN, PARALLEL_KEY_THRESHOLD
- 113 unit tests (up from 93)

Build & tooling
- Scripts replaced: scripts/build-linux.sh + scripts/build-windows.sh
  (was scripts/build.sh); Windows target moved to MSVC via cargo-xwin
  (required for the Open Multiplayer native ABI)
- build.rs generates include/mysql_samp.inc from
  include/mysql_samp.inc.in, injecting CARGO_PKG_VERSION; runs on every
  build (no rerun-if-changed) so a version bump propagates without
  `touch` or `cargo clean`
- Exposes #define MYSQL_SAMP_VERSION in the .inc
- Removed: samp-only feature and .cargo/config.toml (both unused)
- Cargo.toml: samp pinned to git tag v3.0.0; log dropped as direct dep

CI (.github)
- Per-job explicit permissions (contents:read at top level, opt-in
  where needed)
- Actions bumped to the latest major: checkout v6, setup-python v6,
  cache v5, upload-artifact v7, action-gh-release v3, audit-check v2
- rust.yml: new fmt (cargo fmt --check), audit (rustsec/audit-check)
  and coverage (cargo llvm-cov) jobs
- release.yml: tag-vs-Cargo.toml sanity check; automatic injection of
  the relevant CHANGELOG section into the release body; raw artifacts
  (.so/.dll/.inc) instead of zipped folders
- docs.yml: strict build (mkdocs build --strict) separated from deploy

Documentation
- Everything migrated to en-US (CLAUDE.md and CHECKLIST.md are explicit
  exceptions: pt-BR and en-US respectively)
- Files renamed: installation.md, connection.md, errors.md, security.md,
  migration.md, migration-changes.md, migration-examples.md,
  api-reference.md
- mkdocs.yml with full MkDocs Material setup + site_url pointing to
  mysql-samp.nullsablex.com; docs/CNAME synced with origin/master
- Factual corrections in the old docs: native count (was 51, actually
  55), removed references to a nonexistent cache_next_row(), added an
  honest caveat about SSL options being accepted but no-op (TODO in
  src/connection.rs:67)
- README rewritten in en-US, CHECKLIST.md synced with the .inc
- CHANGELOG.md reorganised: current major (v1.x) at the root file +
  changelog/v0.x.md for history
- docs/requirements.txt pinning mkdocs / material / pymdown-extensions

Cargo.toml: 1.0.0 → 1.1.0
include/mysql_samp.inc.in
- Replace the em-dash (U+2014) with a plain ASCII hyphen in the header.
  Pawn compilers read the .inc as Windows-1252 / ANSI; a UTF-8 em-dash
  rendered as the mojibake "â€"" sequence in editors that don't decode
  the file as UTF-8.
- Drop the "Auto-generated by build.rs / edit the .inc.in" note from the
  public header. That guidance is only useful to contributors who clone
  the repo and already see it in CLAUDE.md and in build.rs itself; it is
  noise for gamemode authors who download the .inc from a release.
- Rephrase the tagline to "MySQL plugin for SA-MP and Open Multiplayer"
  (more informative than the previous "written in Rust"; implementation
  details belong in the README, not in the public header).

src/callback.rs
- Collapse the two nested `if amx.push(*v).is_err()` blocks inside the
  match for `('d' | 'i', ...)` and `('f', ...)` into match guards.
  Required by clippy::collapsible_match (denied by `-D warnings`) since
  clippy 1.95. Behavior is preserved: the push runs in both branches
  (it is part of the guard expression), and on failure the new arm body
  still sets push_ok = false and breaks. The ('s', ...) arm is left as
  a nested match because its two branches do different work.

include/mysql_samp.inc is regenerated automatically by build.rs from the
template and committed in lockstep.
@NullSablex NullSablex merged commit b000594 into master May 18, 2026
9 checks passed
@NullSablex NullSablex deleted the upgrade branch May 18, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant