Skip to content

vulkan-headers: build using ninja to fix gcc-14 compatibility#340013

Closed
trofi wants to merge 1 commit intoNixOS:stagingfrom
trofi:vulkan-headers-gcc-14-fix
Closed

vulkan-headers: build using ninja to fix gcc-14 compatibility#340013
trofi wants to merge 1 commit intoNixOS:stagingfrom
trofi:vulkan-headers-gcc-14-fix

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Sep 6, 2024

When vulkan-headers detects gcc-14 or above it enables c++ modules support. But make-mased backend does not support it and fails as:

$ nix build --impure --expr 'with import ./. {}; vulkan-headers.override {stdenv = gcc14Stdenv; }' -L

CMake Error in CMakeLists.txt:
  The target named "Vulkan-Module" has C++ sources that may use modules, but
  modules are not supported by this generator:
    Unix Makefiles
  Modules are supported only by Ninja, Ninja Multi-Config, and Visual Studio
  generators for VS 17.4 and newer.  See the cmake-cxxmodules(7) manual for
  details.  Use the CMAKE_CXX_SCAN_FOR_MODULES variable to enable or disable
  scanning.

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot requested a review from Ralith September 6, 2024 08:29
@ofborg ofborg bot added 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Sep 6, 2024
Copy link
Contributor

@Ralith Ralith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. Maybe leave a comment explaining why we're diverging from the minimal approach?

When `vulkan-headers` detects `gcc-14` or above it enables c++ modules
support. But make-mased backend does not support it and fails as:

    $ nix build --impure --expr 'with import ./. {}; vulkan-headers.override {stdenv = gcc14Stdenv; }' -L

    CMake Error in CMakeLists.txt:
      The target named "Vulkan-Module" has C++ sources that may use modules, but
      modules are not supported by this generator:
        Unix Makefiles
      Modules are supported only by Ninja, Ninja Multi-Config, and Visual Studio
      generators for VS 17.4 and newer.  See the cmake-cxxmodules(7) manual for
      details.  Use the CMAKE_CXX_SCAN_FOR_MODULES variable to enable or disable
      scanning.
@trofi trofi force-pushed the vulkan-headers-gcc-14-fix branch from ae633e4 to 9e0e1cf Compare September 6, 2024 20:06
@trofi
Copy link
Contributor Author

trofi commented Sep 6, 2024

Added the comment

+  # Adding `ninja` here to enable Ninja backend. Otherwise on gcc-14 or
+  # later the build fails as:
+  #   modules are not supported by this generator: Unix Makefiles

@ofborg ofborg bot requested a review from Ralith September 6, 2024 23:43
@wegank wegank added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Sep 7, 2024
@vcunat vcunat mentioned this pull request Sep 8, 2024
13 tasks
@vcunat
Copy link
Member

vcunat commented Sep 8, 2024

*-darwin suffers from this issue on the current staging-next already.

@vcunat
Copy link
Member

vcunat commented Sep 8, 2024

But the darwin build seems bad anyway. If I add ninja locally, it fails on #include <algorithm>:

source/include/vulkan/vulkan.hpp:11:10: fatal error: 'algorithm' file not found

@trofi trofi closed this Sep 8, 2024
@trofi trofi deleted the vulkan-headers-gcc-14-fix branch September 8, 2024 05:47
@fabianhjr fabianhjr mentioned this pull request Sep 8, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants