Populate CFLAGS and CXXFLAGS when invoking build script. (#1081)

Downstream tools (in particular cc-rs) depend on them being set.

The particular use case that I noticed was broken was the macos
deployment target (specified via the --macos_minimun_os Bazel option)
wasn't being applied on binaries being built via cc-rs in a build.rs
script. This was causing all sort of bugs such as symbols not being
weakly linked since it was using the SDK version (the default) for the
deployment target and bazel-built Rust binaries wouldn't load on older
OS versions due to failures to resolve symbols at runtime, even though
the deployment target was correctly set in Bazel.
2 files changed
tree: bbbeea726c553bf8f7fa07e4582ef869d7de534c
  1. .bazelci/
  2. .github/
  3. bindgen/
  4. cargo/
  5. crate_universe/
  6. docs/
  7. examples/
  8. proto/
  9. rust/
  10. test/
  11. tools/
  12. util/
  13. wasm_bindgen/
  14. .bazelignore
  15. .bazelrc
  16. .gitignore
  17. ARCHITECTURE.md
  18. AUTHORS
  19. BUILD.bazel
  20. CODEOWNERS
  21. COMPATIBILITY.md
  22. CONTRIBUTING.md
  23. CONTRIBUTORS
  24. LICENSE.txt
  25. README.md
  26. WORKSPACE.bazel
  27. workspace.bzl
README.md

Rust Rules

  • Postsubmit Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Community

General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust.

Documentation

Please refer to the full documentation.