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

osquery: fix build #55690

Merged
merged 2 commits into from
Feb 15, 2019
Merged

osquery: fix build #55690

merged 2 commits into from
Feb 15, 2019

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Feb 13, 2019

Motivation for this change

Fixing osquery required the following changes:

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

The build missed `openssl` as input and failed with an error like this:

```
/nix/store/7n1h80xkbjhcijzp0iylk0nc7w05vy8k-net-snmp-5.8/include/net-snmp/library/scapi.h:14:10: fatal error: openssl/ossl_typ.h: No such file or directory
 #include <openssl/ossl_typ.h> /* EVP_MD */
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
```

This also unbreaks `osquery` (https://hydra.nixos.org/build/88547811).

See also https://hydra.nixos.org/build/88562937
We use `dpkg` 1.19.2 since 2366125.
This version dropped pkg_db_reset` in  `<dpkg/dpkg_db.h>` which broke compilation with the
following errors:

```
/build/source/osquery/tables/system/linux/deb_packages.cpp: In function 'void osquery::tables::dpkg_setup(pkg_array*)':
/build/source/osquery/tables/system/linux/deb_packages.cpp:83:3: error: 'pkg_array_init_from_db' was not declared in this scope
   pkg_array_init_from_db(packages);
   ^~~~~~~~~~~~~~~~~~~~~~
/build/source/osquery/tables/system/linux/deb_packages.cpp:83:3: note: suggested alternative: 'pkg_array_init_from_hash'
   pkg_array_init_from_db(packages);
   ^~~~~~~~~~~~~~~~~~~~~~
   pkg_array_init_from_hash
/build/source/osquery/tables/system/linux/deb_packages.cpp: In function 'void osquery::tables::dpkg_teardown(pkg_array*)':
/build/source/osquery/tables/system/linux/deb_packages.cpp:93:3: error: 'pkg_db_reset' was not declared in this scope
   pkg_db_reset();
   ^~~~~~~~~~~~
/build/source/osquery/tables/system/linux/deb_packages.cpp:93:3: note: suggested alternative: 'pkg_hash_reset'
   pkg_db_reset();
   ^~~~~~~~~~~~
   pkg_hash_reset
make[2]: *** [osquery/tables/CMakeFiles/osquery_system_tables.dir/build.make:115: osquery/tables/CMakeFiles/osquery_system_tables.dir/system/linux/deb_packages.cpp.o] Error 1
```

As there's currently no upstream fix, it's better to use an older
version of `dpkg` for now.
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 labels Feb 13, 2019
@offlinehacker offlinehacker merged commit 2912c1c into NixOS:master Feb 15, 2019
@Ma27 Ma27 deleted the fix-osquery branch February 15, 2019 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants