microsoft / msix-packaging

MSIX SDK
MIT License
963 stars 163 forks source link

[BUG] does not compile on linux fedora 36 64bits #535

Open ROBERT-MCDOWELL opened 1 year ago

ROBERT-MCDOWELL commented 1 year ago

Project MSIX SDK

Describe the bug In file included from /home/src/msix-packaging/src/test/msixtest/msixtest.cpp:6: /home/src/msix-packaging/lib/catch2/catch.hpp:8749:34: error: constexpr variable 'sigStack Size' must be initialized by a constant expression constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ ; ^ ~~~~~~~~~~ /home/src/msix-packaging/lib/catch2/catch.hpp:8749:58: note: non-constexpr function 'sysco nf' cannot be used in a constant expression constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ ; ^ /usr/include/bits/sigstksz.h:32:22: note: expanded from macro 'MINSIGSTKSZ' # define MINSIGSTKSZ SIGSTKSZ ^ /usr/include/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/src/msix-packaging/src/test/msixtest/msixtest.cpp:6: /home/src/msix-packaging/lib/catch2/catch.hpp:8808:33: error: variable length array declar ation 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/C MakeFiles/msixtest.dir/msixtest.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:619: src/test/msixtest/CMakeFiles/msixtest.dir/all] Err or 2 make: *** [Makefile:136: all] Error 2

To Reproduce ./makelinux.sh

Expected behavior must compile!

Platform Fedora linux 36 64bits

anarvekar-msft commented 1 year ago

Can you share which compiler and what version you're using?

ROBERT-MCDOWELL commented 1 year ago

gcc 12.2.1

msftrubengu commented 1 year ago

We use Clang 9.0.0 in the DevOps agents because we are using an old ubuntu-18.04 image. We should update to ubuntu-latest, or ubuntu-22.04, but I don't know what the implication of that would be.

Regardless, this is coming from Catch2 v2, so I wouldn't recommend fixing that header. The right thing to do would be to update the tests to use Catch2 v3 which is now a normal library instead of a single-header library.

ROBERT-MCDOWELL commented 1 year ago

oops sorry, clang version 14.0.5 (Fedora 14.0.5-1.fc36)

msftrubengu commented 1 year ago

This is a dupe of #514