Skip to content

Conversation

@agamache
Copy link
Contributor

Building vulkan.cppm on macOS fails after was removed from vulkan.hpp in #2344 since the macOS version calls getenv to read the DYLD_LIBRARY_PATH environment variable.

@CLAassistant
Copy link

CLAassistant commented Dec 23, 2025

CLA assistant check
All committers have signed the CLA.

@M2-TE
Copy link
Contributor

M2-TE commented Dec 26, 2025

Thanks for catching that! Could you adjust snippets/includes.hpp instead of the generated file and then run the generator?

Also, could you test whether substituting getenv with std::getenv allows it to compile without including the additional header? The import std is a bit inconsistent about what it exports and e.g. std::exit is exported, whereas exit is not.

@M2-TE M2-TE mentioned this pull request Dec 28, 2025
@dsvensson
Copy link

@M2-TE Yep, changing to std::getenv also works.

@asuessenbach
Copy link
Contributor

@dsvensson That is, this PR can be closed without merging?

@M2-TE
Copy link
Contributor

M2-TE commented Jan 6, 2026

The issue is still valid, though the solution should be different than what is presented. In short:

  • instead of including <cstdlib>, getenv should be prefixed by std::
  • generator code should be changed, not just vulkan.hpp

I could create a separate PR to do this, unless @agamache wants to implement the changes here

@agamache agamache force-pushed the fix-getenv-macos branch 2 times, most recently from f4a1ca6 to 1c50306 Compare January 6, 2026 20:27
@agamache
Copy link
Contributor Author

agamache commented Jan 6, 2026

I have updated this pr to use std::getenv in snippets/DynamicLoader.hpp and reran the generator

@asuessenbach asuessenbach merged commit f48416b into KhronosGroup:main Jan 8, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants