Skip to content

Commit 05533eb

Browse files
committed
wip bintar deps step2
1 parent c063861 commit 05533eb

File tree

4 files changed

+205
-160
lines changed

4 files changed

+205
-160
lines changed

runtime_config/bintar_deps/deps_11.8.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ files:
4848
- libm.so.6
4949
- libpthread.so.0
5050
- libstdc++.so.6
51+
bin/garbd:
52+
- ld-linux-x86-64.so.2
53+
- libboost_program_options.so.1.52.0
54+
- libc.so.6
55+
- libcrypto.so.1.0.0
56+
- libgcc_s.so.1
57+
- libm.so.6
58+
- libpthread.so.0
59+
- librt.so.1
60+
- libssl.so.1.0.0
61+
- libstdc++.so.6
5162
bin/innochecksum:
5263
- ld-linux-x86-64.so.2
5364
- libc.so.6
@@ -306,6 +317,16 @@ files:
306317
- libpthread.so.0
307318
- libsnappy.so.1
308319
- libstdc++.so.6
320+
lib/libgalera_smm.so:
321+
- ld-linux-x86-64.so.2
322+
- libc.so.6
323+
- libcrypto.so.1.0.0
324+
- libgcc_s.so.1
325+
- libm.so.6
326+
- libpthread.so.0
327+
- librt.so.1
328+
- libssl.so.1.0.0
329+
- libstdc++.so.6
309330
lib/libmariadb.so.3:
310331
- ld-linux-x86-64.so.2
311332
- libc.so.6
@@ -325,7 +346,6 @@ files:
325346
- libc.so.6
326347
- libgssapi_krb5.so.2
327348
- libkrb5.so.3
328-
- libpthread.so.0
329349
lib/plugin/auth_gssapi_client.so:
330350
- libc.so.6
331351
- libcom_err.so.2
@@ -522,6 +542,10 @@ files:
522542
lib/plugin/mysql_clear_password.so:
523543
- libc.so.6
524544
- libpthread.so.0
545+
lib/plugin/parsec.so:
546+
- ld-linux-x86-64.so.2
547+
- libc.so.6
548+
- libpthread.so.0
525549
lib/plugin/password_reuse_check.so:
526550
- libc.so.6
527551
- libpthread.so.0

scripts/bintars/common.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ def run_command(command):
5959
return None
6060

6161

62-
def _unpack_archive(tarball_path: str, dst_path: str):
62+
def _unpack_archive(tarball_path: Path, dst_path: Path):
6363
logging.info(f"Extracting archive {tarball_path}")
64-
with tarfile.open(tarball_path, 'r:*') as tar:
65-
tar.extractall(path=dst_path, filter='fully_trusted')
64+
with tarfile.open(str(tarball_path), 'r:*') as tar:
65+
tar.extractall(path=str(dst_path), filter='fully_trusted')
6666

6767

68-
def _parse_archive_path(archive_path: str) -> Tuple[str, str]:
69-
archive_name = os.path.basename(archive_path)
68+
def _parse_archive_path(archive_path: Path) -> Tuple[str, str]:
69+
archive_name = archive_path.name
7070

7171
# Removes the last extension (e.g., .gz)
7272
base_name = Path(archive_name).stem
@@ -89,23 +89,23 @@ def _parse_archive_path(archive_path: str) -> Tuple[str, str]:
8989
return base_name, major_minor
9090

9191

92-
def prepare_test_directory(archive_path: str, tests_path: str):
92+
def prepare_test_directory(archive_path: Path, tests_path: Path) -> Tuple[Path, str]:
9393

9494
base_name, major_minor = _parse_archive_path(archive_path)
9595
# The archive contains a folder with the same name as the archive.
9696
# We are interested in the contents within that folder, as thats where
9797
# the files are.
98-
files_path = os.path.join(tests_path, base_name)
98+
files_path = tests_path / base_name
9999

100100
# Cleanup any previous run.
101101
shutil.rmtree(files_path, ignore_errors=True)
102102

103103
# Create the test directory.
104-
Path(tests_path).mkdir(parents=True, exist_ok=True)
104+
tests_path.mkdir(parents=True, exist_ok=True)
105105

106106
_unpack_archive(archive_path, tests_path)
107107

108108
# Sanity check that the archive has maintained its format.
109-
assert os.path.isdir(files_path)
109+
assert files_path.is_dir()
110110

111111
return files_path, major_minor

scripts/bintars/deps_test.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import yaml
1111

1212
from common import run_command, setup_logging, prepare_test_directory
13+
from pathlib import Path
1314

1415

1516
def check_file_is_elf_binary_callback(file_path: str) -> str | None:
@@ -121,10 +122,10 @@ def remove_base_path_from_files(dependencies: dict[str, list[str]],
121122
def dependencies_to_canonical_repr(
122123
dependencies: dict[str, set[str]],
123124
version: str,
124-
base_path: str
125+
base_path: Path
125126
) -> dict[str, dict[str, list[str]]]:
126127

127-
dependencies = remove_base_path_from_files(dependencies, base_path)
128+
dependencies = remove_base_path_from_files(dependencies, base_path.as_posix())
128129
result = {
129130
'version': version,
130131
'files': {},
@@ -194,9 +195,9 @@ def compare_dependencies(archive_deps, standard_deps):
194195
return error
195196

196197

197-
def main(archive_path: str,
198-
tests_path: str,
199-
deps_file: str,
198+
def main(archive_path: Path,
199+
tests_path: Path,
200+
deps_file: Path,
200201
record: bool,
201202
allow_cross_version: bool):
202203
error = False # track any errors so we can return properly.
@@ -248,8 +249,8 @@ def main(archive_path: str,
248249
args = parser.parse_args()
249250

250251
setup_logging(logging.INFO)
251-
main(archive_path=args.archive,
252-
tests_path=args.test_directory,
253-
deps_file=args.deps_file,
252+
main(archive_path=Path(args.archive),
253+
tests_path=Path(args.test_directory),
254+
deps_file=Path(args.deps_file),
254255
record=args.record,
255256
allow_cross_version=args.allow_cross_version)

0 commit comments

Comments
 (0)