Fix `osquery` build

34 views
Skip to first unread message

Maximilian Bosch

unread,
Apr 18, 2018, 9:34:39 AM4/18/18
to nix-...@googlegroups.com
Hi,

as seen in the affected bugticket (https://github.com/NixOS/nixpkgs/issues/38940) I attempted
to fix the broken build of `nixpkgs.osquery` (which has been marked
as broken on `master` and `release-18.03` by @xeji).

My efforts can be reviewed on the following branch: https://github.com/Ma27/nixpkgs/tree/fix-osquery

I managed to get the package building by upgrading to the latest 3.x
(which contains several GCC fixes in upstream, before that it was needed to mess
even more around in the CMakeLists.txt, see `misc.patch` for further
reference). Unfortunately the package isn't functional ATM since the
linking of `gflags` seems to be broken, I'm not sure why, but it
complains about duplicated flags, so it seems as I accidentally broke it
in my CMake patches.

Unfortunately I lack sufficient time and knowledge for further investigation, so I'm
notifying you guys for some awareness, in case someone wants to take
over, my changes could help at least a bit :-)

Best regards,

Maximilian Bosch
signature.asc

Anthony Cowley

unread,
Apr 18, 2018, 12:26:03 PM4/18/18
to nix-...@googlegroups.com, Maximilian Bosch

Maximilian Bosch writes:

> Hi,
>
> as seen in the affected bugticket (https://github.com/NixOS/nixpkgs/issues/38940) I attempted
> to fix the broken build of `nixpkgs.osquery` (which has been marked
> as broken on `master` and `release-18.03` by @xeji).
>
> My efforts can be reviewed on the following branch: https://github.com/Ma27/nixpkgs/tree/fix-osquery
>
> I managed to get the package building by upgrading to the latest 3.x
> (which contains several GCC fixes in upstream, before that it was needed to mess
> even more around in the CMakeLists.txt, see `misc.patch` for further
> reference). Unfortunately the package isn't functional ATM since the
> linking of `gflags` seems to be broken, I'm not sure why, but it
> complains about duplicated flags, so it seems as I accidentally broke it
> in my CMake patches.

Regarding the `gflags` linking issue. I worked around what was probably the same problem just the other day by using this derivation as a dependency rather than `gflags`:

```
google-gflags-dyn = google-gflags.overrideAttrs (old: {
cmakeFlags = lib.filter (f: isNull (builtins.match ".*STATIC.*" f)) old.cmakeFlags;
});
```

It produces a google-gflags (which is the same repo as the nixpkgs `gflags` definition) without building static libraries. The linking error I saw mentioning a duplicated flags file, and perhaps what you've encountered, is due to linking both static and dynamic libraries. I don't think this is very elegant Nix code, but it should convey the general idea.

Hope that helps,
Anthony

Silvan Mosberger

unread,
Apr 18, 2018, 12:35:49 PM4/18/18
to Maximilian Bosch, nix-...@googlegroups.com
You seem to have overcome this, but for reference, I tried to update osquery too a couple weeks ago but couldn't even get it to build (I was close though). I opened an issue for osquery but they didn't know anything either: https://github.com/facebook/osquery/issues/4257

I did get to fix the rocksdb-lite derivation for osquery though (already merged).

Am also be interested in getting this package to work again.

Silvan
--
You received this message because you are subscribed to the Google Groups "nix-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nix-devel+...@googlegroups.com.
To post to this group, send email to nix-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nix-devel/20180418133436.kqbbyqr2l7ih2u65%40hauptshuhle.
For more options, visit https://groups.google.com/d/optout.

Maximilian Bosch

unread,
Apr 22, 2018, 10:22:38 AM4/22/18
to nix-...@googlegroups.com
Hi,

this sounds indeed quite promising, thanks!

I hope that I might have some time next week to try this out :-)

Regards,

Maximilian
> --
> You received this message because you are subscribed to the Google Groups "nix-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to nix-devel+...@googlegroups.com.
> To post to this group, send email to nix-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/nix-devel/m2h8o8zdk7.fsf%40huntsman-ve507-0711.apn.wlan.upenn.edu.
signature.asc

Maximilian Bosch

unread,
Apr 22, 2018, 3:48:16 PM4/22/18
to nix-...@googlegroups.com
Hi!

There's finally an open PR for `osquery` ready for review: https://github.com/NixOS/nixpkgs/pull/39336

The last issue which was related to a linking issue of `gflags` could've
been solved with the support of Anthony, thanks a lot!

Best regards,

Maximilian
signature.asc
Reply all
Reply to author
Forward
0 new messages