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

Build of testthat fails #1373

Closed
liheinz opened this issue May 3, 2021 · 8 comments · Fixed by #1403
Closed

Build of testthat fails #1373

liheinz opened this issue May 3, 2021 · 8 comments · Fixed by #1403

Comments

@liheinz
Copy link

liheinz commented May 3, 2021

When I try to build the current master it fails with
`
../inst/include/testthat/vendor/catch.h:6495:33: error: size of array ‘altStackMem’ is not an integral constant-expression

6495 | static char altStackMem[SIGSTKSZ];

size of array ‘altStackMem’ is not an integral constant-expression

6546 | char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};

`
With gcc version: 11.1.1

@liheinz
Copy link
Author

liheinz commented May 8, 2021

glibc changed SIGSTKSZ to be a syscall instead
of being constant. #catchorg/Catch2#2178

@Enchufa2
Copy link

Yeap, this is failing in Fedora rawhide with the latest glibc version.

@gavinsimpson
Copy link

This just bit me today trying to get R 4.1 on Fedora (which is only available on rawhide currently) set up so that I could resolve all the changes that were made to testthat and vdiffr with the latest release. Compiling testhat from source there failed with the same issues as reported by @linusheinz and @Enchufa2

@clauswilke
Copy link

Any suggestions on how to fix this?

@Enchufa2
Copy link

Enchufa2 commented Jun 24, 2021

Two options:

  • Change SIGSTKSZ with some fixed value (this is the quick&dirty patch we have in place for now in Fedora). Not very elegant nor portable. Not sure if this could cause trouble in some architectures.
  • Allocate the array dynamically with SIGSTKSZ, which is now a syscall. This is what many projects have been doing. See e.g. this.

@clauswilke
Copy link

Actually, looks like this has been fixed in the upstream code and it's just a matter of updating catch to the latest release: https://github.com/catchorg/Catch2/releases/tag/v2.13.5
(I'm linking to the release that has the fix. We're already one release past that.)

@Enchufa2
Copy link

Ah, I didn't realise it was vendored code. So that's it, you just need to update. :)

@jimhester
Copy link
Member

Unfortunately it is not entirely trivial to update the Catch code, as the current code uses Catch1, not Catch2, which has some breaking changes. The most significant of which is that Catch2 requires full support for C++11.

jimhester added a commit to jimhester/testthat that referenced this issue Jun 24, 2021
jimhester added a commit to jimhester/testthat that referenced this issue Jun 24, 2021
jimhester added a commit to jimhester/testthat that referenced this issue Jun 24, 2021
lionel- pushed a commit that referenced this issue Jun 30, 2021
lionel- pushed a commit that referenced this issue Jun 30, 2021
cana-rick pushed a commit to cana-rick/testthat that referenced this issue Sep 27, 2023
cesare-montresor added a commit to cesare-montresor/Matterport3DSimulator that referenced this issue Nov 5, 2023
Added building script for reference:
- docker-build.sh
- host-build.sh

Code ported to 2023:
- fixed opencv4
- fixed jsoncpp
- fixed typedef for pybind11 definitions
- fixed syscall issues related to SIGSTKSZ ( see more: r-lib/testthat#1373 (comment) )
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Dec 10, 2024
# isoband 0.2.7

- Remove compile-time dependency on testthat.

- Changed maintainer after the original author (Claus Wilke) donated codebase
  to r-lib.

isoband 0.2.6
----------------------------------------
- Update to the latest testthat headers for compatibility with
  LLVM clang 15.0.0.

- Correct label angle for current aspect ratio in `isolines_grob()`
  (#28, @eliocamp).


isoband 0.2.5
----------------------------------------
- Add a new label placer function `label_placer_middle()`
  (#24, @jamarav).

- The vendored testthat/catch code now uses a constant
  value for the stack size rather than relying on `SIGSTKSZ`.
  See: r-lib/testthat#1373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants