From 1aac1c9139a648121d44189ddb054bda9b34703f Mon Sep 17 00:00:00 2001 From: Swarnit Date: Tue, 10 Feb 2026 15:37:37 +0000 Subject: [PATCH 1/8] feat: Improve cross-platform compatibility by adding OS-specific path separators and binary extensions to Makefiles and test scripts. --- examples/cargo/buffer/Makefile | 32 +++++++++++++++---------- examples/cargo/custom_compiled/Makefile | 20 +++++++++++----- tools/make/tests.toml | 11 +++++++-- 3 files changed, 43 insertions(+), 20 deletions(-) diff --git a/examples/cargo/buffer/Makefile b/examples/cargo/buffer/Makefile index e2d95b8078c..e3a87e95464 100755 --- a/examples/cargo/buffer/Makefile +++ b/examples/cargo/buffer/Makefile @@ -6,32 +6,40 @@ export CARGO_TARGET_DIR ?= target PINNED_CI_NIGHTLY = "nightly-2025-09-27" -all: buffer_data.postcard bin/tutorial_buffer.wasm +ifeq ($(OS),Windows_NT) + BINARY_EXT = .exe + SEP = $(strip \) +else + BINARY_EXT = + SEP = / +endif -../bin/icu4x-datagen: +all: buffer_data.postcard bin$(SEP)tutorial_buffer.wasm + +..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT): echo "Target dir: $(CARGO_TARGET_DIR)" - cargo install --path ../../../provider/icu4x-datagen --root .. + cargo install --path ..$(SEP)..$(SEP)..$(SEP)provider$(SEP)icu4x-datagen --root .. -bin/tutorial_buffer: +bin$(SEP)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 - ls -l bin/ + cp -p "$(CARGO_TARGET_DIR)$(SEP)release$(SEP)tutorial_buffer$(BINARY_EXT)" "bin$(SEP)tutorial_buffer$(BINARY_EXT)" + ls -l bin$(SEP) -bin/tutorial_buffer.wasm: +bin$(SEP)tutorial_buffer.wasm: echo "Target dir: $(CARGO_TARGET_DIR)" rustup toolchain install ${PINNED_CI_NIGHTLY} 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/ - ls -l bin/ + cp -p "$(CARGO_TARGET_DIR)$(SEP)wasm32-wasip1$(SEP)release$(SEP)tutorial_buffer.wasm" bin$(SEP) + ls -l bin$(SEP) -buffer_data.postcard: ../bin/icu4x-datagen bin/tutorial_buffer - ../bin/icu4x-datagen \ +buffer_data.postcard: ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) bin$(SEP)tutorial_buffer$(BINARY_EXT) + ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) \ --format blob \ - --markers-for-bin bin/tutorial_buffer \ + --markers-for-bin "bin$(SEP)tutorial_buffer$(BINARY_EXT)" \ --locales my en-ZA \ --cldr-tag latest \ --overwrite \ diff --git a/examples/cargo/custom_compiled/Makefile b/examples/cargo/custom_compiled/Makefile index e288d3a5bef..d130ac45477 100755 --- a/examples/cargo/custom_compiled/Makefile +++ b/examples/cargo/custom_compiled/Makefile @@ -5,18 +5,26 @@ export CARGO_TARGET_DIR ?= target export MODE ?= release -all: clean baked_data/mod.rs +ifeq ($(OS),Windows_NT) + BINARY_EXT = .exe + SEP = $(strip \) +else + BINARY_EXT = + SEP = / +endif -../bin/icu4x-datagen: +all: clean baked_data$(SEP)mod.rs + +..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT): echo "Target dir: $(CARGO_TARGET_DIR)" ifeq ($(MODE), "release") - cargo install --path ../../../provider/icu4x-datagen --root .. + cargo install --path ..$(SEP)..$(SEP)..$(SEP)provider$(SEP)icu4x-datagen --root .. else - cargo install --path ../../../provider/icu4x-datagen --debug --root .. + cargo install --path ..$(SEP)..$(SEP)..$(SEP)provider$(SEP)icu4x-datagen --debug --root .. endif -baked_data/mod.rs: ../bin/icu4x-datagen - ../bin/icu4x-datagen \ +baked_data$(SEP)mod.rs: ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) + ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) \ --format baked \ --markers all \ --locales ru \ diff --git a/tools/make/tests.toml b/tools/make/tests.toml index 9aa4a8ca4e9..8b7733824dd 100644 --- a/tools/make/tests.toml +++ b/tools/make/tests.toml @@ -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 @@ -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 From 4b0dd3f54607516246330fba83f9fa37c678c791 Mon Sep 17 00:00:00 2001 From: Swarnit Date: Wed, 11 Feb 2026 05:26:56 +0000 Subject: [PATCH 2/8] build: Standardize path separators in Makefiles by replacing the `$(SEP)` variable with literal slashes. --- examples/cargo/buffer/Makefile | 10 +++++----- examples/cargo/custom_compiled/Makefile | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/cargo/buffer/Makefile b/examples/cargo/buffer/Makefile index e3a87e95464..1a623cb2a96 100755 --- a/examples/cargo/buffer/Makefile +++ b/examples/cargo/buffer/Makefile @@ -14,20 +14,20 @@ else SEP = / endif -all: buffer_data.postcard bin$(SEP)tutorial_buffer.wasm +all: buffer_data.postcard bin/tutorial_buffer.wasm -..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT): +../bin/icu4x-datagen$(BINARY_EXT): echo "Target dir: $(CARGO_TARGET_DIR)" cargo install --path ..$(SEP)..$(SEP)..$(SEP)provider$(SEP)icu4x-datagen --root .. -bin$(SEP)tutorial_buffer$(BINARY_EXT): +bin/tutorial_buffer$(BINARY_EXT): echo "Target dir: $(CARGO_TARGET_DIR)" cargo build --release mkdir -p bin cp -p "$(CARGO_TARGET_DIR)$(SEP)release$(SEP)tutorial_buffer$(BINARY_EXT)" "bin$(SEP)tutorial_buffer$(BINARY_EXT)" ls -l bin$(SEP) -bin$(SEP)tutorial_buffer.wasm: +bin/tutorial_buffer.wasm: echo "Target dir: $(CARGO_TARGET_DIR)" rustup toolchain install ${PINNED_CI_NIGHTLY} rustup target add wasm32-wasip1 --toolchain ${PINNED_CI_NIGHTLY} @@ -36,7 +36,7 @@ bin$(SEP)tutorial_buffer.wasm: cp -p "$(CARGO_TARGET_DIR)$(SEP)wasm32-wasip1$(SEP)release$(SEP)tutorial_buffer.wasm" bin$(SEP) ls -l bin$(SEP) -buffer_data.postcard: ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) bin$(SEP)tutorial_buffer$(BINARY_EXT) +buffer_data.postcard: ../bin/icu4x-datagen$(BINARY_EXT) bin/tutorial_buffer$(BINARY_EXT) ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) \ --format blob \ --markers-for-bin "bin$(SEP)tutorial_buffer$(BINARY_EXT)" \ diff --git a/examples/cargo/custom_compiled/Makefile b/examples/cargo/custom_compiled/Makefile index d130ac45477..aa507f9c2ae 100755 --- a/examples/cargo/custom_compiled/Makefile +++ b/examples/cargo/custom_compiled/Makefile @@ -13,9 +13,9 @@ else SEP = / endif -all: clean baked_data$(SEP)mod.rs +all: clean baked_data/mod.rs -..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT): +../bin/icu4x-datagen$(BINARY_EXT): echo "Target dir: $(CARGO_TARGET_DIR)" ifeq ($(MODE), "release") cargo install --path ..$(SEP)..$(SEP)..$(SEP)provider$(SEP)icu4x-datagen --root .. @@ -23,7 +23,7 @@ all: clean baked_data$(SEP)mod.rs cargo install --path ..$(SEP)..$(SEP)..$(SEP)provider$(SEP)icu4x-datagen --debug --root .. endif -baked_data$(SEP)mod.rs: ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) +baked_data/mod.rs: ../bin/icu4x-datagen$(BINARY_EXT) ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) \ --format baked \ --markers all \ From e38efc643afcd10786deb76c66bc83c4c140905e Mon Sep 17 00:00:00 2001 From: swar09 Date: Wed, 11 Feb 2026 12:41:41 +0530 Subject: [PATCH 3/8] update build-test.yml --- .github/workflows/build-test.yml | 22 ++++++++++++++++++++-- vcpkg | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) create mode 160000 vcpkg diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 8ac1586fe0e..9ab8e31c31c 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -158,7 +158,10 @@ jobs: # ci-job-test-cargo test-cargo: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -175,11 +178,26 @@ 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 + + git clone https://github.com/microsoft/vcpkg.git + .\vcpkg\bootstrap-vcpkg.bat + + .\vcpkg\vcpkg install harfbuzz:x64-windows + + echo "PKG_CONFIG_PATH=$PWD/vcpkg/installed/x64-windows/lib/pkgconfig" >> $GITHUB_ENV + echo "$PWD/vcpkg/installed/x64-windows/bin" >> $GITHUB_PATH + # Actual job - name: Run `cargo make ci-job-test-cargo` run: cargo make ci-job-test-cargo diff --git a/vcpkg b/vcpkg new file mode 160000 index 00000000000..36fb57eb387 --- /dev/null +++ b/vcpkg @@ -0,0 +1 @@ +Subproject commit 36fb57eb3878cc3422351a91d3e87c328388dabd From dc59745638e5571f1bdee1810232f829a87a6722 Mon Sep 17 00:00:00 2001 From: swar09 Date: Wed, 11 Feb 2026 15:30:19 +0530 Subject: [PATCH 4/8] update ci-job test-cargo (#3109) --- .github/workflows/build-test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 9ab8e31c31c..68f574ddc36 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -188,15 +188,14 @@ jobs: if: matrix.os == 'windows-latest' shell: pwsh run: | - choco install pkgconfiglite - + choco install pkgconfiglite -y git clone https://github.com/microsoft/vcpkg.git .\vcpkg\bootstrap-vcpkg.bat - .\vcpkg\vcpkg install harfbuzz:x64-windows - - echo "PKG_CONFIG_PATH=$PWD/vcpkg/installed/x64-windows/lib/pkgconfig" >> $GITHUB_ENV - echo "$PWD/vcpkg/installed/x64-windows/bin" >> $GITHUB_PATH + $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` From a83006908723c8b0d9c4d5fb3806bddcff51507c Mon Sep 17 00:00:00 2001 From: swar09 Date: Wed, 11 Feb 2026 15:47:43 +0530 Subject: [PATCH 5/8] testing workflow --- .github/workflows/build-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 68f574ddc36..cdecc3880e5 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -13,6 +13,7 @@ on: branches: - 'main' - 'release/**' + - 'crossplatform-makefile' pull_request: workflow_dispatch: inputs: From b79e21a88c892320fc8190df3719a6976815bedc Mon Sep 17 00:00:00 2001 From: swar09 Date: Wed, 11 Feb 2026 16:50:42 +0530 Subject: [PATCH 6/8] updated --- examples/cargo/buffer/Makefile | 17 ++++++++--------- examples/cargo/custom_compiled/Makefile | 8 +++----- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/examples/cargo/buffer/Makefile b/examples/cargo/buffer/Makefile index 1a623cb2a96..8b32909ce71 100755 --- a/examples/cargo/buffer/Makefile +++ b/examples/cargo/buffer/Makefile @@ -8,24 +8,23 @@ PINNED_CI_NIGHTLY = "nightly-2025-09-27" ifeq ($(OS),Windows_NT) BINARY_EXT = .exe - SEP = $(strip \) else BINARY_EXT = - SEP = / endif + all: buffer_data.postcard bin/tutorial_buffer.wasm ../bin/icu4x-datagen$(BINARY_EXT): echo "Target dir: $(CARGO_TARGET_DIR)" - cargo install --path ..$(SEP)..$(SEP)..$(SEP)provider$(SEP)icu4x-datagen --root .. + cargo install --path ../../../provider/icu4x-datagen --root .. bin/tutorial_buffer$(BINARY_EXT): echo "Target dir: $(CARGO_TARGET_DIR)" cargo build --release mkdir -p bin - cp -p "$(CARGO_TARGET_DIR)$(SEP)release$(SEP)tutorial_buffer$(BINARY_EXT)" "bin$(SEP)tutorial_buffer$(BINARY_EXT)" - ls -l bin$(SEP) + cp -p "$(CARGO_TARGET_DIR)/release/tutorial_buffer$(BINARY_EXT)" "bin/tutorial_buffer$(BINARY_EXT)" + ls -l bin/ bin/tutorial_buffer.wasm: echo "Target dir: $(CARGO_TARGET_DIR)" @@ -33,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)$(SEP)wasm32-wasip1$(SEP)release$(SEP)tutorial_buffer.wasm" bin$(SEP) - ls -l bin$(SEP) + cp -p "$(CARGO_TARGET_DIR)/wasm32-wasip1/release/tutorial_buffer.wasm" bin/ + ls -l bin/ buffer_data.postcard: ../bin/icu4x-datagen$(BINARY_EXT) bin/tutorial_buffer$(BINARY_EXT) - ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) \ + ../bin/icu4x-datagen$(BINARY_EXT) \ --format blob \ - --markers-for-bin "bin$(SEP)tutorial_buffer$(BINARY_EXT)" \ + --markers-for-bin "bin/tutorial_buffer$(BINARY_EXT)" \ --locales my en-ZA \ --cldr-tag latest \ --overwrite \ diff --git a/examples/cargo/custom_compiled/Makefile b/examples/cargo/custom_compiled/Makefile index aa507f9c2ae..b469e041775 100755 --- a/examples/cargo/custom_compiled/Makefile +++ b/examples/cargo/custom_compiled/Makefile @@ -7,10 +7,8 @@ export MODE ?= release ifeq ($(OS),Windows_NT) BINARY_EXT = .exe - SEP = $(strip \) else BINARY_EXT = - SEP = / endif all: clean baked_data/mod.rs @@ -18,13 +16,13 @@ all: clean baked_data/mod.rs ../bin/icu4x-datagen$(BINARY_EXT): echo "Target dir: $(CARGO_TARGET_DIR)" ifeq ($(MODE), "release") - cargo install --path ..$(SEP)..$(SEP)..$(SEP)provider$(SEP)icu4x-datagen --root .. + cargo install --path ../../../provider/icu4x-datagen --root .. else - cargo install --path ..$(SEP)..$(SEP)..$(SEP)provider$(SEP)icu4x-datagen --debug --root .. + cargo install --path ../../../provider/icu4x-datagen --debug --root .. endif baked_data/mod.rs: ../bin/icu4x-datagen$(BINARY_EXT) - ..$(SEP)bin$(SEP)icu4x-datagen$(BINARY_EXT) \ + ../bin/icu4x-datagen$(BINARY_EXT) \ --format baked \ --markers all \ --locales ru \ From ba7efcd573dbadb547f9e21aa8d7802f08709d5b Mon Sep 17 00:00:00 2001 From: swar09 Date: Wed, 11 Feb 2026 19:21:44 +0530 Subject: [PATCH 7/8] fix: Windows CI by adding cross-platform Makefile support (#3109) --- .github/workflows/build-test.yml | 1 - vcpkg | 1 - 2 files changed, 2 deletions(-) delete mode 160000 vcpkg diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index cdecc3880e5..68f574ddc36 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -13,7 +13,6 @@ on: branches: - 'main' - 'release/**' - - 'crossplatform-makefile' pull_request: workflow_dispatch: inputs: diff --git a/vcpkg b/vcpkg deleted file mode 160000 index 36fb57eb387..00000000000 --- a/vcpkg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 36fb57eb3878cc3422351a91d3e87c328388dabd From 64cd1bd7681edc4aa5a35062efd91f0fcd19be15 Mon Sep 17 00:00:00 2001 From: Swarnit <68743524+swar09@users.noreply.github.com> Date: Sat, 14 Feb 2026 06:43:11 +0530 Subject: [PATCH 8/8] Update .github/workflows/build-test.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 68f574ddc36..f4c0a4f87d1 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -189,7 +189,7 @@ jobs: shell: pwsh run: | choco install pkgconfiglite -y - git clone https://github.com/microsoft/vcpkg.git + git clone --depth 1 https://github.com/microsoft/vcpkg.git .\vcpkg\bootstrap-vcpkg.bat .\vcpkg\vcpkg install harfbuzz:x64-windows $pkg_path = Join-Path $env:GITHUB_WORKSPACE "vcpkg\installed\x64-windows\lib\pkgconfig"