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

Enable rust_analyzer and VSCode integration. #444

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f925106
Enable rust_analyzer and VSCode integration.
sayrer Aug 29, 2021
ef559f0
load statement at the top.
sayrer Aug 29, 2021
ab6a530
Buildifier.
sayrer Aug 29, 2021
bdc2d59
Update rules_rust version.
sayrer Aug 29, 2021
bc5b0f4
Correct static lib order.
sayrer Aug 29, 2021
4cbe527
Delete .travis.yml (#445)
acmcarther Aug 31, 2021
a28427d
Up to 0.13.0 [via publish-new-version.sh]
Oct 23, 2021
4703d08
Update rules_rust and rules_foreign_cc to latest
djmarcin Nov 15, 2021
26c99a4
buildifier
djmarcin Nov 15, 2021
63d5609
pcre is no longer served from ftp.pcre.org
djmarcin Nov 15, 2021
0bc9b00
Merge pull request #452 from djmarcin/main
UebelAndre Nov 16, 2021
e34a8a3
Fix a small typo in the README (#456)
vmax Dec 3, 2021
e123041
Fix clippy errors (#457)
Dec 8, 2021
c7643ef
Update publish script to be more robust and take remote name (#459)
Dec 8, 2021
8b5b173
Up to 0.13.1 [via publish-new-version.sh]
Dec 8, 2021
b90d70e
Preserve original crate name as a Bazel target tag (#455)
vmax Dec 8, 2021
d98f017
Up to 0.14.0 [via publish-new-version.sh]
Dec 8, 2021
527f494
Include "additional_flags" in build scripts. (#461)
PiotrSikora Jan 4, 2022
b717769
Sort "tags" (#462)
PiotrSikora Jan 5, 2022
41db1a7
Up to 0.14.1 [via publish-new-version.sh]
Jan 5, 2022
80772c1
Fix clippy errors on 1.58
Jan 29, 2022
3bf358a
Fix symlink for windows. (#464)
lehrbaumm Jan 29, 2022
1ee9861
Up to 0.14.2 [via publish-new-version.sh]
Jan 29, 2022
6f4712f
README: Change branch name from master to main (#469)
kevinji Feb 15, 2022
a159fdf
Added a filegroup for all Bazel sources (#470)
UebelAndre Feb 17, 2022
9d29b92
add changelog
Feb 17, 2022
eea4c25
Up to 0.15.0 [via publish-new-version.sh]
Feb 17, 2022
8f151ad
Update codeowners and changelog (#473)
Feb 18, 2022
b7556c0
Enable rust_analyzer and VSCode integration.
sayrer Aug 29, 2021
71423ac
load statement at the top.
sayrer Aug 29, 2021
9ba4090
Buildifier.
sayrer Aug 29, 2021
29cff3c
Merge upstream.
sayrer Mar 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build --repo_env=RULES_RUST_TOOLCHAIN_INCLUDE_RUSTC_SRCS=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/bazel-*
**/target/
rust-project.json
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Generate rust-project.json",
"command": "bazel",
"args": ["run", "@rules_rust//tools/rust_analyzer:gen_rust_project"],
"options": {
"cwd": "${workspaceFolder}"
},
"group": "build",
"problemMatcher": [],
"presentation": {
"reveal": "never",
"panel": "dedicated",
},
"runOptions": {
"runOn": "folderOpen"
}
},
]
}
10 changes: 10 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_rust//rust:defs.bzl", "rust_analyzer")

alias(
name = "cargo_raze",
actual = "//impl:cargo_raze",
Expand Down Expand Up @@ -35,3 +37,11 @@ test_suite(
],
visibility = ["//visibility:private"],
)

rust_analyzer(
name = "rust_analyzer",
targets = [
"//impl:cargo_raze_bin",
"//impl:cargo_raze",
],
)
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Change Log

## v0.15.0
* Added all generated bazel files to an exported filegroup

## v0.14.2
* Fixed [#417](https://github.com/google/cargo-raze/issues/417) where symlinks
were improperly generated on Windows [[#464](
https://github.com/google/cargo-raze/pull/464)].

## v0.14.1
* Added additional flags into the build scripts [[#461](
https://github.com/google/cargo-raze/pull/461)]
* Fixed an issue where tags were no longer sorted [[#462](
https://github.com/google/cargo-raze/pull/462)]

## v0.14.0
* Added a `crate-name` tag to generated bazel files that holds the original
crate name without shifting `-` to `_` [[#455](
https://github.com/google/cargo-raze/pull/455)]

## v0.13.1
* Updated bazel-based build rules for cargo raze to use latest rules_rust and
rules_foreign_cc, which had breaking changes. No significant behavior changes
[[#452](https://github.com/google/cargo-raze/pull/452)]

## v0.13.0
* Planning is now done using the resolve tree, rather than packages, which
resolves a number of issues (
[#144](https://github.com/google/cargo-raze/issues/144),
[#187](https://github.com/google/cargo-raze/issues/187),
[#241](https://github.com/google/cargo-raze/issues/241),
[#269](https://github.com/google/cargo-raze/issues/269),
[#270](https://github.com/google/cargo-raze/issues/270)),
[[#425](https://github.com/google/cargo-raze/pull/425)]
* Fixed issue [#355](https://github.com/google/cargo-raze/issues/355) for dev
dependencies [[#405](https://github.com/google/cargo-raze/pull/405)]
* Stopped panicking on unrecognized licenses
[[#413](https://github.com/google/cargo-raze/pull/413)]
* Started reporting an error if lock file generation failed
[[#411](https://github.com/google/cargo-raze/pull/411)]
* Fixed issue [#389](https://github.com/google/cargo-raze/issues/389) where
default dependencies would be incorrectly duplicated in the platform-specific
dependencies [[#437](https://github.com/google/cargo-raze/pull/437)]
* Made some structs sortable and deserializable for when cargo raze is being
used as a library [[#415](https://github.com/google/cargo-raze/pull/415)]

## v0.12.0
* Fixed an issue ([#354](https://github.com/google/cargo-raze/issues/354)) where
a leading slash could be placed on package names if Cargo.toml and WORKSPACE
are in the same directory.
[[#411](https://github.com/google/cargo-raze/pull/411)]
* Fixed an issue with a leading slash on package names for Windows
[[#401](https://github.com/google/cargo-raze/pull/401)]
* Started setting the `links` attribute for `cargo_build_script`
[[#400](https://github.com/google/cargo-raze/pull/400)]

## v0.11 and below
* Please check the git history.
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Code owners of cargo-raze

* @acmcarther
* @dfreese @UebelAndre @illicitonion @acmcarther
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ genmode = "Remote"

#### Cargo workspace projects

In projects that use [cargo workspaces](cargo_workspaces) uses should organize
In projects that use [cargo workspaces](cargo_workspaces) users should organize
all of their `raze` settings into the `[workspace.metadata.raze]` field in the
top level `Cargo.toml` file which contains the `[workspace]` definition. These
settings should be identical to the ones seen in `[package.metadata.raze]` in
Expand Down Expand Up @@ -497,14 +497,14 @@ See these examples of providing crate configuration:

**Using vendored mode**:

- [hello-cargo-library](https://github.com/google/cargo-raze/tree/master/examples/vendored/hello_cargo_library)
- [complicated-cargo-library](https://github.com/google/cargo-raze/tree/master/examples/vendored/complicated_cargo_library)
- [non-cratesio](https://github.com/google/cargo-raze/tree/master/examples/vendored/non_cratesio_library)
- [hello-cargo-library](https://github.com/google/cargo-raze/tree/main/examples/vendored/hello_cargo_library)
- [complicated-cargo-library](https://github.com/google/cargo-raze/tree/main/examples/vendored/complicated_cargo_library)
- [non-cratesio](https://github.com/google/cargo-raze/tree/main/examples/vendored/non_cratesio_library)

**Using remote mode**:

- [complicated-example](https://github.com/google/cargo-raze/tree/master/examples/remote/complicated_cargo_library)
- [non-cratesio](https://github.com/google/cargo-raze/tree/master/examples/remote/non_cratesio)
- [complicated-example](https://github.com/google/cargo-raze/tree/main/examples/remote/complicated_cargo_library)
- [non-cratesio](https://github.com/google/cargo-raze/tree/main/examples/remote/non_cratesio)

**Compiling OpenSSL**:

Expand Down
4 changes: 4 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ examples_repository()
load("@cargo_raze_examples//:repositories.bzl", examples_repositories = "repositories")

examples_repositories()

load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_deps")

rust_analyzer_deps()
2 changes: 1 addition & 1 deletion examples/remote/binary_dependencies/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_rust//rust:rust.bzl", "rust_binary")
load("@rules_rust//rust:defs.bzl", "rust_binary")
load("//remote/binary_dependencies/cargo:crates.bzl", "all_crate_deps")

package(default_visibility = ["//visibility:public"])
Expand Down
16 changes: 13 additions & 3 deletions examples/remote/binary_dependencies/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,18 @@ alias(

# Export file for Stardoc support
exports_files(
[
"crates.bzl",
],
glob([
"**/*.bazel",
"**/*.bzl",
]),
visibility = ["//visibility:public"],
)

filegroup(
name = "srcs",
srcs = glob([
"**/*.bazel",
"**/*.bzl",
]),
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=addr2line",
"manual",
],
version = "0.14.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=adler",
"manual",
],
version = "0.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=adler32",
"manual",
],
version = "1.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=ansi_term",
"manual",
],
version = "0.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=atty",
"manual",
],
version = "0.2.14",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=autocfg",
"manual",
],
version = "1.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=backtrace",
"manual",
],
version = "0.3.54",
Expand Down
17 changes: 17 additions & 0 deletions examples/remote/binary_dependencies/cargo/remote/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Export file for Stardoc support
exports_files(
glob([
"**/*.bazel",
"**/*.bzl",
]),
visibility = ["//visibility:public"],
)

filegroup(
name = "srcs",
srcs = glob([
"**/*.bazel",
"**/*.bzl",
]),
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=bitflags",
"manual",
],
version = "1.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=bytemuck",
"manual",
],
version = "1.4.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=byteorder",
"manual",
],
version = "1.3.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=cfg-if",
"manual",
],
version = "0.1.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=cfg-if",
"manual",
],
version = "1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=clap",
"manual",
],
version = "2.33.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=console",
"manual",
],
version = "0.13.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=crc32fast",
"manual",
],
version = "1.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=crossbeam-utils",
"manual",
],
version = "0.7.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=deflate",
"manual",
],
version = "0.8.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=encode_unicode",
"manual",
],
version = "0.3.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ rust_library(
],
tags = [
"cargo-raze",
"crate-name=error-chain",
"manual",
],
version = "0.10.0",
Expand Down
Loading