Stream: compiler development

Topic: target triples


view this post on Zulip Brendan Hansknecht (Mar 21 2024 at 23:54):

As I am converting from triples to roc target, one location that has an extra dependency is related to the windows build. I was wondering if this is an old hack or if it is still used.

For building zig native hosts on windows with gnu, we use x86_64-windows-gnu. Do we actually run into windows with gnu when calling Triple::host()? I would assume that the host triple is never going to produce windows gnu. Given we have no way to specify the x86_64-windows-gnu triplet from the command line, I would assume that this is not actually possible to hit currently. Is that the case?

CC: @Luke Boswell or @Folkert de Vries
I think you two know the most about the windows build.

view this post on Zulip Luke Boswell (Mar 22 2024 at 00:05):

I'm not sure. Are you talking about building the platform side? I thought the plan was to rip all the platform building out from roc and just use pre-built binaries and the platforms are responsible for building themselves
?

view this post on Zulip Luke Boswell (Mar 22 2024 at 00:06):

I'm on my Windows machine at the moment, so happy to test out any ideas if you have a branch and need any help.

view this post on Zulip Brendan Hansknecht (Mar 22 2024 at 01:11):

This is in the legacy linker. So yeah, in code that should eventually get ripped out. Some is for building the platform. Some is used for link windows.

Don't have a branch yet, just a pile of code that doesn't compile yet.

view this post on Zulip Brendan Hansknecht (Mar 22 2024 at 01:11):

Anyway, you can still test

view this post on Zulip Brendan Hansknecht (Mar 22 2024 at 01:11):

Try removing this branch and just always using "native": https://github.com/roc-lang/roc/blob/d988eadbb1ed9d2f9e559564875355b1760fdef7/crates/compiler/build/src/link.rs#L788-L792

view this post on Zulip Luke Boswell (Mar 22 2024 at 01:51):

@Brendan Hansknecht from my testing on Windows I can't see any difference just using "native"

view this post on Zulip Brendan Hansknecht (Mar 22 2024 at 02:09):

Awesome... More stuff I can rip out

view this post on Zulip Richard Feldman (Apr 16 2025 at 13:10):

https://mcyoung.xyz/2025/04/14/target-triples/ is both an excellent article and also a good motivating explanation for why I don't want roc to support target triples :laughing:

view this post on Zulip Richard Feldman (Apr 16 2025 at 13:11):

(and instead support massively simplified options like linux-x64 which we can enumerate)

view this post on Zulip alexrp (May 16 2025 at 15:10):

fwiw, i would note that zig's notion of target triples already is much more principled in design than gnu/llvm/rust triples, and will be even more so in the near future:

not necessarily saying this to dissuade you from what you want to do, just to point out that target triples (or perhaps more appropriately "target strings" in the future) can actually be not-insane


Last updated: Jul 06 2025 at 12:14 UTC