Skip to content

Commit 886220f

Browse files
authored
Update tutorial_buffer.wasm and expected data markers (#5568)
Follow-up from #5567
1 parent 925393d commit 886220f

File tree

6 files changed

+36
-11
lines changed

6 files changed

+36
-11
lines changed

components/icu/src/datagen.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,23 @@ pub fn markers_for_bin(path: &Path) -> Result<HashSet<DataMarkerInfo>, DataError
8989

9090
#[test]
9191
fn test_markers_for_bin() {
92+
let hashset =
93+
markers_for_bin_inner(include_bytes!("../tests/data/tutorial_buffer.wasm")).unwrap();
94+
let mut sorted = hashset.into_iter().collect::<Vec<_>>();
95+
sorted.sort();
9296
assert_eq!(
93-
markers_for_bin_inner(include_bytes!("../tests/data/tutorial_buffer.wasm")),
94-
Ok(HashSet::from_iter([
95-
// TODO: This should include datetime markers. Why not?
97+
sorted,
98+
&[
99+
crate::datetime::provider::neo::GluePatternV1Marker::INFO,
100+
crate::datetime::provider::neo::GregorianDateNeoSkeletonPatternsV1Marker::INFO,
101+
crate::datetime::provider::neo::TimeNeoSkeletonPatternsV1Marker::INFO,
102+
crate::datetime::provider::neo::DayPeriodNamesV1Marker::INFO,
103+
crate::datetime::provider::neo::GregorianMonthNamesV1Marker::INFO,
104+
crate::datetime::provider::neo::GregorianYearNamesV1Marker::INFO,
105+
crate::datetime::provider::neo::WeekdayNamesV1Marker::INFO,
96106
crate::calendar::provider::WeekDataV1Marker::INFO,
107+
crate::calendar::provider::WeekDataV2Marker::INFO,
97108
crate::decimal::provider::DecimalSymbolsV1Marker::INFO,
98-
crate::plurals::provider::OrdinalV1Marker::INFO,
99-
]))
109+
]
100110
);
101111
}

components/icu/tests/data/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tutorial_buffer.wat

components/icu/tests/data/gen.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22

3+
set -e
4+
35
pushd $(dirname "$0")/../../../../tutorials/rust/buffer
4-
cargo +nightly build --target wasm32-unknown-unknown --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
6+
make bin/tutorial_buffer.wasm
57
popd
6-
cp $(dirname "$0")/../../../../tutorials/rust/buffer/target/wasm32-unknown-unknown/release/tutorial_buffer.wasm $(dirname "$0")
7-
8+
cp $(dirname "$0")/../../../../tutorials/rust/buffer/bin/tutorial_buffer.wasm $(dirname "$0")
9+
wasm2wat tutorial_buffer.wasm -o tutorial_buffer.wat
69.2 KB
Binary file not shown.

tutorials/rust/buffer/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tutorials/rust/buffer/Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,29 @@
44

55
export CARGO_TARGET_DIR ?= target
66

7-
all: buffer_data.postcard
7+
PINNED_CI_NIGHTLY = "nightly-2024-07-23"
8+
9+
all: buffer_data.postcard bin/tutorial_buffer.wasm
810

911
../bin/icu4x-datagen:
1012
echo "Target dir: $(CARGO_TARGET_DIR)"
11-
cargo install --path ../../provider/icu4x-datagen --root ..
13+
cargo install --path ../../../provider/icu4x-datagen --root ..
1214

1315
bin/tutorial_buffer:
1416
echo "Target dir: $(CARGO_TARGET_DIR)"
1517
cargo build --release
1618
mkdir -p bin
1719
cp -p "$(CARGO_TARGET_DIR)"/release/tutorial_buffer bin/tutorial_buffer
20+
ls -l bin/
21+
22+
bin/tutorial_buffer.wasm:
23+
echo "Target dir: $(CARGO_TARGET_DIR)"
24+
rustup toolchain install ${PINNED_CI_NIGHTLY}
25+
rustup target add wasm32-wasip1 --toolchain ${PINNED_CI_NIGHTLY}
26+
cargo +${PINNED_CI_NIGHTLY} build --target wasm32-wasip1 --release
27+
mkdir -p bin
28+
cp -p "$(CARGO_TARGET_DIR)"/wasm32-wasip1/release/tutorial_buffer.wasm bin/
29+
ls -l bin/
1830

1931
buffer_data.postcard: ../bin/icu4x-datagen bin/tutorial_buffer
2032
../bin/icu4x-datagen \

0 commit comments

Comments
 (0)