wit-bindgen icon indicating copy to clipboard operation
wit-bindgen copied to clipboard

Non-deterministic output for html-in-md rendering

Open ricochet opened this issue 1 year ago • 1 comments

The output order changes if --all-features is passed in versus --features= even in the case of the same feature set.

git clone https://github.com/WebAssembly/wasi-cli.git

wit-bindgen markdown wit --html-in-md --all-features
git add

wit-bindgen markdown wit --html-in-md --features=cli-exit-with-code
# note diff
# there's only one feature in this package so the output should be the same

ricochet avatar Dec 05 '24 21:12 ricochet

It is deterministic; in the cli worlds, the full equivalent of --all-features is --features=clocks-timezone,cli-exit-with-code,network-error-code.

This is because wasi-cli's worlds import from their dependencies' worlds, such as:

@since(version = 0.2.0)
world imports {
  @since(version = 0.2.0)
  include wasi:clocks/[email protected];

so features in their dependencies such as wasi-clocks' clocks-timezone influence the contents of the cli worlds.

sunfishcode avatar Dec 06 '24 05:12 sunfishcode