Split out of #202, where the CHANGELOG initially claimed this scoping already existed (review comment). The clause was dropped rather than implemented, because doing it properly is a behavior change worth deciding on its own terms.
The gap
InstallCommand honors -r/--runtime for its own extension and runtime steps — find_target_relevant_runtimes passes self.runtime as requested_runtime. The SDK step it delegates to does not:
SdkInstallCommand has no runtime field at all (src/commands/sdk/install.rs), and InstallCommand never sets one when it builds the command (src/commands/install.rs, the SdkInstallCommand::new(..) chain).
- Both scans inside it therefore pass
requested_runtime: None:
find_active_extensions — drives SDK dependency computation
find_active_compile_sections — gates need_target_dev and the target-dev package list
So avocado install -r dev narrows the ext/runtime steps to dev while the SDK step still provisions against every target-relevant runtime in the file. In a multi-runtime project that means installing target-dev compile packages for runtimes the user explicitly scoped out.
Why it wasn't folded into #202
Threading self.runtime into only find_active_compile_sections would leave a new asymmetry — compile sections scoped by runtime, SDK deps for extensions not. Threading it into both is the coherent version, and that narrows which extensions get their SDK dependencies installed for a -r-scoped install. That is defensible (it is what the flag's own help text implies: "Runtime name to install dependencies for") but it is a user-visible narrowing that wants its own tests and CHANGELOG entry rather than arriving inside a compile-section fix.
Suggested shape
- Add
runtime: Option<String> to SdkInstallCommand with a with_runtime builder, matching with_target_board / with_sdk_arch.
- Set it from
InstallCommand where the command is constructed.
- Pass
self.runtime.as_deref() as requested_runtime at both call sites, so extension and compile-section selection stay consistent with each other.
- Test that
-r <name> excludes another runtime's compile section, and that omitting -r still scans every target-relevant runtime.
Note that avocado sdk install has no -r flag of its own, so this only changes the avocado install -r <name> path.
Split out of #202, where the CHANGELOG initially claimed this scoping already existed (review comment). The clause was dropped rather than implemented, because doing it properly is a behavior change worth deciding on its own terms.
The gap
InstallCommandhonors-r/--runtimefor its own extension and runtime steps —find_target_relevant_runtimespassesself.runtimeasrequested_runtime. The SDK step it delegates to does not:SdkInstallCommandhas noruntimefield at all (src/commands/sdk/install.rs), andInstallCommandnever sets one when it builds the command (src/commands/install.rs, theSdkInstallCommand::new(..)chain).requested_runtime: None:find_active_extensions— drives SDK dependency computationfind_active_compile_sections— gatesneed_target_devand the target-dev package listSo
avocado install -r devnarrows the ext/runtime steps todevwhile the SDK step still provisions against every target-relevant runtime in the file. In a multi-runtime project that means installing target-dev compile packages for runtimes the user explicitly scoped out.Why it wasn't folded into #202
Threading
self.runtimeinto onlyfind_active_compile_sectionswould leave a new asymmetry — compile sections scoped by runtime, SDK deps for extensions not. Threading it into both is the coherent version, and that narrows which extensions get their SDK dependencies installed for a-r-scoped install. That is defensible (it is what the flag's own help text implies: "Runtime name to install dependencies for") but it is a user-visible narrowing that wants its own tests and CHANGELOG entry rather than arriving inside a compile-section fix.Suggested shape
runtime: Option<String>toSdkInstallCommandwith awith_runtimebuilder, matchingwith_target_board/with_sdk_arch.InstallCommandwhere the command is constructed.self.runtime.as_deref()asrequested_runtimeat both call sites, so extension and compile-section selection stay consistent with each other.-r <name>excludes another runtime's compile section, and that omitting-rstill scans every target-relevant runtime.Note that
avocado sdk installhas no-rflag of its own, so this only changes theavocado install -r <name>path.