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

Work In Progress: Quick prototype of a cargo_crate repository rule #100

Closed
wants to merge 2 commits into from

Commits on Jun 14, 2018

  1. Set the Rust target platform triplet using the toolchain description

    This change add a 'triplet' information to the toolchain that is
    then used to specify the target platform to Rust.
    damienmg committed Jun 14, 2018
    Configuration menu
    Copy the full SHA
    aad5ce0 View commit details
    Browse the repository at this point in the history
  2. Quick and dirty prototype of a cargo_crate repository rule

    This rule would allow cargo raze to just output a bzl file in remote mode
    and then rely on the rule to generate the correct BUILD files.
    
    An exemple of rule that cargo raze could generate would looks like:
    
    ```python
    cargo_crate(
      name = "ansi_term",  # The crate name
      version = "0.11.0",  # The crate version
      # List of resolved dependency version.
      # If a dependency is needed by the library and absent from this list
      # the cargo_crate rule will emit a warning and not add the dependency in
      # the build rule, making it potentially unable to compile.
      locked_deps = {"winapi": "0.3.5"},
      # Other optional attributes:
      #  - flags: contains a list of rustc flags to add to the rust_{library,binary} rules.
      #  - data: contains the data attribute to propagate to the rust_{library,binary} rules.
      #  - sha256: SHA-256 checksum of the crate, recommended since it enhance Bazel caching.
    )
    ```
    
    To-do:
    
      [ ] Stabilize API
      [ ] Document
      [ ] Add automated tests
    damienmg committed Jun 14, 2018
    Configuration menu
    Copy the full SHA
    1fbf5ae View commit details
    Browse the repository at this point in the history