Skip to content

Conversation

HertzDevil
Copy link
Contributor

Crystal::LIBRARY_PATH always uses the host platform's path delimiter, but Process::PATH_DELIMITER is defined in terms of the target platform, which can break cross-compilation from a non-Windows system to Windows when CRYSTAL_LIBRARY_PATH has multiple items. This PR adds the correct delimiter as a constant.

By the way, this is actually the first usage of host_flag? in the repository.

@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 labels Feb 28, 2024
@straight-shoota
Copy link
Member

I'm wondering if Process is the best namespace for HOST_PATH_DELIMITER. Of course, there's some affinity to Process::PATH_DELIMITER. But it's used quite differently. As far as I can see, it's only meant as a compile-time constant and typically would not be used at runtime. It's also only for internal use.
So perhaps Crystal (or Crystal::System?) might be a better namespace for this? Would fit right next to Crystal::HOST_TRIPLE.

@straight-shoota straight-shoota added this to the 1.12.0 milestone Feb 28, 2024
@straight-shoota straight-shoota merged commit 8869186 into crystal-lang:master Feb 29, 2024
@HertzDevil HertzDevil deleted the bug/library-path-split branch February 29, 2024 13:29
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 Windows support based on the MSVC toolchain / Win32 API topic:stdlib:system

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants