Skip to content
Open
Show file tree
Hide file tree
Changes from 12 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
21 changes: 19 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ jobs:

# ci-job-test-cargo
test-cargo:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the cost of an additional runner is worth it. the linux job is barely worth it, because we never touch the code that this tests

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm on the fence. wdyt about running it only on Windows? Then at least the job is covering something that most of the other jobs don't cover.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also fine with having Windows makefile support for harfbuzz being best-effort: we don't CI it but we try to maintain it when people ask us to fix things.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having it in .github/workflows means that it remains reproducible, which is nice.

Wdyt about making it a trigger-only job (requires pressing a button in the Actions tab) that we run periodically such as when preparing a release (except we don't want to make releases harder)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt about making it a trigger-only job (requires pressing a button in the Actions tab) that we run periodically such as when preparing a release (except we don't want to make releases harder)

then you might as well run it locally. all that the CI would test is that harfbuzz is installed correctly – this is not something we need to test because it's outside of ICU4X.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I still have a slight preference to enforce Windows client builds in CI (not just tests).

I don't care much about harfbuzz in particular as a CI thing; I would be happy if we built the cargo example crates without the harfbuzz one.

Copy link
Copy Markdown
Member

@robertbastian robertbastian Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then lets run test-c on windows (we already run test-dart). keep in mind that windows CI takes 2x longer than ubuntu

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

Expand All @@ -175,11 +178,25 @@ jobs:
run: rustup show

# Job-specific dependencies
- name: Install harfbuzz
- name: Install harfbuzz (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libharfbuzz-dev

- name: Install harfbuzz (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
choco install pkgconfiglite -y
git clone https://github.com/microsoft/vcpkg.git
Comment thread
swar09 marked this conversation as resolved.
Outdated
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install harfbuzz:x64-windows
$pkg_path = Join-Path $env:GITHUB_WORKSPACE "vcpkg\installed\x64-windows\lib\pkgconfig"
echo "PKG_CONFIG_PATH=$pkg_path" >> $env:GITHUB_ENV
$bin_path = Join-Path $env:GITHUB_WORKSPACE "vcpkg\installed\x64-windows\bin"
echo "$bin_path" >> $env:GITHUB_PATH

# Actual job
- name: Run `cargo make ci-job-test-cargo`
run: cargo make ci-job-test-cargo
Expand Down
21 changes: 14 additions & 7 deletions examples/cargo/buffer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@ export CARGO_TARGET_DIR ?= target

PINNED_CI_NIGHTLY = "nightly-2025-09-27"

ifeq ($(OS),Windows_NT)
BINARY_EXT = .exe
else
BINARY_EXT =
endif


all: buffer_data.postcard bin/tutorial_buffer.wasm

../bin/icu4x-datagen:
../bin/icu4x-datagen$(BINARY_EXT):
echo "Target dir: $(CARGO_TARGET_DIR)"
cargo install --path ../../../provider/icu4x-datagen --root ..

bin/tutorial_buffer:
bin/tutorial_buffer$(BINARY_EXT):
echo "Target dir: $(CARGO_TARGET_DIR)"
cargo build --release
mkdir -p bin
cp -p "$(CARGO_TARGET_DIR)"/release/tutorial_buffer bin/tutorial_buffer
cp -p "$(CARGO_TARGET_DIR)/release/tutorial_buffer$(BINARY_EXT)" "bin/tutorial_buffer$(BINARY_EXT)"
ls -l bin/

bin/tutorial_buffer.wasm:
Expand All @@ -25,13 +32,13 @@ bin/tutorial_buffer.wasm:
rustup target add wasm32-wasip1 --toolchain ${PINNED_CI_NIGHTLY}
cargo +${PINNED_CI_NIGHTLY} build --target wasm32-wasip1 --release
mkdir -p bin
cp -p "$(CARGO_TARGET_DIR)"/wasm32-wasip1/release/tutorial_buffer.wasm bin/
cp -p "$(CARGO_TARGET_DIR)/wasm32-wasip1/release/tutorial_buffer.wasm" bin/
Comment thread
robertbastian marked this conversation as resolved.
ls -l bin/

buffer_data.postcard: ../bin/icu4x-datagen bin/tutorial_buffer
../bin/icu4x-datagen \
buffer_data.postcard: ../bin/icu4x-datagen$(BINARY_EXT) bin/tutorial_buffer$(BINARY_EXT)
../bin/icu4x-datagen$(BINARY_EXT) \
--format blob \
--markers-for-bin bin/tutorial_buffer \
--markers-for-bin "bin/tutorial_buffer$(BINARY_EXT)" \
--locales my en-ZA \
--cldr-tag latest \
--overwrite \
Expand Down
12 changes: 9 additions & 3 deletions examples/cargo/custom_compiled/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@
export CARGO_TARGET_DIR ?= target
export MODE ?= release

ifeq ($(OS),Windows_NT)
BINARY_EXT = .exe
else
BINARY_EXT =
endif

all: clean baked_data/mod.rs

../bin/icu4x-datagen:
../bin/icu4x-datagen$(BINARY_EXT):
echo "Target dir: $(CARGO_TARGET_DIR)"
ifeq ($(MODE), "release")
cargo install --path ../../../provider/icu4x-datagen --root ..
else
cargo install --path ../../../provider/icu4x-datagen --debug --root ..
endif

baked_data/mod.rs: ../bin/icu4x-datagen
../bin/icu4x-datagen \
baked_data/mod.rs: ../bin/icu4x-datagen$(BINARY_EXT)
../bin/icu4x-datagen$(BINARY_EXT) \
--format baked \
--markers all \
--locales ru \
Expand Down
11 changes: 9 additions & 2 deletions tools/make/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,19 @@ exit_on_error true
project_dir = pwd
set_env CARGO_TARGET_DIR ${project_dir}/target

is_windows = is_windows
if ${is_windows}
binary_ext = set ".exe"
else
binary_ext = set ""
end

exec --fail-on-error cargo build -p icu4x-datagen

cd examples/cargo

mkdir bin
cp ${project_dir}/target/debug/icu4x-datagen bin/icu4x-datagen
cp ${project_dir}/target/debug/icu4x-datagen${binary_ext} bin/icu4x-datagen${binary_ext}

exec --fail-on-error cargo run --manifest-path default/Cargo.toml
exec --fail-on-error cargo run --manifest-path experimental/Cargo.toml
Expand All @@ -98,7 +105,7 @@ exec --fail-on-error cargo run --manifest-path harfbuzz/Cargo.toml
# Copy our own tutorial_buffer to speed up the task
exec --fail-on-error cargo build --manifest-path buffer/Cargo.toml
mkdir buffer/bin
cp ${project_dir}/target/debug/tutorial_buffer buffer/bin/tutorial_buffer
cp ${project_dir}/target/debug/tutorial_buffer${binary_ext} buffer/bin/tutorial_buffer${binary_ext}
exec --fail-on-error make -C buffer buffer_data.postcard
exec --fail-on-error cargo run --manifest-path buffer/Cargo.toml

Expand Down