the-tcpdump-group / libpcap

the LIBpcap interface to various kernel packet capture mechanism
https://www.tcpdump.org/
Other
2.71k stars 853 forks source link

Error with flex command --header-file=NUL: #1227

Closed MonicaLiu0311 closed 1 year ago

MonicaLiu0311 commented 1 year ago

Using the flex command with --header-file=NUL: results in the following error:

error delete file C:\Users\AzDevOps\AppData\Local\Temp\~1_flex_5win_flex.exe: error deleting file C:\Users\AzDevOps\AppData\Local\Temp\~flex_out_main_2
CMake Error at CMakeLists.txt:2539 (message):
  D:/downloads/tools/win_flex/2.5.25/win_flex.exe is insufficient to compile
  libpcap.

  libpcap requires Flex 2.5.31 or later, or a compatible version of lex.

  If a suitable version of Lex/Flex is available as a non-standard command

  and/or not in the PATH, you can specify it using the LEX environment

  variable.  That said, on some systems the error can mean that Flex/Lex is

  actually acceptable, but m4 is not.  Likewise, if a suitable version of

  m4 (such as GNU M4) is available but has not been detected, you can

  specify it using the M4 environment variable.

Changing to --header-file=NULL can solve the issue. For details, see: https://github.com/microsoft/vcpkg/pull/34670.

guyharris commented 1 year ago

We do not appear to see this error when configuring with CMake on either Windows or any UN*X - it merely causes the header file to be written to the null device, as we don't care about any of Flex's output when doing that test, we just want to see whether it succeeds, or fails, trying to generate a scanner from scanner.l. See my comment in microsoft/vcpkg#34670.

MonicaLiu0311 commented 1 year ago

Thanks for your reply, I will disable the parallel configure to try to resolve it.

guyharris commented 1 year ago

As per this comment on microsoft/vcpkg#34670, this appears to be a WinFlex bug, which, as per my reply to that comment, may be fixed in the WinFlexBison repository but not in any release yet.

So not a libpcap bug.