-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
winpcap: add winpcap/4.1.3 recipe #6348
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
37fd012
to
8642532
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Did you write all the CMake files from scratch or does it come from a fork? |
I wrote them from scratch. |
I need to investigate why Windows is not built on c3i. |
def config_options(self): | ||
if self.settings.os == "Windows": | ||
del self.options.fPIC | ||
self.options.turbocap = True | ||
self.options.capture_type = "win32" | ||
elif self.settings.os == "Linux": | ||
self.options.capture_type = "linux" | ||
if self.settings.os != "Linux": | ||
del self.options.bluetooth | ||
del self.options.usb_sniffing | ||
del self.options.usb_sniffing_device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgsogo
c3i fails to build on MSVC@Windows.
See #6348 (comment)
c3i says my recipe emits an ConanInvalidConfiguration
when os=Windows
(the logs don't tell me).
The values inside default_options
are indeed invalid on Windows,
but they are converted to valid options in config_options
.
/* prototype of the packet handler */ | ||
void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); | ||
|
||
int main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test package is interactive. It should be made non-interactive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIXME: borrow test package from bincrafters/community#1395
recipes/winpcap/all/conanfile.py
Outdated
if tools.os_info.is_windows: | ||
self.build_requires("winflexbison/2.5.24") | ||
else: | ||
self.build_requires("bison/3.7.1") | ||
self.build_requires("flex/2.6.4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is the issue with windows, because it is first evaluated on a linux machine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's a build requirement. I thought those didn't influence the package id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be more robust (2 profiles in the first condition, 1 profile in the second):
if (hasattr(self, "settings_build") and self.settings_build.os == "Windows) or (not hasattr(self, "settings_build") and self.settings.os == "Windows")
When 1 profile will behave like 2 profiles, it could be replaced by self.settings_build.os == "Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Let's try the settings_build
approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's a build requirement. I thought those didn't influence the package id?
Not related to package id. In CI of CCI, a linux machine runs some tests first, and tools.os_info.is_windows
is always False. @jgsogo can explain better than me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. In CCI we first compute the packageIDs for all the configurations (this computation runs on a Linux machine) so we can remove duplicates and those that are invalid-config. Then, we will use win/linux/mac nodes to build the libraries.
If (running in Linux) Conan computes an invalid-config for a given configuration (a Windows one) we won't try to build that configuration, we will just report it is invalid. For this reason, it is very important that everything used in a recipe is provided as input (via profiles) and nothing is guessed... and this is mandatory for the source lines that are executed while computed the package-id in the Linux machine (tomorrow it could be a Windows node or Macos).
Although build-requires will not affect the package-id, while computing if it is a valid configuration, we also take into account the build-requires that will be required to build. If these build-requires are not available, then the configuration is also removed.
TL;DR; toos.os_info
is evil outside build step (build()
always takes place in the build machine).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reply.
I know you had to write this message a lot already. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this go in the FAQ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See conan-io/hooks#320 for a first attempt to implement this into a hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! this is supper helpful to have and know
Failure in build 7 (
Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability. |
del self.options.fPIC | ||
self.options.turbocap = True | ||
self.options.capture_type = "win32" | ||
elif self.settings.os == "Linux": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@madebr WinPcap is for Windows only. It's actually a Windows port of libpcap which is not available on Windows. For Linux/macOS the libpcap Conan package should be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I'll look into stripping everything non-Windows related.
#ifdef HAVE_REMOTE | ||
#include <pcap-remote.h> | ||
#endif | ||
+#ifdef NEED_LINUX_SOCKIOS_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad file extension
raise ConanInvalidConfiguration("missing turbocap cci recipe") | ||
|
||
def build_requirements(self): | ||
if self._build_os == "Windows": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIXME: add _settings_build
property method
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions. |
@madebr the PR was closed :( |
Specify library name and version: winpcap/4.1.3
ndis/types.h
). Feedback welcome.Closes bincrafters/community#1395
conan-center hook activated.