microsoft / msix-packaging

MSIX SDK
MIT License
964 stars 163 forks source link

[BUG] ./makelinux.sh fails on Ubuntu 22.04 and clang14 #514

Open MattBDev opened 2 years ago

MattBDev commented 2 years ago

Project MSIX SDK

Describe the bug Running "./makelinux.sh" fails with the error:

/home/mattb/msix-packaging/lib/catch2/catch.hpp:8749:34: error: constexpr variable 'sigStackSize' must be initialized by a constant expression
    constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                 ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mattb/msix-packaging/lib/catch2/catch.hpp:8749:58: note: non-constexpr function 'sysconf' cannot be used in a constant expression
    constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                                         ^
/usr/include/x86_64-linux-gnu/bits/sigstksz.h:32:22: note: expanded from macro 'MINSIGSTKSZ'
# define MINSIGSTKSZ SIGSTKSZ
                     ^
/usr/include/x86_64-linux-gnu/bits/sigstksz.h:28:19: note: expanded from macro 'SIGSTKSZ'
# define SIGSTKSZ sysconf (_SC_SIGSTKSZ)
                  ^
/usr/include/unistd.h:640:17: note: declared here
extern long int sysconf (int __name) __THROW;
                ^
In file included from /home/mattb/msix-packaging/src/test/msixtest/msixtest.cpp:6:
/home/mattb/msix-packaging/lib/catch2/catch.hpp:8808:33: error: variable length array declaration not allowed at file scope
    char FatalConditionHandler::altStackMem[sigStackSize] = {};
                                ^           ~~~~~~~~~~~~
2 errors generated.
make[2]: *** [src/test/msixtest/CMakeFiles/msixtest.dir/build.make:90: src/test/msixtest/CMakeFiles/msixtest.dir/msixtest.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:619: src/test/msixtest/CMakeFiles/msixtest.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

To Reproduce Steps to reproduce the behavior: 1) Install Ubuntu 22.04 LTS on WSL 2 2) sudo apt install clang cmake 3) run ./makelinux.sh

Expected behavior A successful compile

Screenshots If applicable, add screenshots to help explain your problem.

Platform Ubuntu 22.04 LTS running on Windows 11 22000.613 Additional context I would be happy to provide more information upon request.

MattBDev commented 2 years ago

It seems to work fine if I add --skip-tests