Skip to content

Commit

Permalink
lit tests: Drop support for gdb < 8 and dependency on distutils pip p…
Browse files Browse the repository at this point in the history
…ackage

Fixes ldc-developers#4671.
  • Loading branch information
kinke committed Jun 10, 2024
1 parent 0ece34f commit 3615aa3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 23 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ commonSteps: &commonSteps
fi
# Install lit
python3 --version
python3 -m pip install --user setuptools wheel
python3 -m pip install --user lit
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
# Download & extract host LDC if HOST_LDC_VERSION is set
Expand Down
3 changes: 1 addition & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
common_steps_template: &COMMON_STEPS_TEMPLATE
install_lit_script: |
# Install lit
rm -f /usr/lib/python3.11/EXTERNALLY-MANAGED # required for Ubuntu 23.04
python3 -m pip install --user setuptools wheel
rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED # required for Ubuntu 24.04
python3 -m pip install --user lit
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
clone_submodules_script: |
Expand Down
3 changes: 1 addition & 2 deletions .github/actions/1-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ runs:
set -euxo pipefail
python3 --version
if [[ '${{ runner.os }}-${{ inputs.arch }}' == 'macOS-arm64' ]]; then
brew install lit python-setuptools
brew install lit
else
python3 -m pip install --user setuptools wheel
python3 -m pip install --user lit
fi
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/supported_llvm_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ jobs:
run: |
set -euxo pipefail
if [[ '${{ matrix.os }}' == 'macos-14' ]]; then
brew install lit python-setuptools
brew install lit
else
python3 -m pip install --user setuptools wheel
python3 -m pip install --user lit
fi
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
Expand Down
3 changes: 1 addition & 2 deletions tests/debuginfo/print_gdb.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// REQUIRES: atleast_gdb80

// REQUIRES: gdb
// This test fails due to newer version of GDB, see https://github.com/ldc-developers/ldc/issues/4389
// XFAIL: FreeBSD

Expand Down
22 changes: 8 additions & 14 deletions tests/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import string
import re
import subprocess
import glob
from distutils.version import LooseVersion

# Cmake Boolean options
ON = True
Expand Down Expand Up @@ -203,19 +202,14 @@ if (platform.system() == 'Windows') and os.path.isfile( cdb ):
# Check whether GDB is present
if (platform.system() != 'Windows') and lit.util.which('gdb', config.environment['PATH']):
config.available_features.add('gdb')
gdb_dflags = ''
command = ['gdb', '--version']
p = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, universal_newlines=True)
text = p.stdout.readline()
m = re.compile('[^0-9]*([0-9]+[0-9.]*).*').match(text)
if m is not None:
gdb_version = m.group(1)
if LooseVersion(gdb_version) < LooseVersion('7.8'):
gdb_dflags = '-dwarf-version=2'
elif LooseVersion(gdb_version) >= LooseVersion('8.0'):
config.available_features.add('atleast_gdb80')

gdb_dflags = '' # for gdb-version-dependant flags
#command = ['gdb', '--version']
#p = subprocess.Popen(command, stdout=subprocess.PIPE,
# stderr=subprocess.PIPE, universal_newlines=True)
#text = p.stdout.readline()
#m = re.compile('[^0-9]*([0-9]+[0-9.]*).*').match(text)
#if m is not None:
# gdb_version = m.group(1)
config.substitutions.append( ('%_gdb_dflags', gdb_dflags) )

if 'LD_LIBRARY_PATH' in os.environ:
Expand Down

0 comments on commit 3615aa3

Please sign in to comment.