Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
ed1771c3
Unverified
Commit
ed1771c3
authored
Nov 29, 2022
by
James Lamb
Committed by
GitHub
Nov 28, 2022
Browse files
[ci] add docs and specific error messages in check_dynamic_dependencies.py (#5582)
parent
24af9fa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
helpers/check_dynamic_dependencies.py
helpers/check_dynamic_dependencies.py
+21
-9
No files found.
helpers/check_dynamic_dependencies.py
View file @
ed1771c3
...
...
@@ -2,13 +2,22 @@
"""Helper script for checking versions in the dynamic symbol table.
This script checks that LightGBM library is linked to the appropriate symbol versions.
Linking to newer symbol versions at compile time is problematic because it could result
in built artifacts being unusable on older platforms.
Version history for these symbols can be found at the following:
* GLIBC: https://sourceware.org/glibc/wiki/Glibc%20Timeline
* GLIBCXX: https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
* OMP/GOMP: https://github.com/gcc-mirror/gcc/blob/master/libgomp/libgomp.map
"""
import
re
import
sys
from
pathlib
import
Path
def
check_depend
i
cies
(
objdump_string
:
str
)
->
None
:
def
check_depend
en
cies
(
objdump_string
:
str
)
->
None
:
"""Check the dynamic symbol versions.
Parameters
...
...
@@ -20,24 +29,27 @@ def check_dependicies(objdump_string: str) -> None:
versions
=
GLIBC_version
.
findall
(
objdump_string
)
assert
len
(
versions
)
>
1
for
major
,
minor
in
versions
:
assert
int
(
major
)
<=
2
assert
int
(
minor
)
<=
28
error_msg
=
f
"found unexpected GLIBC version: '
{
major
}
.
{
minor
}
'"
assert
int
(
major
)
<=
2
,
error_msg
assert
int
(
minor
)
<=
28
,
error_msg
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
)
<=
22
error_msg
=
f
"found unexpected GLIBCXX version: '
{
major
}
.
{
minor
}
.
{
patch
}
'"
assert
int
(
major
)
==
3
,
error_msg
assert
int
(
minor
)
==
4
,
error_msg
assert
patch
==
''
or
int
(
patch
)
<=
22
,
error_msg
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
)
<=
4
assert
int
(
minor
)
<=
5
error_msg
=
f
"found unexpected OMP/GOMP version: '
{
major
}
.
{
minor
}
'"
assert
int
(
major
)
<=
4
,
error_msg
assert
int
(
minor
)
<=
5
,
error_msg
if
__name__
==
"__main__"
:
check_depend
i
cies
(
Path
(
sys
.
argv
[
1
]).
read_text
(
encoding
=
'utf-8'
))
check_depend
en
cies
(
Path
(
sys
.
argv
[
1
]).
read_text
(
encoding
=
'utf-8'
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment