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

Fix windows build failures #19182

Merged
merged 1 commit into from
May 14, 2024

Conversation

adfoster-r7
Copy link
Contributor

@adfoster-r7 adfoster-r7 commented May 14, 2024

Disables the windows server 2022 test build due to the following pcaprub compilation issues, this is a temporary solution for now:

current directory:
D:/a/metasploit-framework/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/pcaprub-0.13.2/ext/pcaprub_c
make.exe DESTDIR\= clean

current directory:
D:/a/metasploit-framework/metasploit-framework/vendor/bundle/ruby/3.0.0/gems/pcaprub-0.13.2/ext/pcaprub_c
make.exe DESTDIR\=
generating pcaprub_c-x64-mingw32.def
compiling pcaprub.c
In file included from C:/WpdPack/include/pcap/pcap.h:41,
                 from C:/WpdPack/include/pcap.h:45,
                 from pcaprub.c:11:
C:/WpdPack/include/pcap-stdinc.h:64:9: warning: "snprintf" redefined
   64 | #define snprintf _snprintf
      |         ^~~~~~~~
In file included from
C:/hostedtoolcache/windows/Ruby/3.0.5/x64/include/ruby-3.0.0/ruby/ruby.h:144,
from
C:/hostedtoolcache/windows/Ruby/3.0.5/x64/include/ruby-3.0.0/ruby.h:38,
                 from pcaprub.c:1:
C:/hostedtoolcache/windows/Ruby/3.0.5/x64/include/ruby-3.0.0/ruby/subst.h:14:9:
note: this is the location of the previous definition
   14 | #define snprintf ruby_snprintf
      |         ^~~~~~~~
C:/WpdPack/include/pcap-stdinc.h:65:9: warning: "vsnprintf" redefined
   65 | #define vsnprintf _vsnprintf
      |         ^~~~~~~~~
C:/hostedtoolcache/windows/Ruby/3.0.5/x64/include/ruby-3.0.0/ruby/subst.h:15:9:
note: this is the location of the previous definition
   15 | #define vsnprintf ruby_vsnprintf
      |         ^~~~~~~~~
pcaprub.c: In function 'rbpcap_each_data':
pcaprub.c:984:9: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
  984 |   fno = (int)pcap_getevent(rbp->pd);
      |         ^
pcaprub.c:984:7: error: assignment to 'HANDLE' {aka 'void *'} from 'int' makes
pointer from integer without a cast [-Wint-conversion]
  984 |   fno = (int)pcap_getevent(rbp->pd);
      |       ^
pcaprub.c: In function 'rbpcap_each_packet':
pcaprub.c:1026:9: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
 1026 |   fno = (int)pcap_getevent(rbp->pd);
      |         ^
pcaprub.c:1026:7: error: assignment to 'HANDLE' {aka 'void *'} from 'int' makes
pointer from integer without a cast [-Wint-conversion]
 1026 |   fno = (int)pcap_getevent(rbp->pd);
      |       ^
pcaprub.c: In function 'rbpcap_thread_wait_handle':
pcaprub.c:1266:7: error: passing argument 1 of 'rb_thread_call_without_gvl' from
incompatible pointer type [-Wincompatible-pointer-types]
 1266 |       rbpcap_thread_wait_handle_blocking,
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |       |
      |       VALUE (*)(void *) {aka long long unsigned int (*)(void *)}
In file included from pcaprub.c:4:
C:/hostedtoolcache/windows/Ruby/3.0.5/x64/include/ruby-3.0.0/ruby/thread.h:24:42:
note: expected 'void * (*)(void *)' but argument is of type 'VALUE (*)(void *)'
{aka 'long long unsigned int (*)(void *)'}
   24 | void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
      |                                  ~~~~~~~~^~~~~~~~~~~~~
make: *** [Makefile:246: pcaprub.o] Error 1

Upstream pull request to wait for a new release: pcaprub/pcaprub#68

Verification

Ensure CI passes

@adfoster-r7 adfoster-r7 added the rn-no-release-notes no release notes label May 14, 2024
@dwelch-r7 dwelch-r7 merged commit f6e7aac into rapid7:master May 14, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-no-release-notes no release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants