Skip to content

Commit

Permalink
Versioning diplomat-tool through Cargo (#4197)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian authored Oct 21, 2023
1 parent 1038217 commit 41ba05a
Show file tree
Hide file tree
Showing 14 changed files with 293 additions and 155 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -551,32 +551,6 @@ jobs:
- name: Show the selected Rust toolchain
run: rustup show

# Job-specific dependencies
- name: Run diplomat-get-rev to ensure it works
id: diplomat-getrev-check
run: cargo make --loglevel error diplomat-get-rev
- name: Get Diplomat version
id: diplomat-version
run: |
echo "::set-output name=rev::$(cargo make --loglevel error diplomat-get-rev | tr -d '[:space:]')"
shell: bash
- name: Attempt to load cached Diplomat
uses: actions/cache@v3
id: diplomat-cache
with:
path: |
~/.cargo/bin/diplomat-tool
~/.cargo/bin/diplomat-tool.exe
key: ${{ runner.os }}-diplomat-${{ steps.diplomat-version.outputs.rev }}

- name: Install Diplomat (git hash)
if: steps.diplomat-cache.outputs.cache-hit != 'true' && !contains(steps.diplomat-version.outputs.rev, '.')
run: cargo +stable install --git https://github.com/rust-diplomat/diplomat.git --rev ${{ steps.diplomat-version.outputs.rev }} diplomat-tool

- name: Install Diplomat (versioned)
if: steps.diplomat-cache.outputs.cache-hit != 'true' && contains(steps.diplomat-version.outputs.rev, '.')
run: cargo +stable install --git https://github.com/rust-diplomat/diplomat.git --version ${{ steps.diplomat-version.outputs.rev }} diplomat-tool

# Actual job
- name: Run `cargo make ci-job-diplomat`
run: cargo make ci-job-diplomat
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ Our wider testsuite is organized as `ci-job-foo` make tasks corresponding to eac
+ Requires Node.js version 16.18.0. This may not the one offered by the package manager; get it from the NodeJS website or `nvm`.
- `ci-job-nostd`: Builds ICU4X for a `#[no_std]` target to verify that it's compatible.
- `ci-job-diplomat`: Verifies that diplomat-generated bindings are up to date.
+ Requires [`Diplomat`](https://github.com/rust-diplomat/diplomat) installed at the appropriate version: `cargo make diplomat-install`.
- `ci-job-gn`: Verifies that the GN wrapper is up to date.
+ Requires GN to be installed: `cargo make gn-install`.

Expand Down
177 changes: 173 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ members = [
"tools/benchmark/macros",
"tools/benchmark/memory",
"tools/depcheck",
"tools/diplomat-gen",
"tools/ffi_coverage",
"tools/testdata-scripts",
]
Expand Down Expand Up @@ -229,12 +230,12 @@ icu_benchmark_macros = { path = "tools/benchmark/macros" }
# ffi_coverage never used as a dep
# testdata-scripts never used as a dep

# Run `cargo make diplomat-install` to get the right diplomat binary installed
# The version here can either be a `version = ".."` spec or `git = "https://github.com/rust-diplomat/diplomat", rev = ".."`
# Diplomat must be published preceding a new ICU4X release but may use git versions in between
diplomat = { git = "https://github.com/rust-diplomat/diplomat", rev = "5091e173fb2dea945ac7a7f0cba5d41288afbf00" }
diplomat-runtime = { git = "https://github.com/rust-diplomat/diplomat", rev = "5091e173fb2dea945ac7a7f0cba5d41288afbf00" }
diplomat_core = { git = "https://github.com/rust-diplomat/diplomat", rev = "5091e173fb2dea945ac7a7f0cba5d41288afbf00" }
diplomat = { git = "https://github.com/rust-diplomat/diplomat", rev = "354307d4a519a3f42a9dc744ea0d64d766431d1d" }
diplomat-runtime = { git = "https://github.com/rust-diplomat/diplomat", rev = "354307d4a519a3f42a9dc744ea0d64d766431d1d" }
diplomat_core = { git = "https://github.com/rust-diplomat/diplomat", rev = "354307d4a519a3f42a9dc744ea0d64d766431d1d" }
diplomat-tool = { git = "https://github.com/rust-diplomat/diplomat", rev = "354307d4a519a3f42a9dc744ea0d64d766431d1d" }

# LTO is needed for WASM and other size-optimized builds,
# and it improve the performance of benchmarks
Expand Down
2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ dependencies = [
"ci-job-test",
"ci-job-test-docs",
"ci-job-check-tutorials-cratesio",
"ci-job-diplomat",
"ci-job-testdata",
"ci-job-msrv-features",
"ci-job-full-datagen",

# Needs tools other than Cargo to be installed
"ci-job-diplomat",
"ci-job-test-c",
"ci-job-test-js",
"ci-job-gn",
Expand Down
1 change: 0 additions & 1 deletion ffi/capi/c/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ffi/capi/cpp/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ffi/capi/js/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 41ba05a

Please sign in to comment.