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

test_tcp_port: ensure no type error on macOS #73

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

barracuda156
Copy link
Contributor

@barracuda156 barracuda156 commented Jan 17, 2024

This is a fix for possible type conflict arising apparently from Apple headers. There is no problem with the package code itself.

@barracuda156
Copy link
Contributor Author

This is the error I got originally:

/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c 000.init.c -o 000.init.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c test_tcp_port.c -o test_tcp_port.o
In file included from /usr/include/ppc/endian.h:121,
                 from /usr/include/machine/endian.h:35,
                 from /usr/include/netinet/in.h:90,
                 from test_tcp_port.c:8:
test_tcp_port.c: In function 'test_tcp_port':
test_tcp_port.c:18:37: error: 'u_int32_t' undeclared (first use in this function); did you mean 'uint32_t'?
   18 |   serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);  // all available interfaces
      |                                     ^~~~~~~~~~
test_tcp_port.c:18:37: note: each undeclared identifier is reported only once for each function it appears in
test_tcp_port.c:18:37: error: expected ')' before numeric constant
   18 |   serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);  // all available interfaces
      |                                     ^~~~~~~~~~
test_tcp_port.c:18:31: note: to match this '('
   18 |   serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);  // all available interfaces
      |                               ^~~~~
make: *** [test_tcp_port.o] Error 1
ERROR: compilation failed for package ‘port4me’

After the patch applied, build is fixed, and all tests pass:

--->  Extracting port4me_0.7.0.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-port4me/R-port4me/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/R-port4me/port4me_0.7.0.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
--->  Applying patches to R-port4me
--->  Applying 0001-test_tcp_port-ensure-no-type-error-on-macOS.patch
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-port4me/R-port4me/work/port4me" && /usr/bin/patch -p0 < '/opt/PPCSnowLeopardPorts/R/R-port4me/files/0001-test_tcp_port-ensure-no-type-error-on-macOS.patch'
patching file src/test_tcp_port.c
--->  Configuring R-port4me
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-port4me/R-port4me/work/port4me" && /opt/local/bin/R CMD build . --no-manual --no-build-vignettes --keep-empty-dirs 
* checking for file ‘./DESCRIPTION’ ... OK
* preparing ‘port4me’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking vignette meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘port4me_0.7.0.tar.gz’

--->  Building R-port4me
--->  Testing R-port4me
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-port4me/R-port4me/work/port4me/port4me.Rcheck’
* using R version 4.3.2 (2023-10-31)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-13 (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0
    GNU Fortran (MacPorts gcc12 12.3.0_3+stdlib_flag) 12.3.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* using option ‘--ignore-vignettes’
* checking for file ‘port4me/DESCRIPTION’ ... OK
* this is package ‘port4me’ version ‘0.7.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘port4me’ can be installed ... OK
* used C compiler: ‘gcc-mp-13 (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0’
* used SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking use of PKG_*FLAGS in Makefiles ... OK
* checking compiled code ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... SKIPPED
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘cli.R’
  Running ‘lcg-uniformity.R’
  Running ‘lcg.R’
  Running ‘odds-and-ends.R’
  Running ‘port4me,list.R’
  Running ‘port4me-uniformity.R’
  Running ‘port4me.R’
  Running ‘string_to_uint.R’
 OK
* checking PDF version of manual ... OK
* DONE

Status: OK

@barracuda156
Copy link
Contributor Author

I can also confirm that the patch works fine on Sonoma/aarch64:

--->  Testing R-port4me
* using log directory ‘/opt/local/var/macports/build/_opt_svacchanda_SonomaPorts_R_R-port4me/R-port4me/work/port4me/port4me.Rcheck’
* using R version 4.3.2 (2023-10-31)
* using platform: aarch64-apple-darwin23.2.0 (64-bit)
* R was compiled by
    clang version 15.0.7
    GNU Fortran (MacPorts gcc12 12.3.0_4+stdlib_flag) 12.3.0
* running under: macOS Sonoma 14.2.1
* using session charset: UTF-8
* using option ‘--ignore-vignettes’
* checking for file ‘port4me/DESCRIPTION’ ... OK
* this is package ‘port4me’ version ‘0.7.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘port4me’ can be installed ... OK
* used C compiler: ‘clang version 15.0.7’
* used SDK: ‘MacOSX14.2.sdk’
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking use of PKG_*FLAGS in Makefiles ... OK
* checking compiled code ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... SKIPPED
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘cli.R’
  Running ‘lcg-uniformity.R’
  Running ‘lcg.R’
  Running ‘odds-and-ends.R’
  Running ‘port4me,list.R’
  Running ‘port4me-uniformity.R’
  Running ‘port4me.R’
  Running ‘string_to_uint.R’
 OK

@HenrikBengtsson HenrikBengtsson merged commit 885568a into HenrikBengtsson:develop Jan 17, 2024
@barracuda156 barracuda156 deleted the fix_types branch January 17, 2024 23:16
@barracuda156
Copy link
Contributor Author

@HenrikBengtsson Thank you for merging!

HenrikBengtsson added a commit that referenced this pull request Feb 16, 2024
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.

None yet

2 participants