forge
Clone
https://git.tahinli.com/Tahinli/forge.git
0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 commits
| 1 | //! The build identity of this binary: version, git commit, commit date. Shared by the server and |
| 2 | //! the runner, which are the same binary, so a runner can be compared to the server it talks to. |
| 3 | |
| 4 | use OnceLock; |
| 5 | |
| 6 | /// The crate version. |
| 7 | pub const VERSION: &str = env!; |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | static IDENTITY: = new; |
| 16 | |
| 17 | /// Sets the commit, commit date and dirty flag of the running binary. Each binary sets this first |
| 18 | /// thing in main, so this crate has no per-commit input and a new commit does not rebuild |
| 19 | /// everything that depends on it. A second call is ignored. |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | /// Short git sha of the commit built, or "unknown" before [`set_identity`]. |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | /// Commit date (YYYY-MM-DD), or "unknown" before [`set_identity`]. |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | /// True when the tree had uncommitted changes to tracked files at build time. |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | /// `0.1.0 (cf8e648, 2026-10-20)`, with `cf8e648-dirty` for a dirty tree. |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | /// The commit sha out of a build string made by [`display`], `None` when it is unknown or the |
| 54 | /// string is not in that shape. |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | /// How a runner's build compares with the server's. |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | /// Compares by commit, ignoring the dirty marker. |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 |