Skip to content
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

Merged
merged 1 commit into from Jan 19, 2020

Conversation

binarin
Copy link
Contributor

@binarin binarin commented Oct 3, 2018

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 unit
    activation check instead of falling back to sleep. This was seen as
    a warning during startup.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@lightbulbjim
Copy link
Contributor

Builds ok for me on NixOS.

@ryantm ryantm requested a review from Profpatsch January 1, 2020 23:18
Copy link
Member

@ryantm ryantm left a 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?

Copy link
Member

@Profpatsch Profpatsch left a 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
Copy link
Member

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|'
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

pkgs/servers/amqp/rabbitmq-server/default.nix Show resolved Hide resolved
@Profpatsch
Copy link
Member

@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

@Profpatsch
Copy link
Member

@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.
@binarin
Copy link
Contributor Author

binarin commented Jan 19, 2020

@Profpatsch I've replaced the locale with C.UTF-8, and re-based to the latest master. I've also run the test, and there were neither warnings nor problems with systemd activation check.

@ofborg ofborg bot requested a review from Profpatsch January 19, 2020 11:56
@Profpatsch Profpatsch merged commit ed16f83 into NixOS:master Jan 19, 2020
@Profpatsch
Copy link
Member

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants