New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rabbitmq: make all dependencies explicit #47728
Conversation
Builds ok for me on NixOS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Can @Profpatsch review, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, two comments, then we can merge.
++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Carbon Cocoa ]; | ||
|
||
outputs = [ "out" "man" "doc" ]; | ||
|
||
installFlags = "PREFIX=$(out) RMQ_ERLAPP_DIR=$(out)"; | ||
installTargets = "install install-man"; | ||
|
||
runtimePath = stdenv.lib.makeBinPath [getconf erlang socat]; | ||
preBuild = '' | ||
export LANG=en_US.UTF-8 # fix elixir locale warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s use C.UTF-8
here if possible.
postInstall = '' | ||
echo 'PATH=${runtimePath}:''${PATH:+:}$PATH' >> $out/sbin/rabbitmq-env | ||
# rabbitmq-env calls to sed/coreutils, so provide everything early | ||
sed -i $out/sbin/rabbitmq-env -e '2s|^|PATH=${runtimePath}\''${PATH:+:}\$PATH/\n|' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 2s
a line filter? They are usually quite brittle in my experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intention here is to get proper PATH as early as possible. Line 1 is always shebang, so line 2 is the earliest place where PATH can be set. So in that case it shouldn't be brittle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn’t see that it was just an insertion. You can use i
or a
for that instead of s
iirc, but it doesn’t really matter.
@binarin It’s usually good practice to CC the maintainers of a program, otherwise they might not see it like me in this case. @GrahamcOfBorg test rabbitmq |
@binarin ping |
Some things were provided by default, some by systemd unit and some were just miraculously working. This turns them into explicit dependencies of the package itself, making everything properly overrideable. + providing glibcLocales fixes elixir compile warnings + providing systemd dependency allows rabbit to use systemctl for unit activation check instead of falling back to sleep. This was seen as a warning during startup.
559de44
to
731fd97
Compare
@Profpatsch I've replaced the locale with |
Awesome! |
Motivation for this change
Some things were provided by default, some by systemd unit and some
were just miraculously working. This turns them into explicit
dependencies of the package itself, making everything properly
overrideable.
providing glibcLocales fixes elixir compile warnings
providing systemd dependency allows rabbit to use
systemctl
for unitactivation check instead of falling back to sleep. This was seen as
a warning during startup.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)