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 11, 2024
1 parent 0ece34f commit d439ae3
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 27 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
2 changes: 1 addition & 1 deletion tests/debuginfo/classtypes_gdb.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This test fails due to newer version of GDB, see https://github.com/ldc-developers/ldc/issues/4389
// XFAIL: FreeBSD

// RUN: %ldc %_gdb_dflags -g -of=%t %s
// RUN: %ldc -g -of=%t %s
// RUN: sed -e "/^\\/\\/ GDB:/!d" -e "s,// GDB:,," %s >%t.gdb
// RUN: gdb %t --batch -x %t.gdb >%t.out 2>&1
// RUN: FileCheck %s -check-prefix=CHECK < %t.out
Expand Down
2 changes: 1 addition & 1 deletion tests/debuginfo/nested_gdb.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: gdb
// RUN: %ldc %_gdb_dflags -g -of=%t %s
// RUN: %ldc -g -of=%t %s
// RUN: sed -e "/^\\/\\/ GDB:/!d" -e "s,// GDB:,," %s >%t.gdb
// RUN: gdb %t --batch -x %t.gdb >%t.out 2>&1
// RUN: FileCheck %s -check-prefix=CHECK < %t.out
Expand Down
5 changes: 2 additions & 3 deletions tests/debuginfo/print_gdb.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// 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

// RUN: %ldc %_gdb_dflags -I%S -g -of=%t %s %S/inputs/import_a.d %S/inputs/import_b.d
// RUN: %ldc -I%S -g -of=%t %s %S/inputs/import_a.d %S/inputs/import_b.d
// RUN: sed -e "/^\\/\\/ GDB:/!d" -e "s,// GDB:,," %s >%t.gdb
// RUN: env LANG=C gdb %t --batch -x %t.gdb >%t.out 2>&1
// RUN: FileCheck %s -check-prefix=CHECK < %t.out
Expand Down
15 changes: 0 additions & 15 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,20 +202,6 @@ 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')

config.substitutions.append( ('%_gdb_dflags', gdb_dflags) )

if 'LD_LIBRARY_PATH' in os.environ:
libs = []
Expand Down

0 comments on commit d439ae3

Please sign in to comment.