Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bazelbuild/rules_rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.42.1
Choose a base ref
...
head repository: bazelbuild/rules_rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.43.0
Choose a head ref
  • 19 commits
  • 251 files changed
  • 10 contributors

Commits on Apr 22, 2024

  1. Bzlmod-aware runfiles library (#2566)

    This implements the repo_mapping capabilities and provides a new
    runfiles API. The new API can be accessed explicitly as
    `runfiles::Runfiles::rlocation_from` or with the `runfiles::rlocation!`
    macro, which adds compile-time support for correctly embedding the
    external repo. This is a purely new API, existing usage continues to
    work, although we mark it deprecated because it's not fully correct. We
    can remove it at some point in the future.
    
    This PR also transitions in-repo examples/tests to using it, in case
    anyone copies them.
    
    ---------
    
    Co-authored-by: scentini <[email protected]>
    dzbarsky and scentini authored Apr 22, 2024
    Configuration menu
    Copy the full SHA
    8d074a0 View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2024

  1. Add clippy_flag flag to allow flags to be added in succession. (#2625)

    This helps keep my bazelrc cleaner since I can pass clippy flags on
    multiple lines with comments about why they're being added.
    
    Co-authored-by: Daniel Wagner-Hall <[email protected]>
    granaghan and illicitonion authored Apr 23, 2024
    Configuration menu
    Copy the full SHA
    72d1d4a View commit details
    Browse the repository at this point in the history
  2. Add aspect_rules_js to MODULE.bazel (#2618)

    Otherwise wasm_bindgen with rules_js is unusable.
    dzbarsky authored Apr 23, 2024
    Configuration menu
    Copy the full SHA
    df7a655 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2024

  1. Configuration menu
    Copy the full SHA
    29ec07a View commit details
    Browse the repository at this point in the history
  2. Nit: Fix link to example in rust_bindgen.md (#2628)

    Co-authored-by: Daniel Wagner-Hall <[email protected]>
    hauserx and illicitonion authored Apr 24, 2024
    Configuration menu
    Copy the full SHA
    a2d1344 View commit details
    Browse the repository at this point in the history
  3. Add context to error messages (#2408)

    Co-authored-by: UebelAndre <[email protected]>
    illicitonion and UebelAndre authored Apr 24, 2024
    Configuration menu
    Copy the full SHA
    4c554fc View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2024

  1. Configuration menu
    Copy the full SHA
    2776987 View commit details
    Browse the repository at this point in the history
  2. Added debug logging for spliced manifests to crate_universe (#2629)

    This adds the following new logging when `CARGO_BAZEL_DEBUG=1` is
    enabled in the environment when the repository rule runs.
    ```
    cd test/no_std && CARGO_BAZEL_REPIN=1 CARGO_BAZEL_DEBUG=1 bazel sync --only=no_std_crate_index
    ```
    ````
    ...
    ...
    Splice 2024-04-27T16:31:48.249675Z DEBUG write_registry_urls_and_feature_map: cargo_bazel::splicing::splicer: Writing Cargo manifest '/private/var/tmp/_bazel_user/427c86c43c8db37f50959419e7306f4e/external/no_std_crate_index/splicing-workspace/Cargo.toml':
    ```toml
    [dependencies.libc_alloc]
    version = "1.0.3"
    
    [lib]
    name = "direct_cargo_bazel_deps"
    path = ".direct_cargo_bazel_deps.rs"
    required-features = []
    
    [package]
    edition = "2018"
    name = "direct-cargo-bazel-deps"
    version = "0.0.1"
    
    [workspace]
    members = []
    resolver = "2"
    
    [workspace.metadata.cargo-bazel.features."direct-cargo-bazel-deps
    0.0.1"]
    common = []
    
    [workspace.metadata.cargo-bazel.features."direct-cargo-bazel-deps
    0.0.1".selects]
    
    [workspace.metadata.cargo-bazel.features."libc_alloc 1.0.4"]
    common = []
    
    [workspace.metadata.cargo-bazel.features."libc_alloc 1.0.4".selects]
    
    [workspace.metadata.cargo-bazel.package_prefixes]
    
    [workspace.metadata.cargo-bazel.sources."libc_alloc 1.0.4"]
    sha256 =
    "6a090348b66d90d8507e30f0d2bd88e5a5c454bd1733fc6d617cbc3471bf69ea"
    url = "https://static.crates.io/crates/libc_alloc/1.0.4/download"
    ```
    ...
    ...
    ````
    UebelAndre authored Apr 29, 2024
    Configuration menu
    Copy the full SHA
    c43af7b View commit details
    Browse the repository at this point in the history
  3. also rewrite -isystem in addition to -sysroot (#2631)

    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.
    adrianimboden authored Apr 29, 2024
    Configuration menu
    Copy the full SHA
    64920a0 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Support loading http credentials from netrc (#2623)

    Bazel's `http_archive` and `http_file` use `~/.netrc` file to load HTTP
    credentials.
    
    Now rules_rust use the same approach if no other authorization
    parameters are provided.
    
    NOTE: `http_archive` supports passing a custom `netrc` and
    `auth_patterns`. But this parameters are not added to the rust rules at
    the moment.
    
    ---------
    
    Co-authored-by: Daniel Wagner-Hall <[email protected]>
    golovasteek and illicitonion authored Apr 30, 2024
    Configuration menu
    Copy the full SHA
    78d920b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1fc0f8c View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. Configuration menu
    Copy the full SHA
    0ca65fb View commit details
    Browse the repository at this point in the history

Commits on May 3, 2024

  1. Configuration menu
    Copy the full SHA
    d6c5704 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2024

  1. Configuration menu
    Copy the full SHA
    3342d68 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dd7a694 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2024

  1. Configuration menu
    Copy the full SHA
    29aed66 View commit details
    Browse the repository at this point in the history
  2. Use cargo tree to determine feature dependent optional deps (#2636)

    The Cargo [Feature Resolver version
    2](https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2)
    behavior is currently not supported by the `cargo metadata` sub command
    (rust-lang/cargo#9863) which `crate_universe`
    uses to determine the dependencies of a target, leading to inaccuracies
    when dependencies are introduced via feature resolution for a particular
    configuration.
    
    In #1710 functionality was
    added to use `cargo tree` to perform feature resolution for each
    supported platform. This change expands on this trick to collect
    dependency information at the same time and use that to determine
    whether or not to include optional dependencies located in standard
    `cargo metadata` output in the rendered Bazel targets. Non optional or
    `target.cfg` (conditional) dependencies behave as they did before this
    change.
    
    Implementation details:
    - `FeatureGenerator` was replaced by `TreeResolver`
    - Optional dependencies are now rendered as selects on explicit
    platforms. This will expand the size of `cargo-bazel-lock.json` files
    but is expected to be more correct.
    UebelAndre authored May 8, 2024
    Configuration menu
    Copy the full SHA
    f22926a View commit details
    Browse the repository at this point in the history
  3. Release 0.43.0 (#2642)

    UebelAndre authored May 8, 2024
    Configuration menu
    Copy the full SHA
    56456cf View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. Configuration menu
    Copy the full SHA
    5b0a6a9 View commit details
    Browse the repository at this point in the history
Loading