xref: /PHP-7.4/azure/msan_job.yml (revision 9b39ddbb)
1parameters:
2  configurationName: ''
3  configurationParameters: ''
4  runTestsParameters: ''
5  timeoutInMinutes: 60
6
7jobs:
8  - job: ${{ parameters.configurationName }}
9    timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
10    pool:
11      vmImage: 'ubuntu-18.04'
12    steps:
13    - template: apt.yml
14    - script: |
15        export CC=clang
16        export CXX=clang++
17        export CFLAGS="-fsanitize=memory -DZEND_TRACK_ARENA_ALLOC"
18        export LDFLAGS="-fsanitize=memory"
19        ./buildconf --force
20        # msan requires all used libraries to be instrumented,
21        # so we should avoiding linking against anything but libc here
22        ./configure ${{ parameters.configurationParameters }} \
23            --enable-option-checking=fatal \
24            --prefix=/usr \
25            --without-sqlite3 \
26            --without-pdo-sqlite \
27            --without-libxml \
28            --disable-dom \
29            --disable-simplexml \
30            --disable-xml \
31            --disable-xmlreader \
32            --disable-xmlwriter \
33            --without-pcre-jit \
34            --enable-phpdbg \
35            --enable-fpm \
36            --with-pdo-mysql=mysqlnd \
37            --with-mysqli=mysqlnd \
38            --disable-mysqlnd-compression-support \
39            --without-pear \
40            --enable-exif \
41            --enable-sysvsem \
42            --enable-sysvshm \
43            --enable-shmop \
44            --enable-pcntl \
45            --enable-mbstring \
46            --disable-mbregex \
47            --enable-sockets \
48            --enable-bcmath \
49            --enable-calendar \
50            --enable-ftp \
51            --enable-zend-test \
52            --enable-werror \
53            --with-config-file-path=/etc \
54            --with-config-file-scan-dir=/etc/php.d
55      displayName: 'Configure Build'
56    - script: make -j$(/usr/bin/nproc) >/dev/null
57      displayName: 'Make Build'
58    - script: |
59        sudo make install
60        sudo mkdir     /etc/php.d
61        sudo chmod 777 /etc/php.d
62        echo mysqli.default_socket=/var/run/mysqld/mysqld.sock     > /etc/php.d/mysqli.ini
63        echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock  > /etc/php.d/pdo_mysql.ini
64      displayName: 'Install Build'
65    - script: |
66        sudo service mysql start
67        mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
68      displayName: 'Setup'
69    - template: test.yml
70      parameters:
71        configurationName: ${{ parameters.configurationName }}
72        runTestsParameters: ${{ parameters.runTestsParameters }}
73    - template: test.yml
74      parameters:
75        configurationName: ${{ parameters.configurationName }}
76        runTestsName: 'OpCache'
77        runTestsParameters: >-
78          ${{ parameters.runTestsParameters }}
79          -d zend_extension=opcache.so -d opcache.enable_cli=1
80