bazelbuild / bazelbuild/rules_rust

rust_bindgen rule cannot find stdarg.h during remote execution

Open
#931 6 comments 1 reaction 0 assignees View on GitHub
bindgen needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

When I try to use `rust_bindgen` for the following files, it fails.

foo.h:
```
#include

int call(int foo);
```

foo.cc:
```
#include "foo.h"

int call(int foo) {}
```

BUILD
```
cc_library(
name = "foo",
srcs = ["foo.cc"],
hdrs = ["foo.h"],
)

rust_bindgen(
name = "foo_bindgen",
cc_lib = ":foo",
header = "foo.h",
)
```

Error:
```
ERROR: /home/david/test/BUILD:67:13: Generating bindings for foo.h.. failed: (Exit 1): cargo_bin_bindgen failed: error executing command bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_rust_bindgen__bindgen__0_58_1/cargo_bin_bindgen --no-rustfmt-bindings foo.h --output ... (remaining 6 arguments skipped)
foo.h:1:10: fatal error: 'stdarg.h' file not found
foo.h:1:10: fatal error: 'stdarg.h' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', external/rules_rust_bindgen__bindgen__0_58_1/src/main.rs:54:36
```

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.