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 macro Crystal::LIBRARY_PATH.split when cross-compiling #14330

Merged

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.

@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
57 checks passed
@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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants