Skip to content

Add Crystal::HOST_TRIPLE and TARGET_TRIPLE#13823

Merged
straight-shoota merged 3 commits intocrystal-lang:masterfrom
HertzDevil:feature/crystal-triple-constants
Nov 1, 2023
Merged

Add Crystal::HOST_TRIPLE and TARGET_TRIPLE#13823
straight-shoota merged 3 commits intocrystal-lang:masterfrom
HertzDevil:feature/crystal-triple-constants

Conversation

@HertzDevil
Copy link
Contributor

Resolves #13156.

{% 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) %})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@straight-shoota straight-shoota added this to the 1.11.0 milestone Oct 31, 2023
@straight-shoota straight-shoota merged commit 1e4be9b into crystal-lang:master Nov 1, 2023
@HertzDevil HertzDevil deleted the feature/crystal-triple-constants branch November 1, 2023 19:31
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Constants for host and target triples

2 participants