Skip to content

Update documentation to the latest commit #539

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

Closed
chandlerc opened this issue Dec 20, 2020 · 4 comments
Closed

Update documentation to the latest commit #539

chandlerc opened this issue Dec 20, 2020 · 4 comments

Comments

@chandlerc
Copy link

Currently the docs suggest pulling an archive from November 10th. Using this with cargo raze, I couldn't get anything to work due to the Bazel version checks being broken somehow.

To fix this, I just pulled a more recent version. Filing this issue to nudge towards updating the documentation.

Given that there has not yet been a release, maybe it makes sense to switch the documentation to recommend a git_repository fetch instead of a pinned archive of a particular commit? That would at least allow bazel sync to update to the latest...

@UebelAndre
Copy link
Collaborator

UebelAndre commented Dec 21, 2020

Somewhat related to this, there's an ongoing (dead?) conversation about the state of releases for these rules in #415

In general I think it's better to adopt releases vs using git_repository to prevent unexpected breakages for end users. That said, updating documentation to communicate the state of releases or how to use the rules in your project would definitely improve things.

Edit: A little more context here. I make regular pull requests for cargo-raze and have either noticed or made changes that make that tool incompatible with older versions of rules_rust in some ways. It'd be great to be able to communicate the version compatibilities between the two. For this and various other reasons, I do hope to see releases for these rules.

@sigmaxipi
Copy link

For those who were having trouble getting started, this is the minimal WORKSPACE file I used to get past the version issues:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")                                                                                                           
git_repository(                                                                                                                                                                 
    name = "io_bazel_rules_rust",                                                                                                                                               
    remote = "https://github.com/bazelbuild/rules_rust/",                                                                                                                       
    commit = "c7a408a8c58c6dde73a552d6f78f90c7ef96b513",                                                                                                                        
)                                                                                                                                                                               
                                                                                                                                                                                
load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")                                                                                                        
rust_repositories()

@UebelAndre
Copy link
Collaborator

I would recommend using http_archive if you're going to be pinning to a commit. Downloading the repository will be faster.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_rules_rust",
    sha256 = "bbebfd5b292fa8567fa012b3d1056f2e51611fe8ac898860323b6b4d763a4efd",
    strip_prefix = "rules_rust-c7a408a8c58c6dde73a552d6f78f90c7ef96b513",
    urls = [
        # Master branch as of 2020-12-22
        "https://github.com/bazelbuild/rules_rust/archive/c7a408a8c58c6dde73a552d6f78f90c7ef96b513.tar.gz",
    ],
)

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")

rust_repositories()

If someone were to want to simply stay on master, then I think git_repository makes sense:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
    name = "io_bazel_rules_rust",
    remote = "https://github.com/bazelbuild/rules_rust/",
    branch = "master",
)

@UebelAndre
Copy link
Collaborator

Now that rules_rust does releases, documentation on how to get the latest release of the rules can be found in the notes for each release: https://github.com/bazelbuild/rules_rust/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants