Skip to content

Add ./configure --disable-tests option#7901

Merged
edolstra merged 3 commits intoNixOS:masterfrom
hercules-ci:disable-tests
Mar 2, 2023
Merged

Add ./configure --disable-tests option#7901
edolstra merged 3 commits intoNixOS:masterfrom
hercules-ci:disable-tests

Conversation

@roberth
Copy link
Member

@roberth roberth commented Feb 24, 2023

Motivation

Make incremental progress towards a more testable Nix.

Context

From the commit message:

Building without tests is useful for bootstrapping with a smaller footprint or running the tests in a separate derivation. Otherwise, we do compile and run them.

This isn't fine grained as to allow picking check but not installcheck or vice versa, but it's good enough for now.

I've tried to use Nixpkgs' checkInputs, but those inputs weren't discovered properly by the configure script. We can emulate its behavior very well though.

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

Building without tests is useful for bootstrapping with a smaller footprint
or running the tests in a separate derivation. Otherwise, we do compile and
run them.

This isn't fine grained as to allow picking `check` but not `installcheck`
or vice versa, but it's good enough for now.

I've tried to use Nixpkgs' `checkInputs`, but those inputs weren't discovered
properly by the configure script. We can emulate its behavior very well though.
@roberth roberth requested a review from edolstra as a code owner February 24, 2023 08:53
@fricklerhandwerk fricklerhandwerk added the contributor-experience Developer experience for Nix contributors label Feb 24, 2023
@thufschmitt thufschmitt self-requested a review February 25, 2023 12:47
This always forces the setting, rather than relying on its default, and cleans up the code a bit.

Co-authored-by: John Ericson <[email protected]>
@edolstra edolstra merged commit 96111ad into NixOS:master Mar 2, 2023
@edolstra
Copy link
Member

edolstra commented Mar 2, 2023

@roberth Looks like this broke make check in nix develop:

$ make check -j24
...
src/libutil/tests/hash.cc:5:10: fatal error: rapidcheck/gtest.h: No such file or directory
    5 | #include <rapidcheck/gtest.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [mk/patterns.mk:3: src/libutil/tests/hash.o] Error 1

and $configureFlags does not contain the CXXFLAGS for extras/gtest/include.

@edolstra
Copy link
Member

edolstra commented Mar 2, 2023

#7943 fixes that.

@Ericson2314 Ericson2314 mentioned this pull request Mar 6, 2023
7 tasks
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-team-report-2022-10-2023-03/27486/1

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

Labels

contributor-experience Developer experience for Nix contributors

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants