#Workspace, generate, local dependencies and espace root

1 messages · Page 1 of 1 (latest)

naive relic
#

I have an issue while working on replacing dagger develop by dagger generate.
Let's take a subset of our dagger/dagger as an example:

dagger/dagger/                          ← root workspace
├── .dagger/
│   └── config.toml               ← references toolchains/*, modules, etc.
├── toolchains/
│   ├── rust-sdk-dev/
│   │   ├── dagger.json           ← depends on "../engine-dev"
│   │   └── .dagger/
│   │       └── config.toml       ← develop module for dagger generate
│   └── engine-dev/
│       └── dagger.json
└── ...

When we run dagger generate on toolchains/rust-sdk-dev, it needs to load its dependencies to know what to generate. Its dagger.json declares a dependency on ../engine-dev.
But dagger generate runs with toolchains/rust-sdk-dev/ as the workspace root.

toolchains/rust-sdk-dev/          ← workspace root for dagger generate
├── dagger.json                   ← source: "../engine-dev"
└── .dagger/
    └── config.toml

../engine-dev/                    ← :warning: OUTSIDE the workspace boundary
└── dagger.json

The ../engine-dev path escapes the module's workspace. The engine won't resolve it because it's outside the workspace boundary.

On the ideas to solve it:

  • explicit escape hatch in .dagger/config.toml: Like the include in dagger.json so it allows to access files outside of the workspace
  • a way to access the root workspace? Or maybe to run dagger generate for a module but in the context of a parent workspace so it finds everything it needs?
  • something else?
#

cc @strong wraith @high veldt

strong wraith
#

that boundary enforcement is a bug

#

(I think)

#

normally the git root is the boundary

naive relic
#

ho, ok. I'll check. That would be better 🙂

strong wraith
#

which branch is that warning from? workspace?

naive relic
#

no, it's a custom branch where I'm working on develop -> generate migration
I'll try to push it today
I'll not push it in workspace directly until I have something good enough to cover most of the cases

#

I did some more tests and it's ok if I generate by hand. So it's an issue I introduced in the dagger migrate (I wanted to run it so everything is ready)
So probably no issue then 🙂