Skip to content

install -r <runtime> does not scope the SDK step's extension or compile-section scans #209

Description

@mobileoverlord

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

  1. Add runtime: Option<String> to SdkInstallCommand with a with_runtime builder, matching with_target_board / with_sdk_arch.
  2. Set it from InstallCommand where the command is constructed.
  3. Pass self.runtime.as_deref() as requested_runtime at both call sites, so extension and compile-section selection stay consistent with each other.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions