docs: removed dead code around FISH_BUILD_VERSION

Man pages used to be built by "build.rs" but now are built by a
dependent "crates/build-man-pages/build.rs". This means that changing
the environment of build.rs is ineffective.

In future, "fn get_version" should probably be a part of
"crates/build-helper/", so Cargo builds only need to compute the
version once.

Lack of this dependency means that "build-man-pages" does not
pass FISH_BUILD_VERSION, which means that Sphinx will fall back to
build_tools/git_version_gen.sh.  This acceptable for now given that
"build-man-pages" is not used in CMake builds.
This commit is contained in:
Johannes Altmanninger
2025-12-29 11:48:12 +01:00
parent 7975060e4a
commit f0d2444769
2 changed files with 1 additions and 7 deletions

View File

@@ -40,9 +40,6 @@ fn main() {
// the source directory is the current working directory of the build script
rsconf::set_env_value("FISH_BUILD_VERSION", version);
// safety: single-threaded code.
unsafe { std::env::set_var("FISH_BUILD_VERSION", version) };
fish_build_helper::rebuild_if_embedded_path_changed("share");
let build = cc::Build::new();

View File

@@ -122,11 +122,8 @@ if "FISH_BUILD_VERSION_FILE" in os.environ:
# From Cmake
f = open(os.environ["FISH_BUILD_VERSION_FILE"], "r")
ret = f.readline().strip()
elif "FISH_BUILD_VERSION" in os.environ:
# From Cargo
ret = os.environ["FISH_BUILD_VERSION"]
else:
# No build system.
# From Cargo, or no build system.
ret = subprocess.check_output(
("../build_tools/git_version_gen.sh", "--stdout"), stderr=subprocess.STDOUT
).decode("utf-8")