Skip to content

Conversation

@Empact
Copy link
Contributor

@Empact Empact commented Nov 8, 2018

As per https://github.com/emil-e/rapidcheck/blob/master/doc/boost_test.md
Boost Test integration is an "extra" and not guaranteed to be available
alongside rapidcheck itself. Checking for it in configure.ac avoids rapidcheck
being enabled when not fully available.

On my machine, before:

  checking rapidcheck.h usability... yes
  checking rapidcheck.h presence... yes
  checking for rapidcheck.h... yes
  [...]
  CXX      wallet/test/test_test_bitcoin-psbt_wallet_tests.o
  test/key_properties.cpp:16:10: fatal error: 'rapidcheck/boost_test.h' file not found
  #include <rapidcheck/boost_test.h>
           ^~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

After:

  checking rapidcheck.h usability... yes
  checking rapidcheck.h presence... yes
  checking for rapidcheck.h... yes
  checking rapidcheck/boost_test.h usability... no
  checking rapidcheck/boost_test.h presence... no
  checking for rapidcheck/boost_test.h... no

@Empact
Copy link
Contributor Author

Empact commented Nov 8, 2018

/cc @Christewart #12775

@Empact Empact force-pushed the rapidcheck-boost-test branch from 250aa1e to 34e61d6 Compare November 11, 2018 00:31
@Empact
Copy link
Contributor Author

Empact commented Nov 11, 2018

Update to fix given that AC_CHECK_HEADERS runs the positive case if any of the headers are present, and the negative case if any are missing.

@Christewart
Copy link
Contributor

This makes sense to me. Although in reality we probably want to figure out a way to cleanly install the extras package with cmake.

utack

@Empact Empact changed the title tests: Check for rapidcheck/boost_test.h header on use_rapidcheck=auto tests: Separately check for rapidcheck/boost_test.h in configure Dec 31, 2018
@laanwj laanwj requested a review from theuni January 19, 2019 18:45
@DrahtBot
Copy link
Contributor

The last travis run for this pull request was 278 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.

@DrahtBot DrahtBot closed this Aug 16, 2019
@DrahtBot DrahtBot reopened this Aug 16, 2019
Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

EDIT: Suspending my initial approval. This PR improves the situation for the case when neither --with-rapidcheck nor --without-rapidcheck is passed into the configure but rapidcheck.h is detected while rapidcheck/boost_test.h is missing, and the build fails when it tries to compile test/key_properties.cpp which has an #include <rapidcheck/boost_test.h>.

However, the PR also seems to cause a new issue: When boost_test.h is present and it runs fine when --with-rapidcheck is passed (and before this PR when no argument is passed), e.g.

CXX      test/test_bitcoin-key_properties.o
[...]
Running tests: key_properties from test/key_properties.cpp

then when no argument is passed to configure, the checks added in this PR return a false negative and the build does not compile rapidcheck when it otherwise should:

checking rapidcheck.h usability... yes
checking rapidcheck.h presence... yes
checking for rapidcheck.h... yes
checking rapidcheck/boost_test.h usability... no
checking rapidcheck/boost_test.h presence... yes
configure: WARNING: rapidcheck/boost_test.h: present but cannot be compiled
configure: WARNING: rapidcheck/boost_test.h:     check for missing prerequisite headers?
configure: WARNING: rapidcheck/boost_test.h: see the Autoconf documentation
configure: WARNING: rapidcheck/boost_test.h:     section "Present But Cannot Be Compiled"
configure: WARNING: rapidcheck/boost_test.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------------------- ##
configure: WARNING:     ## Report this to https://github.com/bitcoin/bitcoin/issues ##
configure: WARNING:     ## -------------------------------------------------------- ##

A couple of autoconf docs, for info:

https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Present-But-Cannot-Be-Compiled.html

https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Generic-Headers.html#Generic-Headers

As per https://github.com/emil-e/rapidcheck/blob/master/doc/boost_test.md
Boost Test integration is an "extra" and not guaranteed to be available
alongside rapidcheck itself. Checking for it in configure.ac avoids rapidcheck
being enabled when not fully available.

On my machine, before:

  checking rapidcheck.h usability... yes
  checking rapidcheck.h presence... yes
  checking for rapidcheck.h... yes
  [...]
  CXX      wallet/test/test_test_bitcoin-psbt_wallet_tests.o
  test/key_properties.cpp:16:10: fatal error: 'rapidcheck/boost_test.h' file not found
  #include <rapidcheck/boost_test.h>
           ^~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

After:
  checking rapidcheck/boost_test.h usability... no
  checking rapidcheck/boost_test.h presence... no
  checking for rapidcheck/boost_test.h... no

Note that as rapidcheck/boost_test.h includes rapidcheck.h, the default
compile test will also effectively test rapidcheck.h for presence and
usability.
@Empact Empact force-pushed the rapidcheck-boost-test branch from 34e61d6 to 0a7c5f0 Compare February 28, 2020 21:01
@Empact
Copy link
Contributor Author

Empact commented Feb 28, 2020

@jonatack could you give this another try? I changed the test to check only for rapidcheck/boost_test.h, on the theory that it's inclusion of rapidcheck.h will mean that rapidcheck/boost_test.h's compile test will also effectively test for rapidcheck.h.

@Christewart
Copy link
Contributor

This should probably be closed as of #18514

@fanquake fanquake closed this Apr 3, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants