Fix the curl GitHub mirror, repair the troubleshooting table

The GitHub fallback for curl was a 404 written untested: curl tags its
releases with underscores in the version, 8.22.0 becoming curl-8_22_0,
while the asset name keeps the dots. Derive the tag from the version
rather than assuming the two match. Verified by making the primary host
unresolvable and letting the fallback carry the fetch; the tarball
passes xz -t and extracts to curl-8.22.0/.

The README troubleshooting section was a definition list. It is now a
three-column table, matching the reference sections elsewhere in the
file, with a row added for make static-deps failing to download, which
had no coverage despite the script fetching two tarballs.

Two of its entries were wrong:

- One documented "cannot find -lcares", which the Makefile can no longer
  produce. The recipe passes the explicit path static-deps/libcares.a
  and the prerequisite check fails first with its own message. Verified
  by moving the archive aside and reading what make actually says.

- The ares_* entry gave one diagnostic for two causes that read opposite
  ways. `nm -u static-deps/libcurl.a | grep -c ares_` returns zero when
  the archive was built without c-ares, and nonzero when c-ares is in
  there and the failure is link order. Split them apart.
This commit is contained in:
Luxferre
2026-10-03 09:22:23 +03:00
parent 494bee8b77
commit 5852a9732b
2 changed files with 18 additions and 45 deletions
+14 -44
View File
@@ -382,50 +382,20 @@ through, so it is self-correcting in practice.
## Troubleshooting
`error while loading shared libraries`
The dynamic binary needs libcurl, json-c and readline at runtime. Install
them, or build `solo-static`.
`solo: command not found` after `make install`
`/usr/local/bin` is not on your `PATH`, or you installed to
`$HOME/.local/bin`.
`pkg-config --cflags libcurl json-c readline` prints nothing
The development headers are missing. Install `libcurl4-openssl-dev`,
`libjson-c-dev` and `libreadline-dev` (names vary by distro).
`make static` fails with "bytecode stream ... generated with LTO version"
Known GCC 14 vs 15 mismatch in the distro libcurl.a. Run `make static-deps`
to build a clean libcurl, then `make static` again.
`make static` fails with "cannot find -lcares", or cannot find -lssl, -lz, ...
Your distro has no static archives for some of these. `make static-deps`
only builds curl and c-ares; ssl, crypto, z, idn2, unistring, readline,
ncursesw and json-c must come from the distro as `.a` files.
`make static` fails with undefined references to `ares_*`
Either the archives are in the wrong order on the link line (libcares.a must
come after libcurl.a), or libcurl.a was built without c-ares in the first
place. Check with `nm -u static-deps/libcurl.a | grep ares_`, which should
list them, and rebuild with `make static-deps-force`.
`Illegal instruction` from a binary built here, run elsewhere
`-march=native`. Rebuild without it:
`make CFLAGS="-Wall -Wextra -O2 -std=c99"`.
The model keeps asking for a command that times out
The limit is `SOLO_TIMEOUT`, 120 s. Raise it with `SOLO_TIMEOUT=600`, or
remind the model to background long jobs and poll.
`request failed` with no output
The endpoint rejected the call. Check `/api_key` and `/endpoint`, then
`/models` to confirm the endpoint answers and which models it lists.
Anything the server returns is printed as-is, so the HTTP error body is
usually the explanation.
The transcript looks stale
Session state lives in `.solo_sess.json` in the current directory. Run
`solo` where you want that conversation, or delete the file to start over.
| Symptom | What it means | Fix |
| --- | --- | --- |
| `error while loading shared libraries` | Dynamic build, runtime libraries absent. | Install libcurl, json-c and readline, or use `solo-static`. |
| `solo: command not found` after `make install` | `$(PREFIX)/bin` is not on `PATH`. | Add it, or install with `PREFIX=$HOME/.local`. |
| `pkg-config --cflags libcurl json-c readline` prints nothing | Development headers are missing. | Install `libcurl4-openssl-dev`, `libjson-c-dev`, `libreadline-dev`. |
| `make static-deps` cannot download a tarball | No network, or every mirror for that file is down. | Retry. It tries c-ares.dev then GitHub for c-ares, curl.se then GitHub for curl. |
| `make static` says `missing static-deps/libcares.a` | The prerequisite check caught it; the link never started. | `make static-deps`, or `make static-deps-force` if a stale copy is in the way. |
| `make static` says `cannot find -lssl`, `-lz`, `-lidn2`, ... | The distro ships no static archive for a dependency. | Install the `-dev` packages that ship `.a` files. Only curl and c-ares are built here. |
| `make static` says `bytecode stream ... generated with LTO version` | The distro `libcurl.a` holds GCC 14 LTO objects a newer linker cannot read. | `make static-deps-force`, then `make static`. |
| `make static` reports undefined `ares_*` | Either link order, or a libcurl built without c-ares. | Run `nm -u static-deps/libcurl.a \| grep -c ares_`. Zero means the archive is stale or foreign: rebuild with `make static-deps-force`. Nonzero means c-ares is in there and the order is wrong: `CARES_STATIC` must follow `CURL_STATIC`. |
| `Illegal instruction` on another machine | `-march=native` in the default `CFLAGS`. | `make CFLAGS="-Wall -Wextra -O2 -std=c99"`. |
| The model keeps hitting the timeout | `SOLO_TIMEOUT`, 120 s by default. | Raise it with `SOLO_TIMEOUT=600`, or have the model background long jobs and poll. |
| `request failed`, possibly with a JSON body | The endpoint refused the call; the body is printed as-is. | Check `/api_key` and `/endpoint`, then `/models`. |
| The transcript looks stale | State lives in `.solo_sess.json` in the current directory. | Run `solo` where that conversation lives, or delete the file. |
## Credits
+4 -1
View File
@@ -107,9 +107,12 @@ CURL_STAMP=$OUT/.curl-version
if fresh "$OUT/libcurl.a" "$CURL_STAMP" "$CURL_VERSION"; then
echo "libcurl.a $CURL_VERSION present, skipping (FORCE=1 to rebuild)"
else
# curl tags its GitHub releases with underscores in the version (8.22.0 ->
# curl-8_22_0), the file name keeps the dots. Verified 2026-10-03.
CURL_TAG=$(printf '%s' "$CURL_VERSION" | tr . _)
fetch "$WORK/curl.tar.xz" \
"https://curl.se/download/curl-$CURL_VERSION.tar.xz" \
"https://github.com/curl/curl/releases/download/curl-$CURL_VERSION/curl-$CURL_VERSION.tar.xz"
"https://github.com/curl/curl/releases/download/curl-$CURL_TAG/curl-$CURL_VERSION.tar.xz"
echo "extracting curl $CURL_VERSION"
tar xf "$WORK/curl.tar.xz" -C "$WORK"
cd "$WORK/curl-$CURL_VERSION"