bazelbuild / bazelbuild/rules_rust

Additional output during compilation

Open
#2,561 2 comments 0 reactions 0 assignees View on GitHub
cargo needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

Hello,

I use bazel to compile a project using [Napi-rs](https://napi.rs/).
This crate allow to generate automatically Typescript definition by setting an environment variable [TYPE_DEF_TMP_PATH](https://github.com/napi-rs/napi-rs/blob/693f0ac2697c26f14bb4094caf5de1cd347a547f/cli/src/api/build.ts#L454) during compilation of rust package. It will create a file containing type definition at path specified in the env.

However, I haven't found an easy way to do this with the rules_rust.
For now, the best solution I've found is to patch these rules by adding an extra argument to explicitly add this output in the `rustc_compile_action`.

Do you know of a better option?
If not, should I open a PR to propose this change, or is it too specific?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.