mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Rework lighthouse_version to reduce spurious recompilation (#8336)
#8311 Removes the `git_version` crate from `lighthouse_version` and implements git `HEAD` tracking manually. This removes the (mostly) broken dirty tracking but prevents spurious recompilation of the `lighthouse_version` crate. This also reworks the way crate versions are handled by utilizing workspace version inheritance and Cargo environment variables. This means the _only_ place where Lighthouse's version is defined is in the top level `Cargo.toml` for the workspace. All relevant binaries then inherit this version. This largely makes the `change_version.sh` script useless so I've removed it, although we could keep a version which just alters the workspace version (if we need to maintain compatibility with certain build/release tooling. ### When is a Rebuild Triggered? 1. When the build.rs file is changed. 2. When the HEAD commit changes (added, removed, rebased, etc) 3. When the branch changes (this includes changing to the current branch, and creating a detached HEAD) Note that working/staged changes will not trigger a recompile of `lighthouse_version`. Co-Authored-By: Mac L <mjladson@pm.me> Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Change the version across multiple files, prior to a release. Use `sed` to
|
||||
# find/replace the exiting version with the new one.
|
||||
#
|
||||
# Takes two arguments:
|
||||
#
|
||||
# 1. Current version (e.g., `0.2.6`)
|
||||
# 2. New version (e.g., `0.2.7`)
|
||||
#
|
||||
# ## Example:
|
||||
#
|
||||
# `./change_version.sh 0.2.6 0.2.7`
|
||||
|
||||
FROM=$1
|
||||
TO=$2
|
||||
VERSION_CRATE="../common/lighthouse_version/src/lib.rs"
|
||||
|
||||
update_cargo_toml () {
|
||||
echo $1
|
||||
sed -i -e "s/version = \"$FROM\"/version = \"$TO\"/g" $1
|
||||
}
|
||||
|
||||
echo "Changing version from $FROM to $TO"
|
||||
|
||||
update_cargo_toml ../account_manager/Cargo.toml
|
||||
update_cargo_toml ../beacon_node/Cargo.toml
|
||||
update_cargo_toml ../boot_node/Cargo.toml
|
||||
update_cargo_toml ../lcli/Cargo.toml
|
||||
update_cargo_toml ../lighthouse/Cargo.toml
|
||||
update_cargo_toml ../validator_client/Cargo.toml
|
||||
|
||||
echo $VERSION_CRATE
|
||||
sed -i -e "s/$FROM/$TO/g" $VERSION_CRATE
|
||||
Reference in New Issue
Block a user