You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find any tests that exercise component new with the --realloc-via-memory-grow or --merge-imports-based-on-semver flags.
Context: I'm trying to write examples in the help text that illustrate various flags. My first step was to look for tests to see how they should be used.
I don't think that there are dedicated tests for these flags right now unfortunately. They are used to control the default behavior of how a component is created where, for example, by default cabi_realloc is used to allocate memory but --realloc-via-memory-grow says "don't do that and instead use memory.grow". Similarly for --merge-imports-based-on-semver that turns off on-by-default behavior. These were added over time to tweak the default heuristics which is why the aren't super well tested.
The tests/cli directory has some files with --merge-world-imports-based-on-semver but none with --merge-world-imports-based-on-semver=false. The tests at crates/wit-component/tests/components test some various behaviors of reallocation but in general don't have a dedicated test for --realloc-via-memory-grow I believe.
Activity
alexcrichton commentedon Oct 7, 2025
I don't think that there are dedicated tests for these flags right now unfortunately. They are used to control the default behavior of how a component is created where, for example, by default
cabi_reallocis used to allocate memory but--realloc-via-memory-growsays "don't do that and instead usememory.grow". Similarly for--merge-imports-based-on-semverthat turns off on-by-default behavior. These were added over time to tweak the default heuristics which is why the aren't super well tested.The
tests/clidirectory has some files with--merge-world-imports-based-on-semverbut none with--merge-world-imports-based-on-semver=false. The tests atcrates/wit-component/tests/componentstest some various behaviors of reallocation but in general don't have a dedicated test for--realloc-via-memory-growI believe.Restore the default for `component new --merge-imports-based-on-semve…