Skip to content

Commit

Permalink
fix usage with setuptools
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AndreasGocht committed Jun 22, 2022
1 parent fd43615 commit f0bda49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- name: Install Python packages
run: |
pip install --upgrade pip
pip install --upgrade setuptools
pip install numpy mpi4py pytest
- name: Build python bindings
Expand Down
6 changes: 5 additions & 1 deletion scorep/subsystem.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import distutils.ccompiler
import tempfile
import shutil

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

subsystem_lib_name = generate_subsystem_lib_name()

# setuptools, which replaces distutils, calls uname in python < 3.9 during distutils bootstraping.
# When LD_PRELOAD is set, this leads to preloading Score-P to uname, and crashes the later tracing.
# To avoid this, we need to do the distutils bootstrap as late as possible.
import distutils.ccompiler
cc = distutils.ccompiler.new_compiler()

compiled_subsystem = cc.compile(
[temp_dir + "/scorep_init.c"], output_dir=temp_dir)
cc.link(
Expand Down

0 comments on commit f0bda49

Please sign in to comment.