microsoft / microsoft/msix-packaging

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

Open
#514 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-MSIX SDK Bug
Dominant language
C
Stars
1.1k
Forks
193
Avg merge
2h 16m
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with ./makelinux.sh on Ubuntu 22.04 using clang and cmake, then inspect lib/catch2/catch.hpp and the msixtest build entry at src/test/msixtest/msixtest.cpp. Compare the compiler diagnostics with the bundled Catch2 code and verify that the project compiles successfully after the compatibility issue is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, ubuntu
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.