Add Crystal::HOST_TRIPLE and TARGET_TRIPLE#13823
Add Crystal::HOST_TRIPLE and TARGET_TRIPLE#13823straight-shoota merged 3 commits intocrystal-lang:masterfrom
Crystal::HOST_TRIPLE and TARGET_TRIPLE#13823Conversation
spec/compiler/config_spec.cr
Outdated
| {% begin %} | ||
| # TODO: CRYSTAL_SPEC_COMPILER_BIN must be quoted (#11456) | ||
| {% compiler = (env("CRYSTAL_SPEC_COMPILER_BIN") || "bin/crystal").id %} | ||
| # TODO: check against Crystal::HOST_TRIPLE instead |
There was a problem hiding this comment.
I would like to add some context as to when this TODO should be applied. It's effectively after we drop forward compatibility with Crystal < 1.10 (assuming HOST_TARGET gets released in 1.10).
Not sure how to best express that though...
Maybe we could add a macro to already use HOST_TRIPLE when available? ({% if Crystal.has_constant?(:HOST_TRIPLE) %})
There was a problem hiding this comment.
We could also put the Crystal:: constant tests inside the primitive specs since they require a fresh compiler. Not sure if that'll look odd to some people
There was a problem hiding this comment.
Yeah, such specs could be a supplemenatry addition.
This spec is just using the constant for calculating the expected value, it's not testing the constant itself.
Resolves #13156.