Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix find-llvm-config to ignore LLVM_CONFIG's escape sequences #15076

Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Oct 11, 2024

If the LLVM_CONFIG environment variable is already set and points to a valid executable, percent signs and backslashes will be specially interpreted according to printf's rules. This is most likely to happen on MSYS2, since the Windows host might have set LLVM_CONFIG to support static LLVM builds:

$ LLVM_CONFIG='C:\Users\nicet\llvm\18\bin\llvm-config.exe' src/llvm/ext/find-llvm-config
src/llvm/ext/find-llvm-config: line 19: printf: missing unicode digit for \U
C:\Users
icet\llvmin\llvm-config.exe

This PR ensures that doesn't happen.

@HertzDevil HertzDevil added kind:bug A bug in the code. Does not apply to documentation, specs, etc. platform:windows Windows support based on the MSVC toolchain / Win32 API topic:stdlib:llvm labels Oct 11, 2024
@HertzDevil HertzDevil changed the title Fix find-llvm-config if LLVM_CONFIG is already set Fix find-llvm-config to ignore LLVM_CONFIG's escape sequences Oct 11, 2024
@straight-shoota straight-shoota added this to the 1.15.0 milestone Oct 11, 2024
@straight-shoota straight-shoota merged commit 59fdcf4 into crystal-lang:master Oct 14, 2024
67 checks passed
@HertzDevil HertzDevil deleted the bug/msys2-find-llvm-config branch October 18, 2024 06:52
@HertzDevil HertzDevil added platform:windows-gnu Windows support based on the MinGW-w64 toolchain + MSYS2 and removed platform:windows Windows support based on the MSVC toolchain / Win32 API labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. platform:windows-gnu Windows support based on the MinGW-w64 toolchain + MSYS2 topic:stdlib:llvm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants