Skip to content

Commit 93735fa

Browse files
Merge branch 'main' into patrick/bazel9
2 parents 5de61b9 + 5bad824 commit 93735fa

335 files changed

Lines changed: 11356 additions & 9202 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelci/presubmit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ aspects_flags: &aspects_flags
1717
- "--config=rustfmt"
1818
- "--config=clippy"
1919
min_rust_version_shell_commands: &min_rust_version_shell_commands
20-
- sed -i 's|^rust_register_toolchains(|rust_register_toolchains(versions = ["1.74.0"],\n|' WORKSPACE.bazel
21-
- sed -i 's|^rust\.toolchain(|rust.toolchain(versions = ["1.74.0"],\n|' MODULE.bazel
20+
- sed -i 's|^rust_register_toolchains(|rust_register_toolchains(versions = ["1.85.0"],\n|' WORKSPACE.bazel
21+
- sed -i 's|^rust\.toolchain(|rust.toolchain(versions = ["1.85.0"],\n|' MODULE.bazel
2222
nightly_flags: &nightly_flags
2323
- "--//rust/toolchain/channel=nightly"
2424
nightly_aspects_flags: &nightly_aspects_flags

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
**/cargo-bazel-lock.json linguist-generated
33
crate_universe/3rdparty/crates/** linguist-generated
44
crate_universe/test_data/metadata/*/metadata.json linguist-generated
5-
examples/bzlmod/hello_world/third-party/crates/** linguist-generated
5+
examples/hello_world/third-party/crates/** linguist-generated
66
examples/crate_universe_unnamed/vendor_remote_manifests/crates/** linguist-generated
77
examples/crate_universe_unnamed/vendor_remote_pkgs/crates/** linguist-generated
88
examples/crate_universe/vendor_external/crates/** linguist-generated

.github/workflows/determinism.yaml

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@ name: Determinism
22

33
on:
44
workflow_dispatch:
5-
pull_request:
6-
types: [opened, synchronize]
7-
paths:
8-
- test/determinism/**
5+
inputs:
6+
commit:
7+
description: "Git commit or branch to test (defaults to main)"
8+
required: false
9+
default: "main"
910

1011
jobs:
1112
check:
1213
strategy:
1314
fail-fast: false
1415
matrix:
15-
include:
16-
- os: macos-latest
17-
work_dir: ${{ env.RUNNER_TEMP }}/r
18-
- os: ubuntu-latest
19-
work_dir: ${{ env.RUNNER_TEMP }}/r
20-
- os: windows-latest
21-
work_dir: C:\r
16+
os:
17+
- macos-latest
18+
- ubuntu-latest
19+
- ubuntu-24.04-arm
20+
- windows-latest
2221

2322
runs-on: ${{ matrix.os }}
2423
name: Check (${{ matrix.os }})
@@ -28,15 +27,47 @@ jobs:
2827
with:
2928
clean: true
3029

31-
- name: Run tests
32-
continue-on-error: true
30+
- name: Choose a work directory (unix)
31+
if: runner.os != 'Windows'
32+
shell: bash
33+
run: |
34+
echo "WORK_DIR=$RUNNER_TEMP/r" >> "$GITHUB_ENV"
35+
36+
- name: Choose a work directory (windows)
37+
if: runner.os == 'Windows'
38+
shell: pwsh
3339
run: |
34-
bazel run \
35-
--compilation_mode=opt \
36-
//test/determinism:tester \
37-
-- test \
38-
--output="${{ github.workspace }}/results.json" \
39-
--work-dir="${{ matrix.work_dir }}"
40+
'WORK_DIR=C:\r' | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
41+
42+
- name: Run tests (unix)
43+
if: runner.os != 'Windows'
44+
continue-on-error: true
45+
shell: bash
46+
run: >-
47+
bazel run
48+
--compilation_mode=opt
49+
//test/determinism:tester
50+
--
51+
test
52+
--url=${{ format('{0}/{1}.git', github.server_url, github.repository) }}
53+
--commit=${{ inputs.commit }}
54+
--output="${{ github.workspace }}/results.json"
55+
--work-dir="${WORK_DIR}"
56+
57+
- name: Run tests (windows)
58+
if: runner.os == 'Windows'
59+
continue-on-error: true
60+
shell: pwsh
61+
run: >-
62+
bazel run
63+
--compilation_mode=opt
64+
//test/determinism:tester
65+
'--'
66+
test
67+
--url=${{ format('{0}/{1}.git', github.server_url, github.repository) }}
68+
--commit=${{ inputs.commit }}
69+
--output="${{ github.workspace }}/results.json"
70+
--work-dir="$env:WORK_DIR"
4071
4172
- name: Summarize (unix)
4273
if: runner.os != 'Windows'
@@ -83,16 +114,16 @@ jobs:
83114
if: runner.os != 'Windows' && always()
84115
shell: bash
85116
run: |
86-
if [[ -d "${{ matrix.work_dir }}/o" ]]; then
87-
tar -czf output-base.tar.gz -C "${{ matrix.work_dir }}" o
117+
if [[ -d "${WORK_DIR}/o" ]]; then
118+
tar -czf output-base.tar.gz -C "${WORK_DIR}" o
88119
fi
89120
90121
- name: Archive output base (windows)
91122
if: runner.os == 'Windows' && always()
92123
shell: pwsh
93124
run: |
94-
if (Test-Path "${{ matrix.work_dir }}\o") {
95-
Compress-Archive -Path "${{ matrix.work_dir }}\o" -DestinationPath output-base.zip
125+
if (Test-Path "$env:WORK_DIR\o") {
126+
Compress-Archive -Path "$env:WORK_DIR\o" -DestinationPath output-base.zip
96127
}
97128
98129
- name: Upload output base artifact
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Release Runfiles
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- rust/runfiles/Cargo.toml
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
jobs:
16+
validation:
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- uses: actions/checkout@v4
20+
# TODO: Unfortunately it's not obvious how to restrict `workflow_dispatch` to a particular branch
21+
# so this step ensures releases are always done off of `main`.
22+
- name: Ensure branch is 'main'
23+
run: |
24+
git fetch origin &> /dev/null
25+
branch="$(git rev-parse --abbrev-ref HEAD)"
26+
if [[ "${branch}" != "main" ]]; then
27+
echo "The release branch must be main. Got '${branch}'' instead." >&2
28+
exit 1
29+
else
30+
echo "Branch is '${branch}'"
31+
fi
32+
builds:
33+
needs: validation
34+
runs-on: ubuntu-22.04
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Install rust toolchains for host
38+
run: |
39+
# Detect the current version of rust
40+
version="$(grep 'DEFAULT_RUST_VERSION =' ./rust/private/common.bzl | grep -o '[[:digit:].]\+')"
41+
rustup override set "${version}"
42+
rustup update stable && rustup default stable
43+
- name: Publish to crates.io
44+
run: cargo publish --token ${CRATES_TOKEN}
45+
working-directory: ./rust/runfiles
46+
env:
47+
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}

MODULE.bazel

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ internal_deps = use_extension("//rust/private:internal_extensions.bzl", "i")
2121
use_repo(
2222
internal_deps,
2323
"rrra",
24-
"rrra__anyhow-1.0.71",
25-
"rrra__camino-1.1.9",
26-
"rrra__clap-4.3.11",
27-
"rrra__env_logger-0.10.0",
28-
"rrra__itertools-0.11.0",
29-
"rrra__log-0.4.19",
30-
"rrra__serde-1.0.171",
31-
"rrra__serde_json-1.0.102",
24+
"rrra__anyhow-1.0.102",
25+
"rrra__camino-1.2.2",
26+
"rrra__clap-4.6.0",
27+
"rrra__env_logger-0.11.10",
28+
"rrra__itertools-0.14.0",
29+
"rrra__log-0.4.29",
30+
"rrra__serde-1.0.228",
31+
"rrra__serde_json-1.0.149",
3232
"rules_rust_tinyjson",
3333
)
3434

@@ -37,7 +37,7 @@ use_repo(
3737
cargo_internal_deps,
3838
"rrc",
3939
"rrc__cargo-util-schemas-0.3.1",
40-
"rrc__cargo_toml-0.20.5",
40+
"rrc__cargo_toml-0.22.3",
4141
"rrc__pathdiff-0.1.0",
4242
"rrc__semver-1.0.25",
4343
"rrc__toml-0.8.20",
@@ -112,7 +112,7 @@ use_repo(
112112
"cui__cargo-lock-10.1.0",
113113
"cui__cargo-platform-0.1.9",
114114
"cui__cargo_metadata-0.19.2",
115-
"cui__cargo_toml-0.22.1",
115+
"cui__cargo_toml-0.22.3",
116116
"cui__cfg-expr-0.18.0",
117117
"cui__clap-4.5.37",
118118
"cui__crates-index-3.7.0",
@@ -134,7 +134,7 @@ use_repo(
134134
"cui__tempfile-3.19.1",
135135
"cui__tera-1.20.0",
136136
"cui__textwrap-0.16.2",
137-
"cui__toml-0.8.21",
137+
"cui__toml-0.9.5",
138138
"cui__tracing-0.1.41",
139139
"cui__tracing-subscriber-0.3.19",
140140
"cui__url-2.5.4",

0 commit comments

Comments
 (0)