Skip to content

Commit

Permalink
Fix bare self.version comparisions in CCI (#26143)
Browse files Browse the repository at this point in the history
* Fix self.version string comparisons

* Fix pcapplusplus 21.x cross-compilation by fixing typo in patch
  • Loading branch information
AbrilRBS authored Dec 10, 2024
1 parent 9175977 commit 879e140
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion recipes/orc/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _compilers_minimum_version(self):

@property
def _should_patch_thirdparty_toolchain(self):
return self.version < "2.0.0"
return Version(self.version) < "2.0.0"

def export_sources(self):
if self._should_patch_thirdparty_toolchain:
Expand Down
7 changes: 4 additions & 3 deletions recipes/pcapplusplus/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from conan.tools.gnu import Autotools, AutotoolsToolchain
from conan.tools.layout import basic_layout
from conan.tools.microsoft import is_msvc, unix_path, MSBuild, MSBuildToolchain
from conan.tools.scm import Version
from conan.errors import ConanInvalidConfiguration

required_conan_version = ">=1.57.0"
Expand Down Expand Up @@ -43,7 +44,7 @@ def layout(self):
def requirements(self):
if self.settings.os == "Windows":
self.requires("npcap/1.70")
if self.version < "22.11":
if Version(self.version) < "22.11":
self.requires("pthreads4w/3.0.0")
else:
self.requires("libpcap/1.10.1")
Expand Down Expand Up @@ -122,7 +123,7 @@ def _build_windows(self):
"--pcap-sdk", self.dependencies["npcap"].package_folder,
"--vs-version", "vs2015", # this will be later overridden by the props file generated by MSBuildToolchain
]
if self.version < "22.11":
if Version(self.version) < "22.11":
config_args += ["--pthreads-home", self.dependencies["pthreads4w"].package_folder]
self.run(" ".join(config_args), env="conanbuild")
msbuild = MSBuild(self)
Expand All @@ -137,7 +138,7 @@ def package(self):

def package_info(self):
self.cpp_info.libs = ["Pcap++", "Packet++", "Common++"]
if self.version < "22.11" and self.settings.os in ("FreeBSD", "Linux"):
if Version(self.version) < "22.11" and self.settings.os in ("FreeBSD", "Linux"):
self.cpp_info.system_libs.append("pthread")
if self.settings.os == "Macos":
self.cpp_info.frameworks.extend(["CoreFoundation", "Security", "SystemConfiguration"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Obj/%.o: LightPcapNg/src/%.c
@echo Building file: $<
- @$(CC) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<"
+ @$(CC) $(CPPFLAGS) $(CLFAGS) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<"
+ @$(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) -Wall -O2 $(GLOBAL_FLAGS) $(DEFS) -g -c -o "$@" "$<"

CUR_TARGET := $(notdir $(shell pwd))

Expand Down
6 changes: 3 additions & 3 deletions recipes/quantlib/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def requirements(self):

def validate(self):
if self.info.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 14 if self.version >= "1.24" else 11)
check_min_cppstd(self, 14 if Version(self.version) >= "1.24" else 11)
if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < "5":
raise ConanInvalidConfiguration("gcc < 5 not supported")
if self.version >= "1.24" and is_msvc(self) and self.options.shared:
if Version(self.version) >= "1.24" and is_msvc(self) and self.options.shared:
raise ConanInvalidConfiguration("MSVC DLL build is not supported by upstream")

def source(self):
Expand All @@ -61,7 +61,7 @@ def generate(self):
tc = CMakeToolchain(self)
# Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840)
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
if self.version >= "1.24":
if Version(self.version) >= "1.24":
tc.cache_variables["QL_BUILD_BENCHMARK"] = False
tc.cache_variables["QL_BUILD_EXAMPLES"] = False
tc.cache_variables["QL_BUILD_TEST_SUITE"] = False
Expand Down
3 changes: 2 additions & 1 deletion recipes/quickjs/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from conan.tools.files import get, copy
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.microsoft import is_msvc
from conan.tools.scm import Version
from conan.errors import ConanInvalidConfiguration

import os
Expand Down Expand Up @@ -35,7 +36,7 @@ def export_sources(self):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
if self.version >= "2023-12-09":
if Version(self.version) >= "2023-12-09":
del self.options.use_bignum

def configure(self):
Expand Down

0 comments on commit 879e140

Please sign in to comment.