Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] check dynamic symbol versions at CI side (#1812)
* renamed helper folder to helpers * added library dependencies check
- Loading branch information
1 parent
4570fc9
commit dfe0fae
Showing
6 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# coding: utf-8 | ||
"""Helper script for checking versions in the dynamic symbol table. | ||
This script checks that LightGBM library is linked to the appropriate symbol versions. | ||
""" | ||
import re | ||
import sys | ||
|
||
|
||
def check_dependicies(objdump_string): | ||
"""Check the dynamic symbol versions. | ||
Parameters | ||
---------- | ||
objdump_string : string | ||
The dynamic symbol table entries of the file (result of `objdump -T` command). | ||
""" | ||
GLIBC_version = re.compile(r'0{16}[ \t]+GLIBC_(\d{1,2})[.](\d{1,3})[.]?\d{,3}[ \t]+') | ||
versions = GLIBC_version.findall(objdump_string) | ||
assert len(versions) > 1 | ||
for major, minor in versions: | ||
assert int(major) <= 2 | ||
assert int(minor) <= 14 | ||
|
||
GLIBCXX_version = re.compile(r'0{16}[ \t]+GLIBCXX_(\d{1,2})[.](\d{1,2})[.]?(\d{,3})[ \t]+') | ||
versions = GLIBCXX_version.findall(objdump_string) | ||
assert len(versions) > 1 | ||
for major, minor, patch in versions: | ||
assert int(major) == 3 | ||
assert int(minor) == 4 | ||
assert patch == '' or int(patch) <= 19 | ||
|
||
GOMP_version = re.compile(r'0{16}[ \t]+G?OMP_(\d{1,2})[.](\d{1,2})[.]?\d{,3}[ \t]+') | ||
versions = GOMP_version.findall(objdump_string) | ||
assert len(versions) > 1 | ||
for major, minor in versions: | ||
assert int(major) == 1 | ||
assert int(minor) == 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
with open(sys.argv[1], 'r') as f: | ||
check_dependicies(f.read()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters