Files
scylladb/dist/debuginfo/scripts/create-relocatable-package.py
Yaron Kaikov 648fa8f5b1 dist: remove bundled node_exporter, add dependency on scylla-node-exporter
The node_exporter binary has moved to its own dedicated repository
(scylladb/scylla-node-exporter). Remove the bundled copy from the core
repo to eliminate the toolchain dependency required to build/package it
here and to resolve associated CVEs inherited from the vendored binary.

This removes the download logic, build rules, packaging subpackage,
systemd/sysconfig/supervisor files, and install/uninstall references.
Instead, a hard dependency on the separate scylla-node-exporter package
is declared in both the RPM spec and Debian control file.

    [Yaron:
      - regenerate frozen toolchain with optimized clang from

        https://devpkg.scylladb.com/clang/clang-21.1.8-Fedora-43-aarch64.tar.gz
        https://devpkg.scylladb.com/clang/clang-21.1.8-Fedora-43-x86_64.tar.gz
    ]

Fixes: RELENG-502
Fixes: RELENG-503

Closes scylladb/scylladb#29716
2026-05-24 16:30:24 +03:00

68 lines
2.3 KiB
Python
Executable File

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2022-present ScyllaDB
#
#
# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.1
#
import argparse
import os
import subprocess
import tarfile
import tempfile
RELOC_PREFIX='scylla-debuginfo'
def reloc_add(self, name, arcname=None, recursive=True, *, filter=None):
if arcname:
return self.add(name, arcname="{}/{}".format(RELOC_PREFIX, arcname),
filter=filter)
else:
return self.add(name, arcname="{}/{}".format(RELOC_PREFIX, name),
filter=filter)
tarfile.TarFile.reloc_add = reloc_add
SCYLLA_DIR='scylla-debuginfo-package'
def reloc_add(ar, name, arcname=None):
ar.add(name, arcname="{}/{}".format(SCYLLA_DIR, arcname if arcname else name))
ap = argparse.ArgumentParser(description='Create a relocatable scylla-debuginfo package.')
ap.add_argument('dest',
help='Destination file (tar format)')
ap.add_argument('--build-dir', default='build/release',
help='Build dir ("build/debug" or "build/release") to use')
args = ap.parse_args()
executables_scylla = [
'{}/scylla'.format(args.build_dir),
'{}/iotune'.format(args.build_dir)]
output = args.dest
# Although tarfile.open() can write directly to a compressed tar by using
# the "w|gz" mode, it does so using a slow Python implementation. It is as
# much as 3 times faster (!) to output to a pipe running the external gzip
# command. We can complete the compression even faster by using the pigz
# command - a parallel implementation of gzip utilizing all processors
# instead of just one.
gzip_process = subprocess.Popen("pigz > "+output, shell=True, stdin=subprocess.PIPE)
ar = tarfile.open(fileobj=gzip_process.stdin, mode='w|')
# relocatable package format version = 2.1
with tempfile.NamedTemporaryFile('w+t') as version_file:
version_file.write('2.1\n')
version_file.flush()
ar.add(version_file.name, arcname='.relocatable_package_version')
for exe in executables_scylla:
basename = os.path.basename(exe)
ar.reloc_add(f'{exe}.debug', arcname=f'libexec/.debug/{basename}.debug')
ar.reloc_add('dist/debuginfo/install.sh', arcname='install.sh')
# Complete the tar output, and wait for the gzip process to complete
ar.close()
gzip_process.communicate()