Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

also rewrite -isystem in addition to -sysroot #2631

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

adrianimboden
Copy link
Contributor

I build in a hermetic c++ toolchain and use -isystem args in addition to -sysroot which did not get rewritten before.

this is one of the errors I get (indirect dependency when using aspect_rules_py):

cargo:warning=ToolExecError: Command "/tmp/bazel-working-directory/_main/external/local_config_cc/bin/clang" ... "-nostdinc" "-isystem" "external/local_config_cc/cxxlib/fastbuild/include/clang" "-isystem" "external/local_config_cc/cxxlib/fastbuild/include/x86_64-linux-gnu" "-isystem" "external/local_config_cc/cxxlib/fastbuild/include" "--sysroot=/tmp/bazel-working-directory/_main/external/local_config_cc/cxxlib/fastbuild" ... "-o" "/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/external/rules_rust~~crate~crate_index__bzip2-sys-0.1.11-1.0.8/bzip2-sys_bs.out_dir/lib/bzip2-1.0.8/decompress.o" "-c" "bzip2-1.0.8/decompress.c"
cargo:warning=In file included from bzip2-1.0.8/decompress.c:22:
cargo:warning=bzip2-1.0.8/bzlib_private.h:25:10: fatal error: 'stdlib.h' file not found
cargo:warning=#include <stdlib.h>
cargo:warning=         ^~~~~~~~~~
cargo:warning=1 error generated.

I think it is unfortunate and probably brings more weird errors up in the future when the build command does not run in the same place where every other bazel rule runs the compiler.

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one comment - thanks for the contribution!

cargo/private/cargo_build_script.bzl Show resolved Hide resolved
@illicitonion illicitonion added this pull request to the merge queue Apr 29, 2024
Merged via the queue into bazelbuild:main with commit 64920a0 Apr 29, 2024
3 checks passed
rrbutani referenced this pull request in bazel-contrib/toolchains_llvm May 9, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [rules_rust](https://togithub.com/bazelbuild/rules_rust) |
http_archive | minor | `0.42.1` -> `0.43.0` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_rust (rules_rust)</summary>

###
[`v0.43.0`](https://togithub.com/bazelbuild/rules_rust/releases/tag/0.43.0)

[Compare
Source](https://togithub.com/bazelbuild/rules_rust/compare/0.42.1...0.43.0)

### 0.43.0

```python
load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_rust",
    integrity = "sha256-SnzocNvQp1YK1TW/aUVhR6RSROo1l2RilE1V20WFnK0=",
    urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.43.0/rules_rust-v0.43.0.tar.gz"],
)
```

Additional documentation can be found at:
https://bazelbuild.github.io/rules_rust/#setup

#### What's Changed

- Bzlmod-aware runfiles library by
[@&#8203;dzbarsky](https://togithub.com/dzbarsky) in
[https://github.com/bazelbuild/rules_rust/pull/2566](https://togithub.com/bazelbuild/rules_rust/pull/2566)
- Add clippy_flag flag to allow flags to be added in succession. by
[@&#8203;granaghan](https://togithub.com/granaghan) in
[https://github.com/bazelbuild/rules_rust/pull/2625](https://togithub.com/bazelbuild/rules_rust/pull/2625)
- Add aspect_rules_js to MODULE.bazel by
[@&#8203;dzbarsky](https://togithub.com/dzbarsky) in
[https://github.com/bazelbuild/rules_rust/pull/2618](https://togithub.com/bazelbuild/rules_rust/pull/2618)
- Register a default rust toolchain. by
[@&#8203;matts1](https://togithub.com/matts1) in
[https://github.com/bazelbuild/rules_rust/pull/2624](https://togithub.com/bazelbuild/rules_rust/pull/2624)
- Nit: Fix link to example in rust_bindgen.md by
[@&#8203;hauserx](https://togithub.com/hauserx) in
[https://github.com/bazelbuild/rules_rust/pull/2628](https://togithub.com/bazelbuild/rules_rust/pull/2628)
- Add context to error messages by
[@&#8203;illicitonion](https://togithub.com/illicitonion) in
[https://github.com/bazelbuild/rules_rust/pull/2408](https://togithub.com/bazelbuild/rules_rust/pull/2408)
- Update `cargo_bootstrap_repository` interface to match dependency
macros by [@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2630](https://togithub.com/bazelbuild/rules_rust/pull/2630)
- Added debug logging for spliced manifests to crate_universe by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2629](https://togithub.com/bazelbuild/rules_rust/pull/2629)
- also rewrite -isystem in addition to -sysroot by
[@&#8203;adrianimboden](https://togithub.com/adrianimboden) in
[https://github.com/bazelbuild/rules_rust/pull/2631](https://togithub.com/bazelbuild/rules_rust/pull/2631)
- Support loading http credentials from netrc by
[@&#8203;golovasteek](https://togithub.com/golovasteek) in
[https://github.com/bazelbuild/rules_rust/pull/2623](https://togithub.com/bazelbuild/rules_rust/pull/2623)
- Updated Buildifier version for crate_universe by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2634](https://togithub.com/bazelbuild/rules_rust/pull/2634)
- Follow-up documentation/fixes to lockfile API by
[@&#8203;illicitonion](https://togithub.com/illicitonion) in
[https://github.com/bazelbuild/rules_rust/pull/2637](https://togithub.com/bazelbuild/rules_rust/pull/2637)
- Add docs and examples of complicated build scripts by
[@&#8203;illicitonion](https://togithub.com/illicitonion) in
[https://github.com/bazelbuild/rules_rust/pull/2635](https://togithub.com/bazelbuild/rules_rust/pull/2635)
- Added Rust 1.78.0 by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2639](https://togithub.com/bazelbuild/rules_rust/pull/2639)
- Remove `incompatible_test_attr_crate_and_srcs_mutually_exclusive` by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2641](https://togithub.com/bazelbuild/rules_rust/pull/2641)
- Minor cleanup for crate_universe by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2644](https://togithub.com/bazelbuild/rules_rust/pull/2644)
- Use `cargo tree` to determine feature dependent optional deps by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2636](https://togithub.com/bazelbuild/rules_rust/pull/2636)
- Release 0.43.0 by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2642](https://togithub.com/bazelbuild/rules_rust/pull/2642)
- Update cross to fix crate_universe builds in releases by
[@&#8203;UebelAndre](https://togithub.com/UebelAndre) in
[https://github.com/bazelbuild/rules_rust/pull/2645](https://togithub.com/bazelbuild/rules_rust/pull/2645)

#### New Contributors

- [@&#8203;hauserx](https://togithub.com/hauserx) made their first
contribution in
[https://github.com/bazelbuild/rules_rust/pull/2628](https://togithub.com/bazelbuild/rules_rust/pull/2628)
- [@&#8203;adrianimboden](https://togithub.com/adrianimboden) made their
first contribution in
[https://github.com/bazelbuild/rules_rust/pull/2631](https://togithub.com/bazelbuild/rules_rust/pull/2631)
- [@&#8203;golovasteek](https://togithub.com/golovasteek) made their
first contribution in
[https://github.com/bazelbuild/rules_rust/pull/2623](https://togithub.com/bazelbuild/rules_rust/pull/2623)

**Full Changelog**:
bazelbuild/rules_rust@0.42.1...0.43.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/bazel-contrib/toolchains_llvm).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants