Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/cargo_bazel_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ defaults:

jobs:
validation:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# TODO: Unfortunately it's not obvious how to restrict `workflow_dispatch` to a particular branch
# so this step ensures releases are always done off of `main`.
- name: Ensure branch is 'main'
Expand All @@ -31,9 +31,9 @@ jobs:
fi
builds:
needs: validation
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install rust toolchains for host
run: |
# Detect the current version of rust
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
code-format-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Buildifier
run: |
wget "https://github.com/bazelbuild/buildtools/releases/download/v${BUILDIFIER_VERSION}/buildifier-linux-amd64" -O buildifier
Expand Down
39 changes: 18 additions & 21 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
name: Release
on:
workflow_dispatch:
merge_group:
pull_request:
branches:
- main
paths:
- version.bzl
push:
branches:
- main
Expand All @@ -17,21 +23,9 @@ env:

jobs:
validation:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# TODO: Unfortunately it's not obvious how to restrict `workflow_dispatch` to a particular branch
# so this step ensures releases are always done off of `main`.
- name: Ensure branch is 'main'
run: |
git fetch origin &> /dev/null
branch="$(git rev-parse --abbrev-ref HEAD)"
if [[ "${branch}" != "main" ]]; then
echo "The release branch must be main. Got '${branch}'' instead." >&2
exit 1
else
echo "Branch is '${branch}'"
fi
- uses: actions/checkout@v4
- name: Ensure release does not already exist
run: |
git fetch origin &> /dev/null
Expand All @@ -53,7 +47,7 @@ jobs:
- os: macOS-13
env:
TARGET: "aarch64-apple-darwin"
- os: ubuntu-20.04
- os: ubuntu-22.04
env:
TARGET: "aarch64-unknown-linux-gnu"
- os: windows-2022
Expand All @@ -62,20 +56,20 @@ jobs:
- os: macOS-13
env:
TARGET: "x86_64-apple-darwin"
- os: ubuntu-20.04
- os: ubuntu-22.04
env:
TARGET: "x86_64-pc-windows-gnu"
- os: windows-2022
env:
TARGET: "x86_64-pc-windows-msvc"
- os: ubuntu-20.04
- os: ubuntu-22.04
env:
TARGET: "x86_64-unknown-linux-gnu"
- os: ubuntu-20.04
- os: ubuntu-22.04
env:
TARGET: "x86_64-unknown-linux-musl"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install rust toolchains for host
run: |
# Detect the current version of rust
Expand All @@ -99,6 +93,8 @@ jobs:
- name: Setup Windows Bazelrc
run: |
echo "startup --output_user_root=C:/tmp" > ./user.bazelrc
echo "startup --windows_enable_symlinks" > ./user.bazelrc
echo "build --enable_runfiles" > ./user.bazelrc
if: startswith(matrix.os, 'Windows')
- name: Build cargo-bazel binaries
run: |
Expand All @@ -117,10 +113,11 @@ jobs:
path: ${{ github.workspace }}/crate_universe/target/artifacts/${{ matrix.env.TARGET }}
if-no-files-found: error
release:
if: startsWith(github.ref, 'refs/heads/main')
needs: builds
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/crate_universe/target/artifacts
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module(
name = "rules_rust",
version = "0.60.0",
version = "0.60.1",
)

###############################################################################
Expand Down
4 changes: 2 additions & 2 deletions crate_universe/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ There are some examples of using crate_universe with bzlmod in the [example fold
To use rules_rust in a project using bzlmod, add the following to your MODULE.bazel file:

```python
bazel_dep(name = "rules_rust", version = "0.60.0")
bazel_dep(name = "rules_rust", version = "0.60.1")
```

You find the latest version on the [release page](https://github.com/bazelbuild/rules_rust/releases).
Expand Down Expand Up @@ -243,7 +243,7 @@ module(
bazel_dep(name = "bazel_skylib", version = "1.7.1")

# https://github.com/bazelbuild/rules_rust/releases
bazel_dep(name = "rules_rust", version = "0.60.0")
bazel_dep(name = "rules_rust", version = "0.60.1")

###############################################################################
# T O O L C H A I N S
Expand Down
8 changes: 4 additions & 4 deletions crate_universe/tools/cross_installer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ rust_binary(
edition = "2021",
proc_macro_deps = all_crate_deps(proc_macro = True),
rustc_env = {
"CARGO": "$(rootpath @rules_rust//rust/toolchain:current_cargo_files)",
"CROSS_BIN": "$(rootpath :cross)",
"CROSS_CONFIG": "$(rootpath :Cross.toml)",
"CARGO": "$(rlocationpath @rules_rust//rust/toolchain:current_cargo_files)",
"CROSS_BIN": "$(rlocationpath :cross)",
"CROSS_CONFIG_RLOCATION": "$(rlocationpath :Cross.toml)",
},
deps = all_crate_deps(normal = True),
deps = all_crate_deps(normal = True) + ["@rules_rust//rust/runfiles"],
)

filegroup(
Expand Down
24 changes: 22 additions & 2 deletions crate_universe/tools/cross_installer/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! A utility for cross compiling binaries using Cross

use runfiles::{rlocation, Runfiles};
use std::path::{Path, PathBuf};
use std::process::{self, Command};
use std::{env, fs};
Expand All @@ -22,7 +23,13 @@ struct Options {
fn prepare_workspace(workspace_root: &Path) {
// Unfortunately, cross runs into issues when cross compiling incrementally.
// To avoid this, the workspace must be cleaned
let cargo = env::current_dir().unwrap().join(env!("CARGO"));
let r = Runfiles::create().unwrap();
let cargo = rlocation!(r, env!("CARGO")).unwrap();

if !cargo.exists() {
panic!("Cargo binary not found at {}", cargo.display());
}

Command::new(cargo)
.current_dir(workspace_root)
.arg("clean")
Expand All @@ -32,7 +39,19 @@ fn prepare_workspace(workspace_root: &Path) {

/// Execute a build for the provided platform
fn execute_cross(working_dir: &Path, target_triple: &str) {
let cross = env::current_dir().unwrap().join(env!("CROSS_BIN"));
let r = Runfiles::create().unwrap();
let cross = rlocation!(r, env!("CROSS_BIN")).unwrap();

if !cross.exists() {
panic!("Cross binary not found at {}", cross.display());
}

let cross_config = rlocation!(r, env!("CROSS_CONFIG_RLOCATION")).unwrap();

if !cross_config.exists() {
panic!("Cross config not found at {}", cross_config.display());
}

let status = Command::new(cross)
.current_dir(working_dir)
.arg("build")
Expand All @@ -43,6 +62,7 @@ fn execute_cross(working_dir: &Path, target_triple: &str) {
.arg(format!("--target={target_triple}"))
// https://github.com/cross-rs/cross/issues/1447
.env("CROSS_NO_WARNINGS", "0")
.env("CROSS_CONFIG", cross_config)
.status()
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions extensions/bindgen/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

module(
name = "rules_rust_bindgen",
version = "0.60.0",
version = "0.60.1",
)

bazel_dep(name = "rules_rust", version = "0.60.0")
bazel_dep(name = "rules_rust", version = "0.60.1")
bazel_dep(name = "bazel_features", version = "1.21.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")
Expand Down
4 changes: 2 additions & 2 deletions extensions/mdbook/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

module(
name = "rules_rust_mdbook",
version = "0.60.0",
version = "0.60.1",
)

bazel_dep(name = "rules_rust", version = "0.60.0")
bazel_dep(name = "rules_rust", version = "0.60.1")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "bazel_features", version = "1.21.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
Expand Down
4 changes: 2 additions & 2 deletions extensions/prost/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

module(
name = "rules_rust_prost",
version = "0.60.0",
version = "0.60.1",
)

bazel_dep(name = "rules_rust", version = "0.60.0")
bazel_dep(name = "rules_rust", version = "0.60.1")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "bazel_features", version = "1.21.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
Expand Down
4 changes: 2 additions & 2 deletions extensions/protobuf/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

module(
name = "rules_rust_protobuf",
version = "0.60.0",
version = "0.60.1",
)

bazel_dep(name = "rules_rust", version = "0.60.0")
bazel_dep(name = "rules_rust", version = "0.60.1")
bazel_dep(name = "bazel_features", version = "1.21.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")
Expand Down
4 changes: 2 additions & 2 deletions extensions/wasm_bindgen/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

module(
name = "rules_rust_wasm_bindgen",
version = "0.60.0",
version = "0.60.1",
)

bazel_dep(name = "rules_rust", version = "0.60.0")
bazel_dep(name = "rules_rust", version = "0.60.1")
bazel_dep(name = "bazel_features", version = "1.21.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")
Expand Down
2 changes: 1 addition & 1 deletion version.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The version of rules_rust."""

VERSION = "0.60.0"
VERSION = "0.60.1"