Skip to content

Commit bc8c4e3

Browse files
committed
Build the examples generator only where it can compile
`cargo test --workspace --no-default-features` builds every target in the workspace, examples included, and the examples generator asks for `textprocessing::examples` -- a module behind `#[cfg(all(feature = "chinese", feature = "korean"))]`, because it renders the whole transform table in one pass and needs both dictionaries to do it. With the features off the module is not there and the example does not compile, so `site check` fails at the test step. Nothing was wrong with either side: the module is gated because the dictionaries are 13 MB and CI has no use for them, and the example needs them because that is what it renders. What was missing is the line that says so to cargo. `required-features` makes it skip the target rather than try to build it, which is the same thing `site textprocessing-examples` was already relying on by running with default features on. It fails only in CI, and only in the no-default-features build, which is why a workspace test run here has been green throughout.
1 parent 2ff098c commit bc8c4e3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎wasm/textprocessing/Cargo.toml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ pinyin_zhuyin = { version = "0.2.0", optional = true }
3838

3939
hanja = { version = "0.1.1", optional = true }
4040
hangeul_conversion = { path = "hangeul_conversion", optional = true }
41+
42+
# The generator renders the whole table in one pass, so it needs both
43+
# dictionaries; without this it is still built by `cargo test --workspace
44+
# --no-default-features`, where `textprocessing::examples` is compiled out and
45+
# the example cannot resolve it. CI builds the workspace exactly that way, so
46+
# the failure lands there and nowhere else.
47+
[[example]]
48+
name = "generate_examples"
49+
required-features = ["chinese", "korean"]

0 commit comments

Comments
 (0)