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

fluent-bit: init at 1.0.6 #60887

Merged
merged 2 commits into from May 21, 2019
Merged

fluent-bit: init at 1.0.6 #60887

merged 2 commits into from May 21, 2019

Conversation

samrose
Copy link
Contributor

@samrose samrose commented May 3, 2019

Motivation for this change

adding a package that installs https://fluentbit.io

Things done

created a pkg, and added to all-packages.nix

  • 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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@samrose samrose changed the title fluent-bit fluent-bit: 1.0.6 May 4, 2019
pkgs/tools/misc/fluent-bit/default.nix Outdated Show resolved Hide resolved
pkgs/tools/misc/fluent-bit/default.nix Outdated Show resolved Hide resolved
pkgs/tools/misc/fluent-bit/default.nix Outdated Show resolved Hide resolved
pkgs/tools/misc/fluent-bit/default.nix Outdated Show resolved Hide resolved
name = "fluentbit";
version = "1.0.6";
buildInputs = [ cmake ];
builder = ./builder.sh;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing a specific reason you need your own builder so you can remove this and the default will take care of it for you.

Copy link
Member

@lukateras lukateras May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package does not trivially build with the default builder. However, there are two problems with this approach:

  1. $out/bin is filled with programs that do not belong in the package (xxd-c, hello_world, onigmo-config, etc.) while $out/{include,lib} is missing.

  2. Builders do not compose and as such should generally be used as a last resort.

In this case, upstream assumed impure FHS location of systemd unit directory, which causes an error during installPhase. Fixing that in postPatch phase will suffice:

  postPatch = ''
    substituteInPlace src/CMakeLists.txt \
      --replace /lib/systemd $out/lib/systemd
  '';

pkgs/tools/misc/fluent-bit/default.nix Outdated Show resolved Hide resolved
homepage = "https://fluentbit.io";
maintainers = [ maintainers.samrose ];
license = licenses.asl20;
platforms = platforms.linux;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The website says this software also supports osx.

meta = with stdenv.lib; {
description = "fluentbit";
homepage = "https://fluentbit.io";
maintainers = [ maintainers.samrose ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to add yourself as an entry to maintainers/maintainer-list.nix, though please do this in a separate commit.

Copy link
Member

@lukateras lukateras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review changes between b9f68c5f0fe3088c73cc4587063d7b683c3f2f2d and 71077639c833763edb3e9b255706794fbc7e9b4a.

Also, you will need to add yourself to maintainers list in order for metadata to evaluate correctly (as a separate commit). See instructions in maintainers/maintainer-list.nix on how to do so.

@@ -2824,6 +2824,8 @@ in

fltrdr = callPackage ../tools/misc/fltrdr { stdenv = gcc8Stdenv; };

fluentbit = callPackage ../tools/misc/fluent-bit { };
Copy link
Member

@lukateras lukateras May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package name should be consisent with folder name, derivation name, and preferably, executable name. fluent-bit seems to be the upstream name of this package.

name = "fluentbit";
version = "1.0.6";
buildInputs = [ cmake ];
builder = ./builder.sh;
Copy link
Member

@lukateras lukateras May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package does not trivially build with the default builder. However, there are two problems with this approach:

  1. $out/bin is filled with programs that do not belong in the package (xxd-c, hello_world, onigmo-config, etc.) while $out/{include,lib} is missing.

  2. Builders do not compose and as such should generally be used as a last resort.

In this case, upstream assumed impure FHS location of systemd unit directory, which causes an error during installPhase. Fixing that in postPatch phase will suffice:

  postPatch = ''
    substituteInPlace src/CMakeLists.txt \
      --replace /lib/systemd $out/lib/systemd
  '';

@lukateras
Copy link
Member

@GrahamcOfBorg build fluent-bit

@aanderse
Copy link
Member

It would be nice if the git history was rewritten here into 2 commits, the first of which adding samrose to the maintainer list, and the second being the rest squashed.

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