diff --git a/.github/workflows/compile-test.yml b/.github/workflows/compile-test.yml index 2a05e3495..d1ec99799 100644 --- a/.github/workflows/compile-test.yml +++ b/.github/workflows/compile-test.yml @@ -14,9 +14,15 @@ jobs: - os: ubuntu-20.04 php: "php7.4" php-config: "php-config7.4" + cc: "gcc" - os: ubuntu-22.04 php: "php8.1" php-config: "php-config8.1" + cc: "gcc" + - os: ubuntu-22.04 + php: "php8.1" + php-config: "php-config8.1" + cc: "clang" runs-on: ${{ matrix.os }} @@ -43,16 +49,16 @@ jobs: libcurl4-openssl-dev \ openjdk-11-jdk libgloox-dev gccgo \ cli-common-dev mono-devel mono-mcs uuid-dev \ - curl check - - uses: actions/checkout@v2 - - name: Build kitchensink uWSGI binary - run: UWSGICONFIG_PHPPATH=${{ matrix.php-config }} /usr/bin/python3 uwsgiconfig.py --build travis + curl check ${{ matrix.cc == 'clang' && 'clang' || '' }} + - uses: actions/checkout@v4 + - name: Build kitchensink uWSGI binary with gcc or default with clang + run: CC=${{ matrix.cc }} UWSGICONFIG_PHPPATH=${{ matrix.php-config }} /usr/bin/python3 uwsgiconfig.py --build ${{ matrix.cc == 'gcc' && 'travis' || '' }} - name: Build uWSGI binary run: | - /usr/bin/python3 uwsgiconfig.py --build base + CC=${{ matrix.cc }} /usr/bin/python3 uwsgiconfig.py --build base - name: Build cgi plugin run: | - /usr/bin/python3 uwsgiconfig.py --plugin plugins/cgi base + CC=${{ matrix.cc }} /usr/bin/python3 uwsgiconfig.py --plugin plugins/cgi base - name: Build dummy plugin run: | - /usr/bin/python3 uwsgiconfig.py --plugin plugins/dummy base + CC=${{ matrix.cc }} /usr/bin/python3 uwsgiconfig.py --plugin plugins/dummy base diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 009d48438..ba0cbbb49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: if: contains(fromJson('["3.6","3.7","3.8","3.9","3.10","3.11","3.12"]'), matrix.python-version) run: | sudo apt install --no-install-recommends -qqyf python${{ matrix.python-version }}-distutils \ - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Run unit tests if: matrix.test-suite == 'unittest' run: make tests @@ -61,7 +61,7 @@ jobs: sudo apt install --no-install-recommends -qqyf python3-dev \ libpcre3-dev libjansson-dev libcap2-dev ruby2.7-dev \ curl check - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Run unit tests run: make tests - name: Build uWSGI binary diff --git a/uwsgiconfig.py b/uwsgiconfig.py index 8fe31ccb1..ad1bef1d8 100644 --- a/uwsgiconfig.py +++ b/uwsgiconfig.py @@ -679,16 +679,18 @@ def __init__(self, filename, mute=False): if 'UWSGI_INCLUDES' in os.environ: self.include_path += os.environ['UWSGI_INCLUDES'].split(',') - self.cflags = [ + cflags = [ '-O2', '-I.', '-Wall', '-Werror', - '-Wformat-signedness', '-Wno-error=deprecated-declarations', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64' - ] + os.environ.get("CFLAGS", "").split() + self.get('cflags', '').split() + ] + if "gcc" in GCC: + cflags.append('-Wformat-signedness') + self.cflags = cflags + os.environ.get("CFLAGS", "").split() + self.get('cflags', '').split() python_venv_include = os.path.join(sys.prefix, 'include', 'site', 'python{0}.{1}'.format(*sys.version_info))