Skip to content

Support translate_c from source #643

@cerisier

Description

@cerisier

Starting zig 0.16, zig translate-c is now backed by translate-c project which uses arocc as the c compiler.

It is already advertised that one can depend on the translate-c repository directly to benefit from more translation options.

Since translate-c will soon become a mandatory build-step, we should already express a dependency on translate-c and arocc , and orchestrate the translation from those binaries built from source (or at least offer the option).

This would allow users to benefit from said additional options and overall increased flexibility rather than waiting for newer releases of zig to benefit from translate-c improvements.

For this, I'm not entirely sure of the full API just yet for rules_zig but I was thinking that we could have:

  1. A build setting to use a translate-c binary built from source
  2. A configuration knob at the toolchain level to allow users to control the source of the translate-c repository OR provide translate-c targets directly.

I already have something in place at ZML for this which takes translate-c target in the zig.toolchain but would love to discuss ideas on that.

We can also be incremental on that and start with a build setting to control legacy vs override behavior and only ask for translate-c label for now + build on top of that for more complete customization.

WDYT ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions