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

Versioning diplomat-tool through Cargo #4197

Merged
merged 7 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
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 = "ee7b717c6c7edd86f39e7293b176c00f4343b1ea" }
diplomat-runtime = { git = "https://github.com/rust-diplomat/diplomat", rev = "ee7b717c6c7edd86f39e7293b176c00f4343b1ea" }
diplomat_core = { git = "https://github.com/rust-diplomat/diplomat", rev = "ee7b717c6c7edd86f39e7293b176c00f4343b1ea" }
diplomat-tool = { git = "https://github.com/rust-diplomat/diplomat", rev = "ee7b717c6c7edd86f39e7293b176c00f4343b1ea" }

# 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
Loading