Skip to content

Global configuration for dependency modules #8419

Closed

Description

@jedevc

Let's pretend I've created a generic reusable module, golang - it can build, test, lint, generate docs, etc, everything I want a module to do.

I want to install this module as a dependency to my project. Because golang is a good module, it even supports setting the version in the constructor.

But there's an issue with this - if I want to call golang at multiple points in my module, and I need to pin the version everywhere, today I have a few options:

  • Specify the version everywhere I construct golang. This is kinda sad, and ends up with lots of duplicates.
  • Call the constructor once, and then store the result. This is also kinda sad, since now I need to pass the object everywhere in my own module (which gets worse the more such objects from other modules I might have)
  • Write a wrapper function that wraps the constructor, and just call that everywhere (this feels like the best option with what we have right now)

However, some future options include:

Not quite sure which is best, though I'm leaning towards adding more functionality to dagger.json for this. For one, it feels annoying to have to write my own wrappers everywhere, and makes it hard to update these values. Syntax like dagger install github.com/.../golang --version=v1.23 would be pretty neat.

Whatever option we pick, we need to have this based on the caller - not the dependency module. I might/might not have control over the default in the dependency golang module, and so might not be able to easily bump the version.

cc @shykes (inspired by our conversation in https://discord.com/channels/707636530424053791/1003718839739105300/1282281815347826742)

Activity

  1. locked and limited conversation to collaborators on Mar 24, 2026
  2. converted this issue into a discussion #12231 on Mar 24, 2026
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