On linux, if there is no surgical host (which is the default for linking) then users get an error.
LinkingStrategy was set to Surgical (default), but I tried to find the surgical host at any of these paths Either the generic host files or the surgical host files must exist. File status: Generic host (platform/host.rh): missing, Generic metadata (platform/metadata_host.rm): missing, Surgical host (platform/linux-x64.rh): missing, Surgical metadata (platform/metadata_linux-x64.rm): missing but it does not exist.
I think it should be ok to default to the legacy host if one is available and just use that without a warning.
I think we discussed it previously, that roc should only give a warning if a --linker flag was given, otherwise link the prebuilt host that is available.
Just wanted to confirm we're happy to change to use the legacy host without a warning if no flag is provided.
110%
I think I left that out in purpose in the rebuilt host PR, it complicated the code a lot at the time, and that particular function is already very complex. It could be easier though to integrate in the current version, not sure. I do still strongly dislike this type of switching things silently behind the scenes.
Once we have a standardized way to build platforms that everyone uses this should occur very rarely.
I prefer a nice error tip by a large margin, or at least a warning mentioning the switch to the user.
The legacy linker can be very noticeably slower, silently degrading the user experience feels like a mistake.
I am aware that switching automatically is also an improvement to the user experience.
A warning feels like it strikes a good balance
For me, being able to specify the linker to use as a platform setting would already make a huge difference. The platform I'm working on seems to run into this error case for any application I write against it, and it'd be nice if users writing scripts against it wouldn't need to pass this --linker=legacy option.
hm, so a relevant consideration here is that long-term the goal is to eliminate the legacy linker
(the only reason it's called "legacy" and not "deprecated" is that we don't have the surgical option available on all our supported targets yet)
so it seems like this might create the impression that it's something we're planning to support indefinitely :thinking:
are there platforms where surgical hosts can't be created successfully on Linux right now?
are there platforms where surgical hosts can't be created successfully on Linux right now?
I have not hit this for a while, but I think it's still possible to hit #3609
The json package hits #3609 and still requires --linker=legacy
basic-webserver also hits #3609
I do still strongly dislike this type of switching things silently behind the scenes.
I am ok leaving this for now.
I will work to try and ensure our platforms have a surgical host.
I think this will only be experienced by people dipping into platform development, and it is reasonable thing for these persons to learn about roc.
We should definitely silently switch behind the scenes in my opion
The surgical linker isn't ready
Not even on linux
And it is totally unsupported on other platforms
If a platform only supports the legacy linker today. We should just use the legacy linker
It benefits zero users to force them to specify the linker flag all the time
That is a platform detail and not something the user even has control over
fair enough
What about the case, that the compiler hits the issue #3609 ?
Currently, there is a special error message. So it is possible for the compiler to detect this case. Should it also automatically use the legacy linker?
I don't know what my opinion is. On the one hand, it is annoying to manually set the surgical linker. On the other hand, as someone who has played with platform development, I probably would not have learned to build the stuff for the surgical linker and all my platforms would only work with the legacy linker.
So I think that this change will lead in a direction where platforms do not have the files for the surgical linker and therefore the surgical linker gets irrelevant.
For example, you can see how strange the changes are, to support both linkers in a go platform:
https://github.com/lukewilliamboswell/roc-platform-template-go/pull/1/files
I get, why @Luke Boswell did not merge this PR. If I had a Mac and therefore did not have to manually specify the legacy linker, I would not do all the hacks to support the surgical linker.
That's fair
I think the surgical linker has a major bug that will require a significant rewrite. It is lucky that it works most of the time, but until it works all the time it is nice to have but not really worth forcing on people.
It is cool that it is super fast, but that isn't the end all be all.
I hadnt noticed that PR...
Luke Boswell said:
I hadnt noticed that PR...
And you gave me merge permissions. So it's not fair that I point at you :stuck_out_tongue_wink:
Last updated: Jun 16 2026 at 16:19 UTC