chore/config/fix-build-hash-and-add-quick-build-target #1377

Closed
gamesguru wants to merge 10 commits from gamesguru/continuwuity:chore/config/fix-build-hash-and-add-quick-build-target into main
Contributor

This pull request fixes slowness and inconsistency in build metadata generation. The build hash in the --version output and the User Agent signature always work as expected and no longer require a clean build to set the correct hash.

Pull request checklist:

  • This pull request targets the main branch, and the branch is named something other than
    main.
  • I have written an appropriate pull request title and my description is clear.
  • I understand I am responsible for the contents of this pull request.
  • I have followed the contributing guidelines:
This pull request fixes slowness and inconsistency in build metadata generation. The build hash in the `--version` output and the User Agent signature always work as expected and no longer require a clean build to set the correct hash. <!-- Example: This pull request allows us to warp through time and space ten times faster than before by double-inverting the warp drive with hyperheated jump fluid, both making the drive faster and more efficient. This resolves the common issue where we have to wait more than 10 milliseconds to engage, use, and disengage the warp drive when travelling between galaxies. --> <!-- Closes: #... --> <!-- Fixes: #... --> <!-- Uncomment the above line(s) if your pull request fixes an issue or closes another pull request by superseding it. Replace `#...` with the issue/pr number, such as `#123`. --> **Pull request checklist:** <!-- You need to complete these before your PR can be considered. If you aren't sure about some, feel free to ask for clarification in #dev:continuwuity.org. --> - [x] This pull request targets the `main` branch, and the branch is named something other than `main`. - [x] I have written an appropriate pull request title and my description is clear. - [x] I understand I am responsible for the contents of this pull request. - I have followed the [contributing guidelines][c1]: - [x] My contribution follows the [code style][c2], if applicable. - [x] I ran [pre-commit checks][c1pc] before opening/drafting this pull request. - [x] I have [tested my contribution][c1t] (or proof-read it for documentation-only changes) myself, if applicable. This includes ensuring code compiles. - [ ] My commit messages follow the [commit message format][c1cm] and are descriptive. - [x] I have written a [news fragment][n1] for this PR, if applicable<!--(can be done after hitting open!)-->. <!-- Notes on these requirements: - While not required, we encourage you to sign your commits with GPG or SSH to attest the authenticity of your changes. - While we allow LLM-assisted contributions, we do not appreciate contributions that are low quality, which is typical of machine-generated contributions that have not had a lot of love and care from a human. Please do not open a PR if all you have done is asked ChatGPT to tidy up the codebase with a +-100,000 diff. - In the case of code style violations, reviewers may leave review comments/change requests indicating what the ideal change would look like. For example, a reviewer may suggest you lower a log level, or use `match` instead of `if/else` etc. - In the case of code style violations, pre-commit check failures, minor things like typos/spelling errors, and in some cases commit format violations, reviewers may modify your branch directly, typically by making changes and adding a commit. Particularly in the latter case, a reviewer may rebase your commits to squash "spammy" ones (like "fix", "fix", "actually fix"), and reword commit messages that don't satisfy the format. - Pull requests MUST pass the `Checks` CI workflows to be capable of being merged. This can only be bypassed in exceptional circumstances. If your CI flakes, let us know in matrix:r/dev:continuwuity.org. - Pull requests have to be based on the latest `main` commit before being merged. If the main branch changes while you're making your changes, you should make sure you rebase on main before opening a PR. Your branch will be rebased on main before it is merged if it has fallen behind. - We typically only do fast-forward merges, so your entire commit log will be included. Once in main, it's difficult to get out cleanly, so put on your best dress, smile for the cameras! --> [c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md [c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx [c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks [c1t]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#running-tests-locally [c1cm]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages [n1]: https://towncrier.readthedocs.io/en/stable/tutorial.html#creating-news-fragments
Jade left a comment

If you feel like it one thing I didn't add when I was doing this was marking builds from dirty git trees

If you feel like it one thing I didn't add when I was doing this was marking builds from dirty git trees
@ -42,0 +43,4 @@
// If CONTINUWUITY_BRANCH is manually set (e.g. in .env), use it to construct the version string
// while keeping the hash dynamic
if get_env("CONTINUWUITY_VERSION_EXTRA").is_none() {
if let Some(branch_env) = get_env("CONTINUWUITY_BRANCH") {
Owner

Feels like this should be pulled from git automatically by the way, and just ommitted if it's main.

Feels like this should be pulled from git automatically by the way, and just ommitted if it's main.
Author
Contributor

Not all git checkouts/clones have a meaningful branch name. It could be pulls/127, or even just HEAD.

In some of our containers/runners, we have weird branch names. So this helps avoid or reconfigure that without having to issue messy physical git commands.

There are a few other polishing remarks tho on this PR i think. Like it always shows b=main now, and fails to omit it (possibly i forgot to add a test case, but review those too please as they are reflective of the SLA contract). Also, the GIT_DESCRIBE is useless... afaik at least. I'm not using it anywhere and I wrote it, so...!

Not all git checkouts/clones have a meaningful branch name. It could be `pulls/127`, or even just `HEAD`. In some of our containers/runners, we have weird branch names. So this helps avoid or reconfigure that without having to issue messy physical git commands. There are a few other polishing remarks tho on this PR i think. Like it always shows `b=main` now, and fails to omit it (possibly i forgot to add a test case, but review those too please as they are reflective of the SLA contract). Also, the `GIT_DESCRIBE` is useless... afaik at least. I'm not using it anywhere and I wrote it, so...!
Makefile Outdated
@ -0,0 +11,4 @@
help: ##H Show this help
@grep -hE '^[a-zA-Z0-9_\/-]+:.*?##H .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?##H "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
Owner

Not sure we want a makefile - this is a bit hard to understand and modify. Something like a just file would probably be better

Not sure we want a makefile - this is a bit hard to understand and modify. Something like a just file would probably be better
Author
Contributor

The help command or the functional targets? Help command is completely cosmetic & can be removed. Tab completion is the source of truth.

I like the convenience of make format, make lint, etc. Helps me know I'm doing exactly what CI does.

The help command or the functional targets? Help command is completely cosmetic & can be removed. Tab completion is the source of truth. I like the convenience of `make format`, `make lint`, etc. Helps me know I'm doing exactly what CI does.
Owner

I mean the whole thing. We already have https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/engage.toml engage which does the same thing, and even if we didn't there is no reason to use Make when there are so many better alternatives

I mean the whole thing. We already have https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/engage.toml engage which does the same thing, and even if we didn't there is no reason to use Make when there are so many better alternatives
Owner

+1. I don't think this file is necessary at all, and it's certainly not related to the topic of this PR.

+1. I don't think this file is necessary at all, and it's certainly not related to the topic of this PR.
gamesguru force-pushed chore/config/fix-build-hash-and-add-quick-build-target from 3c6952c2f9
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
to 34d1d3896a
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
2026-02-17 21:17:31 +00:00
Compare
Author
Contributor

Enhanced version check

Version/metadata crate now always reports the compiled version and does so remarkably fast.

Extra config flag added very legacy clients, like Schilidchat. Tested and working, see image.

For some reason the fix works for /r0/download but /r0/thumbnail still throws some errors, perhaps less? Need to check why.

Commit hash of test performed:

curl https://matrix.nutra.tk/_matrix/federation/v1/version

{
  "server": {
    "name": "continuwuity",
    "version": "0.5.5 (dccac214,b=brsq)"
  }
}

Other changes on this branch

zzzzz... will update/separate stuff out later.

### Enhanced version check Version/metadata crate now always reports the compiled version and does so remarkably fast. ### Extra config flag added very legacy clients, like Schilidchat. Tested and working, see image. For some reason the fix works for `/r0/download` but `/r0/thumbnail` still throws some errors, perhaps less? Need to check why. Commit hash of test performed: `curl https://matrix.nutra.tk/_matrix/federation/v1/version` ```json { "server": { "name": "continuwuity", "version": "0.5.5 (dccac214,b=brsq)" } } ``` ### Other changes on this branch zzzzz... will update/separate stuff out later.
gamesguru force-pushed chore/config/fix-build-hash-and-add-quick-build-target from 34d1d3896a
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
to 1271e6f04e
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
2026-02-21 17:24:37 +00:00
Compare
gamesguru force-pushed chore/config/fix-build-hash-and-add-quick-build-target from 1271e6f04e
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
to 823f163280
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
2026-03-08 00:27:52 +00:00
Compare
gamesguru changed title from WIP: chore/config/fix-build-hash-and-add-quick-build-target to chore/config/fix-build-hash-and-add-quick-build-target 2026-03-08 02:08:14 +00:00
gamesguru force-pushed chore/config/fix-build-hash-and-add-quick-build-target from abf731eae7
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
to 037a7fe2a1
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
2026-03-08 02:16:38 +00:00
Compare
add: dev-quick profile, verbose version. remove: redundant binary/import. update: .envrc
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
db75c8e8bd
Also re-adds ability to inspect used features
demonstration of Jade's build info efforts, see below:
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
d4fd3ca1b7
Here's what it outputs for build info.
I'm not sure it's fully accurate in how it filters. For example, console is disabled by default? Didn't know that.

```shell
./target/latest/conduwuit --version-verbose
version: 0.5.6
version_extra: 0.5.6+43~691b34d3-dirty,b=chore/config/fix-build-hash-and-add-quick-build-target
commit: 691b34d345
commit_short: 691b34d3
branch: chore/config/fix-build-hash-and-add-quick-build-target
remote_url: https://forgejo.ellis.link/continuwuation/continuwuity.git
remote_web_url: https://forgejo.ellis.link/continuwuation/continuwuity
remote_commit_url: 691b34d345
enabled_features: bindgen-runtime, blurhashing, brotli-compression, console, element-hacks, gzip-compression, io-uring, jemalloc, jemalloc-conf, journald, ldap, media-thumbnail, otlp-telemetry, release-max-log-level, sentry-telemetry, standard, systemd, url-preview, zstd-compression
available_features: bindgen-runtime, bindgen-static, blurhashing, brotli_compression, conduwuit_mods, console, default, direct_tls, element_hacks, full, gzip_compression, hardened_malloc, http3, io_uring, jemalloc, jemalloc_conf, jemalloc_prof, jemalloc_stats, journald, ldap, media_thumbnail, otlp_telemetry, perf_measurements, release_max_log_level, sentry_telemetry, standard, systemd, tokio_console, url_preview, zstd_compression
```
build(info): fix cases of b=HEAD and degenerate branch names
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled
e70fa05582
Owner

Closed due to moderation action

Closed due to moderation action
Jade closed this pull request 2026-03-17 02:30:49 +00:00
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Required
Details
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Required
Details
Update flake hashes / update-flake-hashes (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1377
No description provided.