MiKTeX / miktex

the MiKTeX source code
https://miktex.org
Other
804 stars 95 forks source link

Build Error for MiKTeX on macOS: `error: 'path' is unavailable: introduced in macOS 10.15` #1551

Open KylinGuo opened 1 week ago

KylinGuo commented 1 week ago

Description:

I attempted to compile MiKTeX from source on macOS as the precompiled binary (miktex-22.1-darwin-x86_64.dmg) does not work for my setup. I followed the official build guide available at https://miktex.org/howto/build-mac. However, during the build process, the make command failed with the following error messages:

% cd miktex-24.4
% mkdir build && cd build/
% pwd
/Users/guoqilin/Downloads/miktex-24.4/build
% brewprefix="`brew --prefix`"
% export CMAKE_PREFIX_PATH="${brewprefix}/opt/icu4c:${brewprefix}/opt/openssl:${brewprefix}/opt/icu4c:${brewprefix}/opt/qt:${CMAKE_PREFIX_PATH}"
% export MIKTEX_REPOSITORY=https://mirrors.aliyun.com/CTAN/systems/win32/miktex/tm/packages/
% cmake ../ > cmake_stdout.txt 2> cmake_stderr.txt &
% make > make_stdout.txt 2> make_stderr.txt &
% cat make_stderr.txt
...
/opt/homebrew/opt/qt/include/QtCore/qfile.h:59:58: error: 'path' is unavailable: introduced in macOS 10.15
   59 | inline QString fromFilesystemPath(const std::filesystem::path &path)
      |                                                          ^
...
/opt/homebrew/opt/qt/include/QtCore/qfile.h:64:40: error: 'native' is unavailable: introduced in macOS 10.15
   64 |     return QString::fromStdString(path.native());
      |                                        ^
...

Steps to Reproduce:

  1. Download the MiKTeX source code (miktex-24.4) from the official website.
  2. Follow the build instructions provided in the MiKTeX macOS build guide.
  3. Run the following commands in the build directory:
    cmake ../ > cmake_stdout.txt 2> cmake_stderr.txt &
    make > make_stdout.txt 2> make_stderr.txt &
  4. Observe the error in make_stderr.txt.

    Observed Behavior:

    The build process fails with the error:

    ...
    /opt/homebrew/opt/qt/include/QtCore/qfile.h:59:58: error: 'path' is unavailable: introduced in macOS 10.15
    59 | inline QString fromFilesystemPath(const std::filesystem::path &path)
      |                                                          ^
    ...
    /opt/homebrew/opt/qt/include/QtCore/qfile.h:64:40: error: 'native' is unavailable: introduced in macOS 10.15
    64 |     return QString::fromStdString(path.native());
      |                                        ^
    ...

    Expected Behavior:

    The build process should complete successfully without errors, downloading all required dependencies.

    Environment:

    • Operating System: macOS (15.1)
      % sw_vers
      ProductName:        macOS
      ProductVersion:     15.1
      BuildVersion:       24B2082
      % uname -a
      Darwin guoqilindeMacBook-Pro.local 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:06:57 PDT 2024; root:xnu-11215.41.3~3/RELEASE_ARM64_T6041 arm64
      % sysctl -n machdep.cpu.brand_string
      Apple M4 Pro
    • CMake Version: 3.31.0
      
      % cmake --version
      cmake version 3.31.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

- Compiler: Apple clang version 16.0.0 (clang-1600.0.26.4)
```zsh
% cc --version
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Emacs Lisp files have been installed to: /opt/homebrew/share/emacs/site-lisp/cmake ==> Analytics install: 119,954 (30 days), 372,635 (90 days), 1,593,550 (365 days) install-on-request: 89,854 (30 days), 277,601 (90 days), 1,232,395 (365 days) build-error: 880 (30 days)


[cmake_stdout.txt](https://github.com/user-attachments/files/17828317/cmake_stdout.txt)
[cmake_stderr.txt](https://github.com/user-attachments/files/17828318/cmake_stderr.txt)
[make_stdout.txt](https://github.com/user-attachments/files/17828319/make_stdout.txt)
[make_stderr.txt](https://github.com/user-attachments/files/17828320/make_stderr.txt)