Skip to content

Commit

Permalink
(#23677) metall: add version 0.28
Browse files Browse the repository at this point in the history
* metall: add version 0.28

* check glibc version

* Move glibc check to validate_build

---------

Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
  • Loading branch information
toge and AbrilRBS authored Jun 11, 2024
1 parent a65a3f8 commit c4a71fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions recipes/metall/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.28":
url: "https://github.com/LLNL/metall/archive/refs/tags/v0.28.tar.gz"
sha256: "770dedb7f8220c333688b232a22104ca9d8d5823e7a8a21152b58ef970eb85d0"
"0.27":
url: "https://github.com/LLNL/metall/archive/refs/tags/v0.27.tar.gz"
sha256: "6e6f17a760778f9162def939701f9381a75e5275fd1eb1b2af4b2e89e86e1c58"
Expand Down
13 changes: 12 additions & 1 deletion recipes/metall/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
import os
import platform

required_conan_version = ">=1.50.0"

Expand Down Expand Up @@ -36,13 +37,18 @@ def requirements(self):
def package_id(self):
self.info.clear()

@property
def _is_glibc_older_than_2_27(self):
libver = platform.libc_ver()
return self.settings.os == 'Linux' and libver[0] == 'glibc' and Version(libver[1]) < "2.27"

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 17)

if self.settings.os not in ["Linux", "Macos"]:
raise ConanInvalidConfiguration(
"Metall requires some POSIX functionalities like mmap.")
f"{self.ref} requires some POSIX functionalities like mmap.")

def lazy_lt_semver(v1, v2):
lv1 = [int(v) for v in v1.split(".")]
Expand All @@ -56,6 +62,11 @@ def lazy_lt_semver(v1, v2):
raise ConanInvalidConfiguration(
"{} {} requires C++17, which your compiler does not support.".format(self.name, self.version))

def validate_build(self):
if Version(self.version) >= "0.28" and self._is_glibc_older_than_2_27:
raise ConanInvalidConfiguration(
f"{self.ref} requires copy_file_range() which is available since glibc 2.27.")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

Expand Down
2 changes: 2 additions & 0 deletions recipes/metall/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.28":
folder: all
"0.27":
folder: all
"0.26":
Expand Down

0 comments on commit c4a71fa

Please sign in to comment.