Building and Releasing
This page is for packaging slacker for a distribution so the build stays reproducible for the life of the target Slackware, regardless of what crates.io does later.
What actually breaks (and what doesn't)
Your own code never breaks on its own — Rust guarantees backwards compatibility,
so a newer rustc builds old code fine. The danger is one thing only: the open
version ranges in Cargo.toml (regex = "1", clap = "4", …) mean "take
whatever is newest." One day a newer crate either raises its minimum rustc or
changes its API, and a build that pulls "the newest" fails.
The fix is three things together:
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#161b22','primaryBorderColor':'#1f6feb','primaryTextColor':'#e6edf3','lineColor':'#6e7781','fontFamily':'monospace'}}}%%
flowchart LR
A["pin<br/>Cargo.lock committed"]:::blue --> B["vendor<br/>cargo vendor"]:::green
B --> C["declare<br/>rust-version"]:::grey
classDef grey fill:#0d1117,stroke:#6e7781,color:#8b949e;
classDef blue fill:#0d1117,stroke:#1f6feb,color:#e6edf3;
classDef green fill:#0d1117,stroke:#2ea043,color:#e6edf3;
The effective MSRV is 1.85.1
slacker's crate is edition 2021, but a transitive dependency — clap_lex
(pulled in by clap) — is written in edition 2024, which only stabilised in
Rust 1.85. So the effective MSRV is 1.85.1. Current Slackware ships 1.96,
which covers it. Find the exact number on your box with cargo msrv find
(requires rustup).
Freeze procedure
Run this when you finalise a release against the target Slackware's rustc.
- Target toolchain — confirm you're building with the rustc the target ships:
rustc --version - Build and test cleanly with your real
Cargo.toml:
For the freshest compatible set,cargo build --release && cargo testcargo updatethen re-test. - Declare the MSRV in
[package]:
This activates the MSRV-aware resolver, so a futurerust-version = "1.85.1"cargo updaterefuses a crate that exceeds the floor. - Lock and verify:
cargo build --release --locked git add -f Cargo.lock # slacker is a binary — commit the lock - Vendor the sources:
Save the printed block intocargo vendor vendor/.cargo/config.toml:[source.crates-io] replace-with = "vendored-sources" [source.vendored-sources] directory = "vendor" - Confirm it builds offline:
cargo build --release --offline --locked - Package two tarballs tied to the git tag: the source (+
Cargo.lock+.cargo/config.toml) and thevendor/directory. - SlackBuild unpacks both side by side and builds with no network:
cargo build --release --offline --locked
Tips and pitfalls
- Don't vendor OpenSSL with its
vendoredfeature — link the system OpenSSL so Slackware's security updates reach slacker automatically. - The danger is one-way: only newer crates threaten you, never a newer rustc. Lock + vendor → builds with the same or newer toolchain indefinitely.
- Unfreezing is deliberate:
cargo update→cargo vendoragain → re-test → bump slacker's version. - One snapshot per release: tie
Cargo.lockandvendor/to each git tag. - The frozen
Cargo.tomlyou ship is your own, on the target's rustc — never aCargo.tomltweaked for an older rustc.
In one line
Find the minimum rustc with rustup + cargo msrv, declare it in
rust-version, commit Cargo.lock, and distribute vendored dependencies — and
slacker builds reproducibly for as long as the target Slackware lives.
slacker
Getting started
Using slacker
- Commands
- Common Workflows
- Repositories and Priority
- Package History
- Dependencies
- Templates
- Blacklist
Trust & safety
Reference
For contributors
slacker — slackpkg + slackpkg+ in one · Apache-2.0 · by Ioannis Anagnostakis (rizitis) · beta / WIP, for Slackware64-current