rabbitmq-server: Fix reported version (#367395)

Fixes the version in `rabbitmqctl --version` and the web interface
This commit is contained in:
Janne Heß
2024-12-25 22:25:17 +01:00
committed by GitHub
parent c792c60b8a
commit 271637da39
@@ -87,6 +87,7 @@ stdenv.mkDerivation rec {
preBuild = ''
export LANG=C.UTF-8 # fix elixir locale warning
export PROJECT_VERSION="$version"
'';
postInstall = ''
@@ -106,6 +107,19 @@ stdenv.mkDerivation rec {
rm $out/INSTALL
'';
# Can not use versionCheckHook since that doesn't allow for setting environment variables
# which is necessary since Erlang needs a $HOME for the Cookie.
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
out="$(env - LANG=C.utf8 HOME=/build ${placeholder "out"}/bin/rabbitmqctl version)"
if [[ "$out" != "$version" ]]; then
echo "Rabbitmq should report version $version, but thinks it's version $out" >&2
exit 1
fi
runHook postInstallCheck
'';
passthru.tests = {
vm-test = nixosTests.rabbitmq;
};