Skip to content

Commit

Permalink
Switch to using Python 3 and move from Ubuntu 16.04 to 18.04 on Azure (
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanEngelen authored May 19, 2021
1 parent 212ed4e commit c0b5c57
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 33 deletions.
11 changes: 5 additions & 6 deletions .azure-pipelines/1-posix-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@ steps:
sudo apt-get -q update
sudo apt-get -yq install \
git-core cmake ninja-build g++-multilib \
libcurl3 libcurl3:i386 \
curl gdb p7zip-full tzdata unzip zip
libcurl4 libcurl4:i386 \
curl gdb p7zip-full tzdata unzip zip python3-pip
# Download & extract clang
curl -L -o clang.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-$CLANG_VERSION/clang+llvm-$CLANG_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz
mkdir clang
tar -xf clang.tar.xz --strip 1 -C clang
fi
# Install lit
curl -OL https://bootstrap.pypa.io/pip/2.7/get-pip.py
python get-pip.py --user
python -m pip install --user lit
python -c "import lit.main; lit.main.main();" --version . | head -n 1
python3 --version
python3 -m pip install --user lit
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
# Download & extract host LDC
HOST_OS="$CI_OS"
if [ "$CI_OS" = "android" ]; then HOST_OS="linux"; fi
Expand Down
11 changes: 4 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@ commonSteps: &commonSteps
# Add CMake, Ninja and LLVM to PATH for future steps
echo "export PATH=$PWD/cmake/bin:$PWD/ninja:$PWD/llvm/bin:$PATH" >> $BASH_ENV
fi
# Set python
python3 --version
ln -sf $(which python3) /usr/local/bin/python
python --version
# Install lit
python -m pip install --user lit
python -c "import lit.main; lit.main.main();" --version . | head -n 1
python3 --version
python3 -m pip install --user lit
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
# Download & extract host LDC
curl -L -o ldc2.tar.xz https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-$CI_OS-x86_64.tar.xz
mkdir host-ldc
Expand Down Expand Up @@ -85,7 +82,7 @@ commonSteps: &commonSteps
- run:
name: Run LIT testsuite
when: always
command: cd ../build/tests && python runlit.py -v -j $PARALLELISM .
command: cd ../build/tests && python3 runlit.py -v -j $PARALLELISM .
- run:
name: Run DMD testsuite
when: always
Expand Down
15 changes: 6 additions & 9 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
common_steps_template: &COMMON_STEPS_TEMPLATE
install_lit_script: |
# Install lit
python -m pip install --user lit
python -c "import lit.main; lit.main.main();" --version . | head -n 1
python3 -m pip install --user lit
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
clone_submodules_script: |
cd $CIRRUS_WORKING_DIR
git submodule update --init --depth $CIRRUS_CLONE_DEPTH
Expand Down Expand Up @@ -33,7 +33,7 @@ common_steps_template: &COMMON_STEPS_TEMPLATE
ctest --output-on-failure -R ldc2-unittest
run_lit_testsuite_script: |
cd $CIRRUS_WORKING_DIR/../build/tests
python runlit.py -v -j $PARALLELISM .
python3 runlit.py -v -j $PARALLELISM .
run_dmd_testsuite_script: |
cd $CIRRUS_WORKING_DIR/../build
DMD_TESTSUITE_MAKE_ARGS=-j$PARALLELISM ctest -V -R dmd-testsuite
Expand Down Expand Up @@ -70,8 +70,6 @@ install_ubuntu_prerequisites_template: &INSTALL_UBUNTU_PREREQUISITES_TEMPLATE
$libcurl_pkg curl gdb python3 python3-pip tzdata unzip zip \
$EXTRA_APT_PACKAGES
python3 --version
ln -s $(which python3) /usr/bin/python
python --version
# Download & extract host LDC
curl --max-time 300 --retry 3 -L -o ldc2.tar.xz https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-linux-x86_64.tar.xz
mkdir host-ldc
Expand Down Expand Up @@ -106,8 +104,7 @@ install_macos_prerequisites_template: &INSTALL_MACOS_PREREQUISITES_TEMPLATE
rm ldc2.tar.xz
# Install Python3
brew install python
ln -sf $(which python3) /usr/local/bin/python
python --version
python3 --version
environment:
CIRRUS_CLONE_DEPTH: 50
Expand Down Expand Up @@ -186,8 +183,8 @@ task:
cd $CIRRUS_WORKING_DIR/..
sysctl -n hw.ncpu
pkg install -y git cmake ninja gmake llvm bash gtar p7zip
python --version
python -m ensurepip
python3 --version
python3 -m ensurepip
# Download & extract host LDC
curl --max-time 300 --retry 3 -L -o ldc2.tar.xz https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-freebsd-x86_64.tar.xz
mkdir pre-ldc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/supported_llvm_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ jobs:
- name: Install lit
run: |
set -euxo pipefail
python -m pip install --user lit
python -c "import lit.main; lit.main.main();" --version . | head -n 1
python3 -m pip install --user lit
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
- name: "Linux: Install gdb"
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install gdb
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ before_install:
install:
# Install lit
- python -m pip install --user lit
- python -c "import lit.main; lit.main.main();" --version . | head -n 1
- python3 -m pip install --user lit
- python3 -c "import lit.main; lit.main.main();" --version . | head -n 1

script:
- unset LD_LIBRARY_PATH
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- job: Linux_multilib
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-18.04'
variables:
CI_OS: linux
ARCH: x86_64
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
- job: Android
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-18.04'
variables:
CI_OS: android
ANDROID_NDK_VERSION: r21e
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
- job: Upload_to_GitHub
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-18.04'
dependsOn:
- Windows_multilib
- Linux_multilib
Expand Down
4 changes: 2 additions & 2 deletions shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build:
apt-get -yq install \
git-core cmake ninja-build \
libcurl3 libcurl4-openssl-dev \
curl gdb p7zip-full python-pip tzdata unzip zip
curl gdb p7zip-full python3-pip tzdata unzip zip
- pip install --user lit
# Download & extract host LDC
- curl -L -o ldc2.tar.xz https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-linux-aarch64.tar.xz
Expand Down Expand Up @@ -90,7 +90,7 @@ build:
- rm ../tests/d2/dmd-testsuite/runnable/b18504.d
# Run LIT testsuite, ignore the errors
- cd tests
- PATH="$PWD/../../llvm/bin:$PATH" python runlit.py -v -j 32 . || true
- PATH="$PWD/../../llvm/bin:$PATH" python3 runlit.py -v -j 32 . || true
- cd ..
# Run DMD testsuite
- DMD_TESTSUITE_MAKE_ARGS='-j32 GDB_FLAGS=OFF' ctest -V -R "dmd-testsuite"
Expand Down
6 changes: 5 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set( LLVM_TOOLS_DIR ${LLVM_ROOT_DIR}/bin )
set( LDC2_BIN_DIR ${PROJECT_BINARY_DIR}/bin )
set( LDC2_LIB_DIR ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX} )
set( TESTS_IR_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
set( PYTHON_EXE python3)
if(WIN32)
set(PYTHON_EXE python)
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set( DEFAULT_TARGET_BITS 64 )
Expand All @@ -16,6 +20,6 @@ configure_file(lit.site.cfg.in lit.site.cfg )
configure_file(runlit.py runlit.py COPYONLY)

add_test(NAME lit-tests
COMMAND python runlit.py -v .
COMMAND ${PYTHON_EXE} runlit.py -v .
)

2 changes: 1 addition & 1 deletion tests/runlit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# wrapper to run lit from commandline

from __future__ import print_function
Expand Down

0 comments on commit c0b5c57

Please sign in to comment.