Skip to content

Commit f0bda49

Browse files
committed
fix usage with setuptools
Current versions of setuptools overwrite distutils. Therefore we have a new unwanted dependency. This patch addresses this in the unit tests and fixes a bug caused by calling uname during the bootstrapping of setuptools distutils package.
1 parent fd43615 commit f0bda49

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- name: Install Python packages
3636
run: |
3737
pip install --upgrade pip
38+
pip install --upgrade setuptools
3839
pip install numpy mpi4py pytest
3940
4041
- name: Build python bindings

scorep/subsystem.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import distutils.ccompiler
32
import tempfile
43
import shutil
54

@@ -86,7 +85,12 @@ def generate(scorep_config, keep_files=False):
8685

8786
subsystem_lib_name = generate_subsystem_lib_name()
8887

88+
# setuptools, which replaces distutils, calls uname in python < 3.9 during distutils bootstraping.
89+
# When LD_PRELOAD is set, this leads to preloading Score-P to uname, and crashes the later tracing.
90+
# To avoid this, we need to do the distutils bootstrap as late as possible.
91+
import distutils.ccompiler
8992
cc = distutils.ccompiler.new_compiler()
93+
9094
compiled_subsystem = cc.compile(
9195
[temp_dir + "/scorep_init.c"], output_dir=temp_dir)
9296
cc.link(

0 commit comments

Comments
 (0)