Skip to content

Make sdk field in ModuleConfig a ModuleConfigDependency #9156

Closed

Description

@jedevc

See original discussion in #8839 (comment).

The work for pinging dependencies in #8587 didn't also apply to external SDKs. We should make the single sdk field into a ModuleConfigDependency, so that it can have both a source and a pin.

However, it probably doesn't make sense to also have the name field - we could just have it be a dangling field, or could maybe update name to be omitempty in this case if we like.

Activity

  1. added
    kind/consistency
    on Dec 10, 2024
  2. rajatjindal commented on Jan 31, 2025

    @rajatjindal
    Contributor

    instead of pursuing the SDK field as ModuleConfigDependency, we decided to have a custom struct for it as SDK and dependencies are initialized differently in the code.

    type SDK struct {
    	Source string            `json:"source"`
    	Pin    string            `json:"pin,omitempty"`
    	Env    map[string]string `json:"env,omitempty"`
    }
    
    • The source will store what is stored in "sdk" field today. so e.g. go or github.com/dagger/dagger/php etc.
    • The pin will (when it is supported) store the pinned commit
    • The env variable will contain a map (may change to a different structure) of key/value which will be injected automatically during code-generation and runtime. This will help us with configuring env variables like "GOPRIVATE" as an example.

    The existing modules will work as usual, but when user will do "dagger develop", we will change the sdk from a string to the new struct automatically.

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

    area/engine/apikind/consistencykind/external-help

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions