Skip to content

Commit cc68c4f

Browse files
committed
v2.2.2
revisions fix: boost url function and install function boost: url was improperly formed when using beta. install: needed to be updated to newer root/sudo methods Now supports custom destinations. Update qbt-nox-static.bash merge scripts script emulation Update changelog.md Update buildinfo-build-help.astro docs
1 parent a7986a6 commit cc68c4f

28 files changed

+1725
-526
lines changed

.github/copilot-instructions.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,104 @@
1+
# AI Coding Guide for This Repo
2+
3+
Purpose: Make AI contributions precise, minimal, and correct. Follow these rules strictly. Do not expand scope beyond the prompt.
4+
5+
## Bash scripting (applies to all repos)
6+
7+
Do
8+
- Use `#!/bin/bash` as the shebang for Bash scripts.
9+
- Use the `.bash` extension for Bash; use `.sh` only for POSIX-only scripts.
10+
- Prefer `$BASH_SOURCE` over `$0` for script path detection.
11+
- Use `printf '%s'` for plain strings and `printf '%b'` for escape sequences. Avoid `echo`.
12+
- Keep changes simple, modular, and scoped to the exact prompt.
13+
- Write readable code; add concise comments explaining intent and non-obvious logic.
14+
- Handle errors explicitly (per function is acceptable); return helpful, actionable messages.
15+
- Structure changes in small stages; keep functions focused.
16+
- Format using Google’s Shell Style Guide: https://google.github.io/styleguide/shellguide.html
17+
- For Bash references, consult: https://mywiki.wooledge.org and https://mywiki.wooledge.org/BashFAQ and include a source link when possible. Do not invent links.
18+
19+
Avoid
20+
- Global “set -euo pipefail”; prefer targeted checks and explicit error handling.
21+
- Uppercase variable names for general scripting (reserve UPPERCASE for Docker/env settings).
22+
- Clever one-liners that harm clarity.
23+
- Generalized or speculative changes not asked for in the prompt.
24+
- Over-engineering; keep it stable, concise, and C-like in mindset.
25+
26+
Scope and behavior
27+
- Only implement what the prompt requests.
28+
- Keep solutions minimal and modular; do not add placeholders or future-proofing unless required.
29+
- When giving Bash/shell answers, add a relevant wooledge link if helpful; never fabricate links.
30+
31+
## GitHub Workflows (all repos)
32+
33+
- In reusable workflows, any job that uses outputs from another job must declare that job in `needs` to avoid null outputs.
34+
- Do not use outdated Actions. Check for current recommended versions before editing.
35+
- The `gh` CLI cannot fetch the ID of a workflow run it just started via `gh run workflow`. List runs afterward and extract the ID.
36+
37+
## If repo name matches `*-musl-cross-make`
38+
39+
Toolchain specifics
40+
- Use both `-static` and `--static` to produce static toolchain binaries. Using only `-static` can miss POSIX threads.
41+
- When using `../config.mak`, always load options from both `../gcc-configure-options.md` and `../gcc-configure-options-recursive.md`.
42+
- The binutils gold linker is deprecated. Use `ld=default` and `--disable-gold`.
43+
44+
Fully static toolchains with musl
45+
- Do not use LTO: avoid `-flto` and `-fuse-linker-plugin`.
46+
- Do not add any LTO-related settings.
47+
- Only set linker options such as `LDFLAGS` at link time, not during library builds.
48+
- GNU libtool redefines `-static`; to ensure static linking, use `--static` or `-Wl,-static` (optionally with `-static`) in `LDFLAGS`.
49+
- For static OpenSSL: do not use `openssl -static` (it disables threads/PIE/PIC). For `-static-pie` with musl/Alpine, use the correct flags and approach.
50+
- Do not use glibc-only flags or glibcisms for musl toolchains.
51+
52+
## Debugging with QEMU
53+
54+
- Start the target under QEMU with gdbstub, then attach with gdb:
55+
- `qemu -g <port> <binary>` (e.g., `qemu -g 1234 ./qbt-nox-static`)
56+
- In another terminal: `gdb ./qbt-nox-static` and `target remote :1234`
57+
58+
## If repo name matches `*qbittorrent-nox-static`
59+
60+
`qi.bash` script goals
61+
- Simple installer that verifies installation and binaries.
62+
- Shebang must be `#!/bin/bash`.
63+
64+
OS detection
65+
- `source /etc/os-release`.
66+
- Supported: `ID=alpine`, `ID=debian`, or `ID_LIKE` contains `debian`. Otherwise exit with a clear reason.
67+
68+
Transfer tools
69+
- Prefer `curl` if present; use `wget` if present and `curl` is not; exit if neither is available.
70+
- Detect presence of `gh` CLI and use it when available, but it is not required.
71+
72+
Architecture detection
73+
- Alpine: `apk --print-arch`.
74+
- Debian-like: `dpkg --print-architecture`.
75+
- Architectures are the same across distros except `armhf`: Debian uses `armv7`, Alpine uses `armv6`.
76+
- If architecture is not valid/supported, exit with a reason.
77+
78+
Download function
79+
- Build the download URL from the detected architecture.
80+
- Create and store the download’s SHA-256 sum.
81+
82+
Attestation (optional)
83+
- When `gh` CLI is available and usable, verify downloaded binaries:
84+
- `gh attestation verify <INSTALL_PATH> --repo <REPO> 2> /dev/null`
85+
86+
Error handling
87+
- Provide a helper that checks command exit codes and exits with a concise, helpful message on failure.
88+
89+
Output formatting
90+
- Provide a print helper that supports:
91+
- `[INFO]` (blue), `[WARNING]` (yellow), `[ERROR]` (red), `[SUCCESS]` (green), `[FAILURE]` (magenta)
92+
- Use `printf '%s'` and `printf '%b'`; do not use `echo`.
93+
- Keep messages succinct. Be verbose only on errors to aid troubleshooting.
94+
95+
---
96+
97+
Meta for AI contributors
98+
- Be conservative: do only what the prompt requests. No broad refactors.
99+
- Prefer small, well-named functions and staged changes.
100+
- Preserve existing public behavior and style unless the prompt requires changes.
101+
- If something cannot be done with available context/tools, state why and propose the smallest viable alternative.
1102
# Bash Scripting - All repos
2103

3104
- use $BASH_SOURCE instead of $0
@@ -10,10 +111,16 @@
10111
- Always makes changes in stages, a modular approach.
11112
- use Google style guide for formatting of bash scripts - https://google.github.io/styleguide/shellguide.html
12113
- Always use `#!/bin/bash` as the shebang.
114+
- Always use the extensions `bash` for bash script and `sh` only for posix shell scripts
13115
- Use `printf '%s'` for printing strings and `printf '%b'` for escape sequences. **Avoid using `echo`.**
14116
- Comment code to explain changes and logic.
15117
- always prefer readability of code over complex one lines. Unless that foramt is promoted by the style guide.
16118
- For Bash/shell questions, consult [mywiki.wooledge.org](https://mywiki.wooledge.org) or [BashFAQ](https://mywiki.wooledge.org/BashFAQ) first. **Provide a source link when possible.**
119+
- Don't hallucinate <mywiki.wooledge.org> links in comments
120+
- think like a c developer not a javascript developer. stable, concise, elegant and thoughtful. Not edgy and bleeding edge for the sake of it.
121+
- when providing a solution to a prompt don't provide solutions outside the scope of the prompt nor add loads checks and fallbacks that quickly become redundant in following prompts.
122+
- it makes me wast premium tokens making you fix the brken things you added or changed that were outside the scope of the prompt to begin with.
123+
- provide changes specific to the prompt given.
17124

18125
# GitHub Workflows - All repos
19126

@@ -80,3 +187,8 @@ ouputs
80187
- Use `printf '%s'` for printing strings and `printf '%b'` for escape sequences. **Avoid using `echo`.**
81188
- this function will provide end user information understanding or troubleshooting script outcomes.
82189
- it should be succinct unless there is an error or failure, then it should be verbose enough to help.
190+
191+
## Astro and Astro starlight template for documentation
192+
193+
- Always use the mcp server https://mcp.docs.astro.build/mcp
194+
- Always make sure imported mdx components start with an upper case letter.

.github/workflows/ci-alpine-release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,22 @@ jobs:
5656
env:
5757
lt_version: ${{ matrix.qbt_libtorrent_version }}
5858
run: |
59-
revision="$(jq -r .revision ${lt_version}/*-dependency-version.json | sort -nr | head -n1)"
60-
boost="$(jq -r .boost ${lt_version}/*-dependency-version.json | head -n1)"
59+
shopt -s nullglob
6160
62-
for dependency_version_json in ${lt_version}/*-dependency-version.json; do
61+
revision="$(jq -r .revision "${lt_version}"/*-dependency-version.json | sort -nr | head -n1)"
62+
boost="$(jq -r .boost "${lt_version}"/*-dependency-version.json | head -n1)"
63+
64+
# this need to check both 1.2 and 2.0 folders to merge the libtorrent versions in the dependency-version.json
65+
for dependency_version_json in {1.2,2.0}/*-dependency-version.json; do
6366
if [[ -f ${dependency_version_json} ]]; then
6467
sed -r 's/"boost": (.*)/BOOST_PLACEHOLDER/g' -i "${dependency_version_json}"
6568
sed -r 's/"revision": (.*)/REVISION_PLACEHOLDER/g' -i "${dependency_version_json}"
6669
dependency_version+=("${dependency_version_json}")
6770
fi
6871
done
6972
70-
for release_md in ${lt_version}/*-release.md; do
73+
# This file only needs to merge info specific to the libtorrent matrix running it.
74+
for release_md in "${lt_version}"/*-release.md; do
7175
if [[ -f ${release_md} ]]; then
7276
sed -r 's/^\|(.*)revision(.*)\|(.*)\|$/REVISION_PLACEHOLDER/g' -i "${release_md}"
7377
release_md+=("${release_md}")

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ You can now run it using this command:
5757
5858
### What You Get
5959

60-
**No installation hassles** - Single static binary
61-
**Latest versions** - Always up-to-date dependencies
62-
**Universal compatibility** - Runs on any Linux distro
63-
**Multiple architectures** - Support for ARM devices too
60+
- **No installation hassles** - Single static binary
61+
- **Latest versions** - Always up-to-date dependencies
62+
- **Universal compatibility** - Runs on any Linux distro
63+
- **Multiple architectures** - Support for ARM devices too
6464

6565
## 📋 Table of Contents
6666

changelog.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
### v2.2.1 / v2.0.21 - 13/08/2025
1+
### v2.2.2 - 17/08/2025
2+
3+
`qbt-nox-static.bash` was fully merged into `qbittorrent-nox-static.sh` so that the scripts no longer have significantly different code approaches to the same outcomes.
4+
5+
To maintain expected behavior I only needed to make a small adjustment to the script to make it behave the same way without having to support two versions fo the same script.
6+
7+
This essentially completes the transition from the legacy script to the current without any breaking changes.
8+
9+
fixed:
10+
- install binary function was not working correctly and has been updated.
11+
- fixed building glibc in debug mode due to incorrect flags
12+
- fix alpine version check properly compare versions.
13+
- fixed boost version check that was creating a malformed url for github and beta releases.
14+
15+
### v2.2.1 - 13/08/2025
216

317
Debian support bumped to trixie
418

@@ -14,7 +28,7 @@ This not be an issue since `trixie` `cmake` is `3.31` or newer and `ninja-build`
1428

1529
This makes the `qbt-cmake-ninja-crossbuilds` and `qbt-ninja-build` redundant as the script no longer depends on them.
1630

17-
### v2.2.0 / v2.0.20 - 26/07/2025
31+
### v2.2.0 - 26/07/2025
1832

1933
Context: As the qbt-musl-cross-make toolchains were being revised to properly apply `-static-pie` patches, some issues needed to be resolved that resulted in a rework of some things.
2034

@@ -44,13 +58,13 @@ More consistent use if build flags and when the are applied.
4458
More consistent debug triggering so all parts are built in debug mode.
4559
caching behavior tweaked - use workflow files when it can.
4660

47-
### v2.1.3 / v2.0.19 - 29/06/2025
61+
### v2.1.3 - 29/06/2025
4862

4963
problem: when the `-lt` flag was used with libtorrent `v1.2` like `-lt v1.2.20` boost was not being defaulted to `boost-1.86.0` as it does when setting the env equivalent, causing a build error when libtorrent was built.
5064

5165
fix: the flag now properly checks and sets boost to `boost-1.86.0` when libtorrent `v1.2` is being built via [e11d7d5](https://github.com/userdocs/qbittorrent-nox-static/commit/e11d7d51b5a0a6a99fcac6ae44c4603286e9a598)
5266

53-
### v2.1.2 / v2.0.18 - 18/05/2025
67+
### v2.1.2 - 18/05/2025
5468

5569
fix: `double_conversion` all versions - apply patch for increasing cmake bounds in `CMakeLists.txt` via this [patch](https://github.com/google/double-conversion/commit/0604b4c18815aadcf7f4b78dfa6bfcb91a634ed7)
5670

docs/astro.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { defineConfig } from "astro/config";
22
import starlight from "@astrojs/starlight";
33
import starlightImageZoom from "starlight-image-zoom";
4+
import starlightGitHubAlerts from 'starlight-github-alerts'
45

56
// https://astro.build/config
67
export default defineConfig({
78
site: "https://userdocs.github.io",
89
base: "/qbittorrent-nox-static",
910
integrations: [
1011
starlight({
11-
plugins: [starlightImageZoom()],
12+
plugins: [starlightImageZoom(), starlightGitHubAlerts()],
1213
title: "qbittorrent-nox-static",
1314
logo: {
1415
src: "./public/logo-static.svg",

docs/package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@expressive-code/plugin-collapsible-sections": "^0.41.3",
1515
"astro": "^5.6.1",
1616
"sharp": "^0.34.2",
17+
"starlight-github-alerts": "^0.1.0",
1718
"starlight-image-zoom": "^0.13.0"
1819
},
1920
"devDependencies": {

docs/src/assets/stage1.html

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!doctype html><html lang="en"><head>
2+
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
3+
<title>Aura Output</title>
4+
<style>
5+
/* ===== Aura Dark (Soft Text) ===== */
6+
:root {
7+
--bg: #15141b; /* editor.background */
8+
--fg: #bdbdbd; /* editor.foreground */
9+
--black: #15141b; --red: #c55858; --green: #54c59f;
10+
--yellow: #c7a06f; --blue: #8464c6; --magenta: #54c59f;
11+
--cyan: #8464c6; --white: #b4b4b4;
12+
--bblack: #2d2d2d; --bred: #c7a06f; --bgreen: #8464c6;
13+
--byellow: #c7a06f; --bblue: #8464c6; --bmagenta: #54c59f;
14+
--bcyan: #54c59f; --bwhite: #bdbdbd;
15+
}
16+
17+
/* ===== Light mode placeholder palette ===== */
18+
[data-theme="light"] {
19+
--bg: #fdfdfd;
20+
--fg: #1e1e1e;
21+
--black: #000000; --red: #c01c28; --green: #26a269;
22+
--yellow: #a2734c; --blue: #12488b; --magenta: #a347ba;
23+
--cyan: #2aa1b3; --white: #d0cfcc;
24+
--bblack: #555753; --bred: #f66151; --bgreen: #33d17a;
25+
--byellow: #e9ad0c; --bblue: #3584e4; --bmagenta: #c061cb;
26+
--bcyan: #33c7de; --bwhite: #ffffff;
27+
}
28+
29+
.aura-terminal {
30+
background: var(--bg);
31+
color: var(--fg);
32+
font-family: monospace;
33+
padding: 1rem;
34+
overflow-x: auto;
35+
white-space: pre;
36+
}
37+
.aura-terminal span { all: unset; }
38+
</style>
39+
</head><body>
40+
<div class="aura-terminal">
41+
<span style="filter: contrast(70%) brightness(140%);color:blue;"></span> <span style="font-weight:bold;">Checking: </span><span style="font-weight:bold;filter: contrast(70%) brightness(140%);color:red;">available privileges</span>
42+
43+
<span style="color:green;"></span> <span style="filter: contrast(70%) brightness(140%);color:red;">root</span>
44+
<span style="color:red;"></span> <span style="filter: contrast(70%) brightness(140%);color:red;">sudo</span>
45+
46+
<span style="filter: contrast(70%) brightness(140%);color:blue;"></span> <span style="font-weight:bold;">Checking: </span><span style="font-weight:bold;color:olive;">test</span>
47+
48+
<span style="color:green;"></span> <span style="color:olive;">bash</span>
49+
<span style="color:red;"></span> <span style="color:olive;">curl</span>
50+
<span style="color:red;"></span> <span style="color:olive;">git</span>
51+
52+
<span style="filter: contrast(70%) brightness(140%);color:blue;"></span> <span style="font-weight:bold;">Checking: </span><span style="font-weight:bold;color:purple;">core</span>
53+
54+
<span style="color:red;"></span> <span style="color:purple;">autoconf</span>
55+
<span style="color:red;"></span> <span style="color:purple;">automake</span>
56+
<span style="color:red;"></span> <span style="color:purple;">build-base</span>
57+
<span style="color:red;"></span> <span style="color:purple;">cmake</span>
58+
<span style="color:red;"></span> <span style="color:purple;">curl</span>
59+
<span style="color:red;"></span> <span style="color:purple;">git</span>
60+
<span style="color:red;"></span> <span style="color:purple;">graphviz</span>
61+
<span style="color:red;"></span> <span style="color:purple;">libtool</span>
62+
<span style="color:red;"></span> <span style="color:purple;">linux-headers</span>
63+
<span style="color:red;"></span> <span style="color:purple;">ninja-build</span>
64+
<span style="color:red;"></span> <span style="color:purple;">ninja-is-really-ninja</span>
65+
<span style="color:red;"></span> <span style="color:purple;">perl</span>
66+
<span style="color:red;"></span> <span style="color:purple;">pkgconf</span>
67+
<span style="color:red;"></span> <span style="color:purple;">py3-numpy</span>
68+
<span style="color:red;"></span> <span style="color:purple;">py3-numpy-dev</span>
69+
<span style="color:red;"></span> <span style="color:purple;">python3</span>
70+
<span style="color:red;"></span> <span style="color:purple;">python3-dev</span>
71+
<span style="color:red;"></span> <span style="color:purple;">re2c</span>
72+
<span style="color:red;"></span> <span style="color:purple;">ttf-freefont</span>
73+
<span style="color:red;"></span> <span style="color:purple;">xz</span>
74+
75+
<span style="color:blue;"></span> <span style="color:blue;">Info:</span> /workspace/qbt-nox-static.bash
76+
77+
<span style="color:blue;"></span> <span style="filter: contrast(70%) brightness(140%);color:blue;">qbt-nox-static.bash</span> <span style="color:olive;">install_test</span> ------ installs minimum required tools to run tests
78+
<span style="color:blue;"></span> <span style="filter: contrast(70%) brightness(140%);color:blue;">qbt-nox-static.bash</span> <span style="color:purple;">install_core</span> ------ installs required build tools to use script
79+
<span style="color:blue;"></span> <span style="filter: contrast(70%) brightness(140%);color:blue;">qbt-nox-static.bash</span> <span style="filter: contrast(70%) brightness(140%);color:green;">bootstrap_deps</span> ---- <span style="color:olive;">install_test</span> + <span style="color:purple;">install_core</span>
80+
81+
<span style="color:red;"></span> <span style="color:olive;">Warning:</span> Missing required <span style="color:purple;">test_tools</span>
82+
83+
<span style="color:red;"></span> <span style="color:olive;">Warning:</span> Missing required components of <span style="color:purple;">install_core</span>
84+
85+
</div></body></html>

0 commit comments

Comments
 (0)