Commit Graph

15 Commits

Author SHA1 Message Date
Maciek "mab122" Bator 581843fa92 build: rerun-if-changed on .git/logs/HEAD, fix stale version on rebuild
Without an explicit rerun-if-changed directive, cargo has no way to
know it needs to re-run this build script just because the current
commit changed -- by default it only reruns based on files inside
the crate's own source tree, and .git is entirely outside that. This
let GIT_HEAD/RADICLE_VERSION silently go stale: several `cargo
build`s in a row during this session kept reporting an old commit's
version despite the working tree being clean at a newer commit,
because cargo decided nothing needed rebuilding at all.

`.git/logs/HEAD` (the reflog) is touched on every commit, checkout,
and merge, unlike `.git/HEAD` itself (which only changes when
switching branches) -- watching it catches the case that actually
matters here.
2026-07-17 09:42:30 +02:00
Maciek "mab122" Bator 68202ce58d build: tag rad --version with a +lfs-ipfs suffix, fix newline bug
Appends a semver build-metadata suffix to RADICLE_VERSION so `rad
--version` (and radicle-node/git-remote-rad, which share this build
script via symlink) unambiguously identify a binary as this fork
rather than upstream heartwood -- useful for checking what a deploy
target is actually running.

While wiring this up, found and fixed a real pre-existing bug: none
of the three `git` subprocess outputs captured here (GIT_HEAD,
RADICLE_VERSION, SOURCE_DATE_EPOCH) were trimmed, so each carried a
trailing newline into its `cargo::rustc-env=KEY=VALUE` directive.
Harmless on its own since nothing followed it, but appending the
+lfs-ipfs suffix landed after that embedded newline, splitting the
directive across two lines -- cargo silently discards the second
line as unrecognized, so the suffix never actually took effect until
this trim was added.

Also adds scripts/publish-package.sh: builds all four release
binaries (rad, radicle-node, git-remote-rad, rad-lfs-transfer) and
publishes them as a Forgejo generic package, so a deploy target
without a Rust toolchain can download instead of rebuilding from
source (see NOTES-lfs-store-note-write-bug.md's VPS deployment story
for why that matters).
2026-07-16 13:49:13 +02:00
Lorenz Leutgeb 0e9d7607e4 hooks: Enable typos, fix reported errors 2026-02-17 11:35:28 +00:00
Lorenz Leutgeb 532e5a0de0 build: Use `git describe` to generate a version
Only if `RADICLE_VERSION` is not set, we ask Git to desribe the commit
we are building. This is better than having all these cases just be
"pre-release", which is not very informative.
2025-10-14 15:34:06 +01:00
cloudhead 589c375624
build: Update env vars for build process
Use the standard `SOURCE_DATE_EPOCH` instead of `GIT_COMMIT_TIME`.
Set `GIT_HEAD` properly.
2024-06-20 10:47:50 +02:00
cloudhead 95b5191533
Reproducible cross-compiled builds
Implement a new build pipeline using `podman` and `zig` that is
reproducible and can be run entirely on linux.

We also simplify the versioning system, defaulting to the output of `git
describe` when there are no exact tag matches.
2024-04-20 11:11:00 +02:00
cloudhead 345fa57b64
ci: Fix release workflow
By default, the `checkout@v4` action does a shallow clone, so we weren't
getting the history.
2024-03-27 13:51:38 +01:00
cloudhead 081af03362
Release 1.0.0-rc.1 2024-03-26 16:54:47 +01:00
cloudhead 24bf2826cc
Update build script for 1.77
Remove the `rerun-if-changed` since it was causing problems with test
speed. By default, it will re-run if any file changes, which should be
fine.
2024-03-26 10:35:27 +01:00
cloudhead dbf47fe4e9
Implement new versioning system
See `VERSIONING.md` for details.
2024-03-25 11:54:08 +01:00
cloudhead 93ff59ae25
cli: Add `rad version --json` flag
This will be used to automatically populated metadata around releases
for the homepage.
2024-03-11 17:36:31 +01:00
Lars Wirzenius 570a7eb141
build.rs: fix formatting
.radicle/native.yaml runs "cargo fmt --check" and that fails without
this change.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-11 13:29:37 +01:00
Michael Raitza 4b1ca18d0c
nix: Compile commit hash into program version
Changes build.rs to take the GIT_HEAD environment variable into account
if `git rev-parse` is unable to determine the current commit hash.
2024-03-08 23:37:34 +01:00
Fintan Halpenny 3f48c2c516
Rust 1.67
Rust 1.67 was announced[0]. Update the necessary files for running
1.67 and fix the clippy suggestions for string interpolation.

[0]: https://blog.rust-lang.org/2023/01/26/Rust-1.67.0.html

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-04 19:30:29 +01:00
Alexis Sellier 2f6cf9c7a5
httpd: implement `git` fetch-only server
Introduces a new `radicle-httpd` crate which will serve as the basis
for heartwood's HTTP backend.

The first part of this is a git server which allows projects to be
fetched from storage using plain `git`.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-19 11:36:16 +02:00