Skip to content

Commit

Permalink
rabbitmq-server: Fix reported version (#367395)
Browse files Browse the repository at this point in the history
Fixes the version in `rabbitmqctl --version` and the web interface

(cherry picked from commit 271637d)
  • Loading branch information
dasJ authored and github-actions[bot] committed Dec 25, 2024
1 parent 911febb commit 50c3456
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkgs/servers/amqp/rabbitmq-server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ stdenv.mkDerivation rec {

preBuild = ''
export LANG=C.UTF-8 # fix elixir locale warning
export PROJECT_VERSION="$version"
'';

postInstall = ''
Expand All @@ -113,6 +114,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;
};
Expand Down

0 comments on commit 50c3456

Please sign in to comment.