Skip to content

Conversation

@aitap
Copy link
Member

@aitap aitap commented Dec 25, 2025

POSIX says:

The <signal.h> header shall define the siginfo_t type as a structure

So <sys/wait.h> is not enough to see the definition (not just a forward declaration) of siginfo_t.

Fixes: #7516

Tested manually on FreeBSD:

Details
$ R CMD check data.table_1.18.99.tar.gz --no-manual

* using R version 4.5.1 (2025-06-13)                                                   
* using platform: amd64-portbld-freebsd15.0                                            
* R was compiled by                                                                                                                                                            
    FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
    GNU Fortran (FreeBSD Ports Collection) 13.3.0                                      
* running under: FreeBSD freebsd 15.0-RELEASE FreeBSD 15.0-RELEASE releng/15.0-n280995-7aedc8de6446 GENERIC amd64
* checking whether package ‘data.table’ can be installed ... OK                        
* used C compiler: ‘FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)’                                                    
* checking compiled code ... NOTE                                                      
File ‘data.table/libs/data_table.so’:   
  Found non-API calls to R: ‘IS_GROWABLE’, ‘LEVELS’, ‘SETLENGTH’,
    ‘SET_GROWABLE_BIT’, ‘SET_TRUELENGTH’, ‘TRUELENGTH’, ‘XTRUELENGTH’
Status: 1 NOTE                                                                         

...and OpenBSD:

Details
$ LANG=C.UTF-8 R CMD check data.table_1.18.99.tar.gz --no-manual

* R was compiled by                                                                    
    egcc (GCC) 8.4.0                                                                   
    GNU Fortran (GCC) 8.4.0                                                            
* running under: OpenBSD openbsd.my.domain 7.8 GENERIC#54 amd64                        

* checking whether package ‘data.table’ can be installed ... OK
* used C compiler: ‘OpenBSD clang version 19.1.7’

Status: OK

Also tested on GNU/Linux with PKG_CFLAGS=--std=c99.

@jszhao, could you please pull from this branch (posix_siginfo_t) and run R CMD build, then install the resulting tarball?

POSIX says:

> The <signal.h> header shall define the siginfo_t type as a structure

So <sys/wait.h> is not enough to see the definition (not just a forward
declaration) of siginfo_t.
@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.97%. Comparing base (a29c209) to head (baaf8ca).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7517   +/-   ##
=======================================
  Coverage   98.97%   98.97%           
=======================================
  Files          87       87           
  Lines       16740    16740           
=======================================
  Hits        16568    16568           
  Misses        172      172           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

NEWS.md Outdated

### BUG FIXES

1. Fixed the compilation failure on FreeBSD due to an `#include` directive missing in v1.18.0, [#7516](https://github.com/rdatatable/data.table/issues/7516). Thanks to @jszhao for the report and @aitap for the fix.
Copy link
Member

Choose a reason for hiding this comment

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

i guess a better description is "failure in some strict environments, e.g. FreeBSD, due..." WDYT?

Maybe worth mentioning the POSIX compliance aspect too?

@github-actions
Copy link

github-actions bot commented Dec 25, 2025

  • HEAD=posix_siginfo_t stopped early for DT[by,verbose=TRUE] improved in #6296
    Comparison Plot

Generated via commit baaf8ca

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 2 minutes and 46 seconds
Installing different package versions 22 seconds
Running and plotting the test cases 4 minutes and 5 seconds

@@ -1,6 +1,7 @@
#ifndef _WIN32
# define _POSIX_C_SOURCE 200809L // required for POSIX (not standard C) features in is_direct_child e.g. 'siginfo_t'
# include <sys/wait.h>
Copy link
Member

Choose a reason for hiding this comment

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

# if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
#  undef _POSIX_C_SOURCE
#  define _POSIX_C_SOURCE 200809L
# endif

for robustness

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 this pull request may close these issues.

data.table 1.18.0 could not be installed on FreeBSD

3 participants