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

fluentd: 1.2.3 -> 1.4.2 #59234

Merged
merged 1 commit into from Apr 10, 2019
Merged

fluentd: 1.2.3 -> 1.4.2 #59234

merged 1 commit into from Apr 10, 2019

Conversation

basvandijk
Copy link
Member

Motivation for this change
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 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.

@Ma27
Copy link
Member

Ma27 commented Apr 9, 2019

@basvandijk the patch seems fine, but can you fix the darwin build? :)

@basvandijk
Copy link
Member Author

The issue is that the thrift gem, which is a dependency of the fluent-plugin-scribe gem, fails to build on darwin:

> nix-build -A fluentd
these derivations will be built:
  /nix/store/irvlx6xx5yymif2247hkfgq0cx75ms4j-ruby2.5.5-thrift-0.8.0.drv
  /nix/store/gp1iw3v7ingikx5harln5s3829q1933l-ruby2.5.5-fluent-plugin-scribe-1.0.0.drv
  /nix/store/88470443nlgm4n8n31c1jzv848xcyr92-fluentd-1.4.2.drv
building '/nix/store/irvlx6xx5yymif2247hkfgq0cx75ms4j-ruby2.5.5-thrift-0.8.0.drv'...
unpacking sources
patching sources
configuring
no configure script, doing nothing
installing
buildFlags:
WARNING:  You build with buildroot.
  Build root: /
  Bin dir: /nix/store/ph4q87g4snpydi239sm2n4b6s1gch063-ruby2.5.5-thrift-0.8.0/lib/ruby/gems/2.5.0/bin
  Gem home: /nix/store/ph4q87g4snpydi239sm2n4b6s1gch063-ruby2.5.5-thrift-0.8.0/lib/ruby/gems/2.5.0
Building native extensions. This could take a while...
ERROR:  Error installing /nix/store/gw140sv942w31y3nv20z6g57kfkp0nqs-thrift-0.8.0.gem:
        ERROR: Failed to build gem native extension.

    current directory: /nix/store/ph4q87g4snpydi239sm2n4b6s1gch063-ruby2.5.5-thrift-0.8.0/lib/ruby/gems/2.5.0/gems/thrift-0.8.0/ext
/nix/store/ndj1xf013zgl6kmgvhhlgcv1d1b4zwfz-ruby-2.5.5/bin/ruby -r ./siteconf20190410-74726-b1cbbc.rb extconf.rb
checking for strlcpy() in string.h... yes
creating Makefile

current directory: /nix/store/ph4q87g4snpydi239sm2n4b6s1gch063-ruby2.5.5-thrift-0.8.0/lib/ruby/gems/2.5.0/gems/thrift-0.8.0/ext
make "DESTDIR=" clean

current directory: /nix/store/ph4q87g4snpydi239sm2n4b6s1gch063-ruby2.5.5-thrift-0.8.0/lib/ruby/gems/2.5.0/gems/thrift-0.8.0/ext
make "DESTDIR="
compiling binary_protocol_accelerated.c
compiling compact_protocol.c
compiling memory_buffer.c
compiling protocol.c
compiling strlcpy.c
In file included from strlcpy.c:20:
./strlcpy.h:28:15: error: expected parameter declarator
extern size_t strlcpy(char *, const char *, size_t);
              ^
/nix/store/mkfq1a1i6n66fahlcjvw890xj32zvlqp-Libsystem-osx-10.11.6/include/secure/_string.h:105:44: note: expanded from macro 'strlcpy'
  __builtin___strlcpy_chk (dest, src, len, __darwin_obsz (dest))
                                           ^
/nix/store/mkfq1a1i6n66fahlcjvw890xj32zvlqp-Libsystem-osx-10.11.6/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
/nix/store/mkfq1a1i6n66fahlcjvw890xj32zvlqp-Libsystem-osx-10.11.6/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
#    define _USE_FORTIFY_LEVEL 2
                               ^
In file included from strlcpy.c:20:
./strlcpy.h:28:15: error: expected ')'
...

The fix is probably to pass --with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value\" to gem install.

How do I pass that option to the thrift derivation?

@basvandijk
Copy link
Member Author

@alyssais you seem to have contributed a lot in this area. Do you have an idea how to fix this?

@basvandijk
Copy link
Member Author

I fixed it by passing the following to the thrift derivation:

buildFlags = [
  "--with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-macro-redefined -Wno-shift-negative-value\""
];

Now ideally, this should be conditional on the build platform being darwin...

@alyssais
Copy link
Member

@basvandijk
Copy link
Member Author

@alyssais thanks for pointing me to gem-config. I added an override for thrift and I can confirm fluentd now builds on both x86_64-linux and x86_64-darwin. I'll merge if ofborg agrees.

@basvandijk
Copy link
Member Author

I realise I should also make the override conditional on the version of thrift because I believe this has been fixed. So I'll add an extra && lib.versionAtLeast attrs.version "<version with a fix>" condition...

@alyssais
Copy link
Member

Sounds good to me.

@basvandijk basvandijk merged commit ed426e4 into NixOS:master Apr 10, 2019
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

4 participants